Jump to content

Recommended Posts

if i go:

$homePage = $_SERVER['REQUEST_URI'];

 

i get:

home page = /indie/index.php?list=top

 

 

 

if i go:

$homePage = basename($_SERVER[php_SELF]);

 

i get:

home page = index.php

 

 

 

 

what i want is something in the middle:

 

home page = index.php?list=top

 

 

so it only shows the base script name, but also includes the parameters.

 

thanks

chris

Link to comment
https://forums.phpfreaks.com/topic/51211-_server/
Share on other sites

<?php

function typedurl() {
$homePage = basename($_SERVER["PHP_SELF"]);
$homePage .= "?";
foreach($_GET as $k => $v) {
$homePage .= "$k=$v&";
}
$length = strlen($homePage);
$newlen = $length - 1;
$homePage = substr($homePage, 0, $newlen);
return $homePage;
}

echo typedurl();

?>

Link to comment
https://forums.phpfreaks.com/topic/51211-_server/#findComment-252168
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.