Check Box Use

HI Guys,

I’m a newbie here and just want to ask how to get the 555.5555 on the url below so i can call it for other functions:

http://localhost/mktg/submit.php?%3Fid%3D555.5555=on

here is my code. Appreciate your help. Thank you.

$sqlcall="select * from test order by test_name asc";
$sqlview=mysql_query($sqlcall);
		while ($row = mysql_fetch_array($sqlview))
		{
		echo "<form action='submit.php' method='GET'>";
		echo "<tr><td><input type='checkbox' name=?id=". $row['test_id'] ."></td>";
		echo "<td>" . $row['test_id'] . "</td>";
		echo "<td>" . $row['test_name'] . "</td>";
		echo "<td>" . $row['test_price'] . "</td></tr>";
		}

		echo "<input type='submit'>";

Checkbox requires name and value:

echo '<tr><td><input type="checkbox" name="id" value="'. $row['test_id'] .'"></td>';

How to check checkbox status:

$is_selected = isset($_GET['id']);

The thing to remember with both checkboxes and radio buttons is that if the checkbox ins “unchecked” or a radio button hasn’t had an option selected, nothing will be sent to the web server for that field.

btw @rc1127 you need to be migrating away from the old mysql_* extension as it’s deprecated as of version 5.5 of PHP and is being removed from the next version of PHP (7)

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.