Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
|
I've re-read 3 times, but I'm still not sure I have understood it...
So, you have 1 page, call it "select.php" that generate a drop down from your db.
When you choose an option in that drop down, it redirect you to another page, let's call it "action.php".
You verified that action.php received the ID correctly.
Now, do you want action.php to display you other infos relevant to the id, or do you want to be redirected to another page that does display those infos?
If it's the first case, you need to query the db again, with the given id, to fetch the details.
If it's the second case, the easiest way to keep the id between the pages is to put it's value into $_SESSION, redirect to the page that fetch the infos from the id, and cleanup the id from the session.
And if your question is "how do I get the infos ?"
then, although you'll need to adapt to your db structure:
PHP Code:
$id=$_SESSION['user_id']; //or $_POST, but you let yourself open to sql injection that way. $user=null; if($id!==null){ $sql="select * from users where id=$id"; $r=mysql_query($sql); while($o=mysql_fetch_array()){ $user=$o; } }
if($user!==null){ foreach($user as $key=>$value){ echo "<hr/>$key is $value"; } }
__________________
Only a biker knows why a dog sticks his head out the window.
|