Filename and variables
Posted: Tue Feb 18, 2003 8:34 am
Hi,
Is there a way to grab certain parts from an URL and echo them into a form.
i.e. the url is
http://www.domain.tld/dir/main.php?page=24&id=42
and i want it to echo the `main?page=24&id=42` part into a form feild
$PHP_SELF returns /dir/main.php which is no good to me because i also want the variables but not the directory name.
I would hard code it as:
main.php?page=$page_no&id=$id
but the filename isnt always main.php and the variables are not always page and id.
Any help would be appriciated.

Is there a way to grab certain parts from an URL and echo them into a form.
i.e. the url is
http://www.domain.tld/dir/main.php?page=24&id=42
and i want it to echo the `main?page=24&id=42` part into a form feild
$PHP_SELF returns /dir/main.php which is no good to me because i also want the variables but not the directory name.
I would hard code it as:
main.php?page=$page_no&id=$id
but the filename isnt always main.php and the variables are not always page and id.
Any help would be appriciated.