Jump to content

Get a Part of URL


Recommended Posts

Hi

 

i need to get my url after ? sign.

http://example.com/flash/welcome.php?firstname=name+&lastname=makr+&numer=45+

 

I want to get only firstname=name+&lastname=makr+&numer=45+

 

can any one help me out

 

Right now i use code below to get URL

 

<td>
	<?php
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>
<?php
  echo curPageURL();
?>



	</td>

Link to comment
https://forums.phpfreaks.com/topic/207905-get-a-part-of-url/
Share on other sites

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.