deansaddigh Posted January 5, 2010 Share Posted January 5, 2010 what does this part do error= i understand the variable $error because that holds a string. But what does the error= do? Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/187326-headerlocation-booknowphp-errorerror-what/ Share on other sites More sharing options...
RaythMistwalker Posted January 5, 2010 Share Posted January 5, 2010 it returns a value like if you went to page booknow.php?error=$error then it would display the error message for what error=. Example: viewprofile.php?memberid=2 This is one i use which the script then knows it has to find user id number 2 Quote Link to comment https://forums.phpfreaks.com/topic/187326-headerlocation-booknowphp-errorerror-what/#findComment-989188 Share on other sites More sharing options...
deansaddigh Posted January 5, 2010 Author Share Posted January 5, 2010 Thank you. Just one question, why couldnt you have booknow.php?$error and forget the error= part? Could the error= be called what ever you want like message=$error Quote Link to comment https://forums.phpfreaks.com/topic/187326-headerlocation-booknowphp-errorerror-what/#findComment-989191 Share on other sites More sharing options...
RaythMistwalker Posted January 5, 2010 Share Posted January 5, 2010 if you just put $error then it would look for a value after it. Yes you could use any name you want providing you have $_GET['name'] and change name to match page.php?name= Quote Link to comment https://forums.phpfreaks.com/topic/187326-headerlocation-booknowphp-errorerror-what/#findComment-989196 Share on other sites More sharing options...
KevinM1 Posted January 5, 2010 Share Posted January 5, 2010 For clarity's sake, the portion of the URL that begins with a '?' is called a query string. The information in the string is sent to a server side script for processing. This information is grouped as name-value pairs. The first bit is the name of the parameter being sent to the script, while the part after the '=' is the value of that parameter. You can send multiple name-value pairs by separating them with the '&' symbol, like so: http://www.example.com/formprocessor.php?name=Bubba&age=44 Quote Link to comment https://forums.phpfreaks.com/topic/187326-headerlocation-booknowphp-errorerror-what/#findComment-989202 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.