Emperio Posted January 13, 2010 Share Posted January 13, 2010 Hi all, I got this url which sendes variables to the other page, preax.php?naam=X1?id=X2 now i got this code in the next page which must take the variables from the url, <?php include 'connect.php'; session_start(); ?> <link rel="stylesheet" href="style.css" type="text/css"> <?php if (isset($_SESSION['player'])) { $player=$_SESSION['player']; $userstats="SELECT * from users where playername='$player'"; $userstats2=mysql_query($userstats) or die("Could not get user stats"); $userstats3=mysql_fetch_array($userstats2); $id = $_GET['id']; $naam = $_GET['naam']; echo "Name:$naam"; echo "ID:$id"; } else { print "Sorry, not logged in please <A href='login.php'>Login</a><br>"; } ?> When i echo them i dont get them can someone help me with this? Quote Link to comment https://forums.phpfreaks.com/topic/188371-page-dont-picks-variables-with-_get/ Share on other sites More sharing options...
mikesta707 Posted January 13, 2010 Share Posted January 13, 2010 the URL parameters are formatted incorrectly. When you send $_GET data, you append a ? at the end of the filename (IE page.php?) and then you add the variables (IE page.php?id=5) if you have multiple variables, after the first variable, you separate them with the ampersand (&) IE (page.php?id=5&other=6) Quote Link to comment https://forums.phpfreaks.com/topic/188371-page-dont-picks-variables-with-_get/#findComment-994427 Share on other sites More sharing options...
Emperio Posted January 13, 2010 Author Share Posted January 13, 2010 Oh dude thanks man what a stupid mistake hahaha Quote Link to comment https://forums.phpfreaks.com/topic/188371-page-dont-picks-variables-with-_get/#findComment-994443 Share on other sites More sharing options...
mikesta707 Posted January 13, 2010 Share Posted January 13, 2010 np, if your topic is solved you can click the marked solved button at the bottom of the thread Quote Link to comment https://forums.phpfreaks.com/topic/188371-page-dont-picks-variables-with-_get/#findComment-994448 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.