...

View Full Version : passing two value on another page



Anishgiri
11-20-2010, 01:04 AM
I know how to pass a single value on another page, but I can't get the right syntax on passing two value on another page.



header("location: next.php?room=12");


The code above will work



header("location: next.php?room=12 room2=13");


This will make an error



echo"
<a href="search_display_room2.php?id=' . $row['roomnumber'] . '">'.$room_type.' </a>
"


In the code above it will work, but I am also trying to pass two value on two different variable here, but I can't get it right.



<a href="search_display_room2.php?id=' . $row['roomnumber'] . ' id2= '. $row['roomnumber'] . ' ">'.$room_type.' </a>



The above code will produce an error

DrDOS
11-20-2010, 01:08 AM
The ? is the default separator.

header("location: next.php?room=12?room2=13");

Anishgiri
11-20-2010, 01:16 AM
The ? is the default separator.

header("location: next.php?room=12?room2=13");


it gives a notice Undefined index: room2 , i found the solution i should use & instead right?



header("location: next.php?room=12 & room2=13");

DrDOS
11-20-2010, 01:19 AM
it gives a notice Undefined index: room2 , i found the solution i should use & instead right?



header("location: next.php?room=12 & room2=13");
I keep getting those two mixed up. That must be right.

Keleth
11-20-2010, 03:15 AM
? at the end of a URL indicates the following are GET variables. The & breaks up multiple variables.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum