deansaddigh Posted January 7, 2010 Share Posted January 7, 2010 Can some one tell me what this code does. sorry for all these questions today, just trying to understand. \the $this_page is used here <option value="<?=$this_page.'&month=5'?>" <? if($_GET{'month'} == 5){echo 'selected';}?>>May</option> And i dont know what its doing? Link to comment https://forums.phpfreaks.com/topic/187576-this_page-http_serverhttp_host_serverrequest_uri-what/ Share on other sites More sharing options...
RaythMistwalker Posted January 7, 2010 Share Posted January 7, 2010 Can some one tell me what this code does. sorry for all these questions today, just trying to understand. \the $this_page is used here <option value="<?=$this_page.'&month=5'?>" <? if($_GET{'month'} == 5){echo 'selected';}?>>May</option> what code are you wanting answer for? one in the brackets or the one in title? And i dont know what its doing? [/quote] Link to comment https://forums.phpfreaks.com/topic/187576-this_page-http_serverhttp_host_serverrequest_uri-what/#findComment-990332 Share on other sites More sharing options...
deansaddigh Posted January 7, 2010 Author Share Posted January 7, 2010 Thanks for helping, the one in the title please. because then it will help me to understand what they are doing in the lower code Link to comment https://forums.phpfreaks.com/topic/187576-this_page-http_serverhttp_host_serverrequest_uri-what/#findComment-990335 Share on other sites More sharing options...
RaythMistwalker Posted January 7, 2010 Share Posted January 7, 2010 $this_page ="http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"; basically does what it says. start bit by bit. {$_SERVER['HTTP_HOST']} returns domain name (ie phpfreaks.com) {$_SERVER['REQUEST_URI']} returns actual page (index.php) Link to comment https://forums.phpfreaks.com/topic/187576-this_page-http_serverhttp_host_serverrequest_uri-what/#findComment-990336 Share on other sites More sharing options...
deansaddigh Posted January 7, 2010 Author Share Posted January 7, 2010 So then in that $this_page variable it would basically hold http://www.phpfreaks.com/index.php? would it put the / in between .com and index or would the variable hold http://www.phpfreaks.comindex.php Link to comment https://forums.phpfreaks.com/topic/187576-this_page-http_serverhttp_host_serverrequest_uri-what/#findComment-990343 Share on other sites More sharing options...
RaythMistwalker Posted January 7, 2010 Share Posted January 7, 2010 it will hold. I only know cos i have $baseUrl = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']; for storing session info. I might've got your original request wrong tho i know $_SERVER['SCRIPT_NAME'] returns current script so i dunno about $_SERVER['REQUEST_URI'] Link to comment https://forums.phpfreaks.com/topic/187576-this_page-http_serverhttp_host_serverrequest_uri-what/#findComment-990349 Share on other sites More sharing options...
deansaddigh Posted January 7, 2010 Author Share Posted January 7, 2010 Thanks for your help mate Link to comment https://forums.phpfreaks.com/topic/187576-this_page-http_serverhttp_host_serverrequest_uri-what/#findComment-990350 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.