|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Grabbing the current URL as a variable
So I can use it in some script.
Is there a method for grabbing the current URL. I am building on a "Tell a Friend" script and it currently has me "hard code" typing in the root of the site. I would like for my users to pass on a specific page. Can PHP grab the current URL and set is as a variable so I can use it as described above? |
|
#2
|
|||
|
|||
|
RE: Grabbing the current URL as a variable
|
|
#3
|
|||
|
|||
|
Been trying desperately to create a form like this for some time, but clicking on that link above gives me a 404 ?
Chris. |
|
#4
|
||||
|
||||
|
PHP Code:
declare that in an include file or anywhere and call using: PHP Code:
or PHP Code:
__________________
When I die, I want to go peacefully like my Grandfather did, in his sleep -- not screaming, like the passengers in his car. |
|
#5
|
||||
|
||||
|
As other friends said, you can get many information using $_SERVER variable.
try this code and use any variable you need: Code:
<?php echo "<hr><pre>"; print_r($_SERVER); echo "</pre><hr>"; ?> |
|
#6
|
|||
|
|||
|
Many, many thanks, it's very much appreciated.
Chris. |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Grabbing the current URL as a variable |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|