peterjc Posted March 8, 2007 Share Posted March 8, 2007 I am really new to php. So i hope someone could help me to solve the difficulty that i face. Could someone please help me to explain what is the use of $HTTP_SERVER_VAR[];. ----------------------- $page_location = $page_location ."?". $HTTP_SERVER_VAR["QUERY_STRING"]; What is the use of the question mark that is put in between $page_location and $HTTP_SERVER_VAR? And what does the query_string mean? ----------------------- --------------------------- And another question is what does the "\r" mean in php. why it is use in the email injection check. ======================= By providing a simple example for the explanation is much appreciated ======================= thank you Link to comment https://forums.phpfreaks.com/topic/41740-php-http_server_var/ Share on other sites More sharing options...
HaLo2FrEeEk Posted March 8, 2007 Share Posted March 8, 2007 I THINK that \r is a type of line break, like \n, they are usually used in conjunction, ie. \r\n. I also THINK that the question mark is put there as sort of an if/then statement, this is how I use them: $var1 = ($var2) ? print "true" : print "false"; Basically, this is saying, if $var2 returns true ($var2 would have to return either a true or a false, since this is interpreting it as a boolean), then (?) print "true, otherwise ( print "false", does that make sense? As for the HTTP_SERVER_VAR, I have no clue, and a quick google search turned up nothing, sorry. Link to comment https://forums.phpfreaks.com/topic/41740-php-http_server_var/#findComment-202379 Share on other sites More sharing options...
DanDaBeginner Posted March 8, 2007 Share Posted March 8, 2007 for this one: $HTTP_SERVER_VAR["QUERY_STRING"]; , example in this forum, look at the url. do you see "action=post;topic=130415.0;num_replies=1" that is the query string... try this code: all the $HTTP_SERVER_VAR[] is in there: PHP contains all the information for SERVER... <? phpinfo() ?> Link to comment https://forums.phpfreaks.com/topic/41740-php-http_server_var/#findComment-202430 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.