hi all,
i want to pass the value selected by radio button to url. so please help me. thank u..
<?php
ob_start();
@session_start();
require_once ("check.php");
$con=mysql_connect("10.70.1.50","invensis","invensis");
if(!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("database_myproject",$con);
$query= mysql_query("SELECT projectassign FROM projectassign where userid=(select userid from users where username='$username' and role='2')");
mysql_error();
$num=mysql_num_rows($query);
mysql_close($con);
?>
<head>
<body>
<script language="javascript" type="text/javascript">
function check()
{
if(document.getElementById('radio[]').value == "")
{
alert('Please select project');
return false;
}
}
</script>
<form action="upload.php" method="POST">
<table width="100%">
<tr><td><img src="Logofinalcopy.gif">
</td></tr>
<tr>
<td bgcolor="aqua"><h2>User</h2></td>
</tr>
</table>
<table border="1" cellspacing="0" cellpadding="0" align="center" style="width: 500px">
<tr>
<th></th>
<th>projectassign</th>
</tr>
<?php
$sno=1;
while($row=mysql_fetch_array($query, MYSQL_ASSOC)){
?>
<tr>
<td><input name="radio" type="radio" id="radio[]" checked="checked" value="<?php echo $row['projectassign'];?>"></td>
<td><?php echo $row['projectassign'];?></td>
</tr>
<?php
$sno=$sno+1;
}
?>
</table>
<input type="submit" name="Submit" value="Submit">
</body></head>