jamhussain
04-18-2012, 06:41 PM
<form method="post" action="ecc.php">
<table bgcolor="#FFCC00" width="40" border="2" cellspacing="10">
<tr><td colspan="20"><input type="radio" name="type" value="1000" />1000 point </tr>
<tr><td colspan="20"><input type="radio" name="type" value="500" />500 point </tr>
<tr><td colspan="2" align="center"><input type="submit" name="submit" id="submit" />
</table>
</form>
<?php
session_start();
if (isset($_POST['Submit'])) {
$_SESSION['a'][0] = $_POST['type'];
if($_SESSION['a'][0]== 1000)
{ $b==1000;}
else
{ $b==500;}
echo"the no is ".$b;
}
?>
please check it that it is right. I want to save the value of radio button in a variable so that I may use it in further calculation.
<table bgcolor="#FFCC00" width="40" border="2" cellspacing="10">
<tr><td colspan="20"><input type="radio" name="type" value="1000" />1000 point </tr>
<tr><td colspan="20"><input type="radio" name="type" value="500" />500 point </tr>
<tr><td colspan="2" align="center"><input type="submit" name="submit" id="submit" />
</table>
</form>
<?php
session_start();
if (isset($_POST['Submit'])) {
$_SESSION['a'][0] = $_POST['type'];
if($_SESSION['a'][0]== 1000)
{ $b==1000;}
else
{ $b==500;}
echo"the no is ".$b;
}
?>
please check it that it is right. I want to save the value of radio button in a variable so that I may use it in further calculation.