proud Posted January 20, 2010 Share Posted January 20, 2010 Hello everyone, I want to use $_GET to retrieve a value from a URL. Now, the problem is that I have 2 values that I want to get from the following URL: http://localhost/library/title_info.php?book=My Book_student=mike The values that I want to get are: My Book, and mike .. Now, I know that its easy to get the last value by the following code for example: $get=$_GET['student']; which will give me the value: mike.. But the problem is how can i get the value of book which is: My Book? Because if I tried: $get=$_GET['book']; The value of $get would be: My Book_student=mike Put in consideration that I want "My Book" only and not the rest of the URL after it.. So is there someway to omit the rest of the string starting from the under score "_" , or is there any other way to accomplish this? Quote Link to comment Share on other sites More sharing options...
co.ador Posted January 20, 2010 Share Posted January 20, 2010 you have to append it using "&". like http://localhost/library/title_info.php?"book='$_GET['book']. '&student='. $_GET['student']; something like that! Quote Link to comment Share on other sites More sharing options...
proud Posted January 20, 2010 Author Share Posted January 20, 2010 Yes that does the job! Thanks a lot co.ador Quote Link to comment Share on other sites More sharing options...
co.ador Posted January 20, 2010 Share Posted January 20, 2010 you are welcome! 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.