Link to home
Start Free TrialLog in
Avatar of tracy_p
tracy_p

asked on

Using html,php and mysql

when i click on the radio button i want that data to be stored in the database. can any1 help me plz.
Avatar of absx
absx
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi Tracy,

Have you got the HTML form for us to see? It'd be easier to know what you mean and adapt the solution to your problem.
Avatar of tracy_p
tracy_p

ASKER

Thanks a lot for your reply. I found the solution for myself.
try this
<?php
if (isset($_POST['S1'])) {
echo  "username = ".$_POST['username']."<br>";
echo  "password = ".$_POST['pass']."<br>";
//do your sql insert statment
 
}
?>
<form name="form" action="<?=$_SERVER['php_SELF']?>" method="POST">
<input name="username" type="text">
<input name="pass" type="password">
<input type="radio" name="S1" value="ABC" onClick="this.form.submit();">
</form>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of ee_auto
ee_auto

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial