Jump to content

$this_page ="http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"; what?


deansaddigh

Recommended Posts

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?

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]

$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)

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']

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.