own URL[solved]
Posted: Sun May 23, 2004 9:21 am
I want to get the filename and querystring of the script running (to generate links and things like that), so i tried using this code:
i then generate links with this for example:
however, the querystring doesn't get deleted, so if i click the link 2 times or more, or if i go to another page, the querystring is still there. after some clicks, it could look like this:
so i'm wondering if there's someway else to do this?
i can't come up with anything...
Code: Select all
<?php
### set path info
$fself = $_SERVER['PHP_SELF'];
$qstring = $_SERVER['QUERY_STRING'];
if (empty ($qstring)) $fself = $self."?";
if (!empty ($qstring)) $fself = $self."?".$qstring."&";
?>Code: Select all
<?php
echo "<a href='{$fself}n={$rndnumber}'>link</a>";
?>Code: Select all
index.php?p=news&n=2&n=3&n=5&n=4&n=1&n=3&n=2i can't come up with anything...