Originally posted by blaci
Hi!
My website member's unique information is there ID.
I want to make an admintistration page wich will show near all the information from that member, a checkbox with the member id.
When i will select the checkbox i want to select from the database those members..
Thanks for your answer!
This might get you started:
html form with checkboxes:
<html>
<head>
<title>Untitled</title>
</head>
<body>
<form method="post" action="http://www.xxx.com/check.php">
<optgroup label="ID">
<input type="checkbox" name="ID1" value="1" >ID 1<br>
<input type="checkbox" name="ID2" value="2" >ID 2<br>
<input type="checkbox" name="ID3" value="3" >ID 3<br>
<input type="checkbox" name="ID4" value="4" >ID 4<br>
</optgroup>
<input type="submit" name="Submit" value="Go">
</form>
</body>
</html>
php code to display the check boxes which
check.php:
<?php
echo "ID1: ".$ID1 ."<br>";
echo "ID2: ".$ID2 ."<br>";
echo "ID3: ".$ID3 ."<br>";
echo "ID4: ".$ID4 ."<br>";
?>
Note, only the check boxes that are checked give a value. If it is unchecked it returns null (or empty string);
to go to get the data from the database I would use something like:
select * from user_table where
user_id in ( $users )
where $users would be a string made up of comma separated ids.
I'm sure there is a cunning way to extract the $IDx values into a comma separated string. I just don't know how in php. Anyone?
HTH a little,
Mike