Jump to content

Get Current page name


jkkenzie

Recommended Posts

Example url http://test.com/folder/index.php?var=true

 

If you just want the page name in that url then the following will get index.php

$var=explode('?',$_SERVER['REQUEST_URI']);
$page=preg_replace('/.*\/([^\/])/','$1',$var[0]);
unset($var);

echo $page;

However if you want /folder/index.php then use the following script:

$var=explode('?',$_SERVER['REQUEST_URI']);
$page=$var[0];
unset($var);

echo $page;

So enjoy.

thanks.

 echo '<li><a href="'.$CurrentPageURL.'?lid='.$lastid.'"><img src="./images/next2.gif" border="0" 

 

The thing is when i keep clicking this "./images/next2.gif" , It only takes me to the next page But does not continue to bring the thied next page  Simply because, the "?lid.." POST value has doubled and the page takes only the FIRST "?lid.."  POST variable.

 

How can i eliminate previuos POST value of the same Variable?

 

thanks

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.