nathan1 Posted August 22, 2008 Share Posted August 22, 2008 Hiya guys, I have a problem with trying to post multiple id's...i have a url and im using $_GET['the id']..and thats fine, but i want to get two.... page.php$id=1$otherid=42 i want to do something like that..... is that possible? how would i go about it? thanks Quote Link to comment Share on other sites More sharing options...
ratcateme Posted August 22, 2008 Share Posted August 22, 2008 just add a & between them page.php?id=1&otherid=42 then $id = $_GET['id']; $otherid=$_GET['otherid']; Scott. Quote Link to comment Share on other sites More sharing options...
nathan1 Posted August 22, 2008 Author Share Posted August 22, 2008 Hi, thanks, i have tried that and it is not working.. Quote Link to comment Share on other sites More sharing options...
ratcateme Posted August 22, 2008 Share Posted August 22, 2008 can you post some of your code do you want something like page.php?id=$id&otherid=$otherid Scott. Quote Link to comment Share on other sites More sharing options...
s1yman Posted August 22, 2008 Share Posted August 22, 2008 page.php$id=1$otherid=42 Not sure if that was just a typo but thought I better make sure, don't forget the question mark. page.php?$id=1&$otherid=42 Quote Link to comment Share on other sites More sharing options...
nathan1 Posted August 23, 2008 Author Share Posted August 23, 2008 event.php?event_id=23?user_id=1 //getting the first id $id = $_GET['event_id']; $result = mysql_query("SELECT * FROM events WHERE event_id=$id") or die("Error querying customer database1"); //getting the first id $user_id = $_GET['user_id']; i get a error querying database, but i didnt get this error before i added the other $....so im thinking it cant tell were one ended and another began ? Quote Link to comment Share on other sites More sharing options...
iversonm Posted August 23, 2008 Share Posted August 23, 2008 you want a question mark at the end of the filename so like this page.php? then you just list your items id=what eventid=whatever then you add them together with a & so like this page.php?id=what&eventid=whatever you need the & sign when there is more then 1 thing and for each thing just add another & like this page.php?id=what&eventid=whatever&something=this help at all? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted August 23, 2008 Share Posted August 23, 2008 make sure your urls are w3 compliant and readable using functions such as http://us2.php.net/urlencode in xhtml 1.0 you need to use & in any link where u want a "&" so also watch out for that if u follow w3 (which u should) Quote Link to comment Share on other sites More sharing options...
nathan1 Posted August 24, 2008 Author Share Posted August 24, 2008 thanks so much for the help, appreciate it - got it working now Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.