Hank Posted November 9, 2015 Share Posted November 9, 2015 I want to use two variables contained un a URL: www.mysite/mypage.php?number=12345&word=hello How do I retrieve these variables into my PHP? Quote Link to comment Share on other sites More sharing options...
0x00 Posted November 9, 2015 Share Posted November 9, 2015 $_GET['number'], etc... others may include $_POST (for items submitted by a form) and $_REQUEST (does both GET or POST in one) Quote Link to comment Share on other sites More sharing options...
QuickOldCar Posted November 9, 2015 Share Posted November 9, 2015 http://php.net/manual/en/reserved.variables.get.php Quote Link to comment Share on other sites More sharing options...
hansford Posted November 10, 2015 Share Posted November 10, 2015 Given your example: www.mysite/mypage.php?number=12345&word=hello mypage.php <?php error_reporting(E_ALL); ini_set('display_errors',1); if (isset($_GET['number'])) { $number = $_GET['number']; } if (isset($_GET['word'])) { $word = $_GET['word']; } 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.