![]() |
PHP help please
I want to make a script with a plug and play adult flash e-card that webmasters can put on their website. I have searched the web resources but I cannot seem to understand how to make the script load in a variable the adress of the script(the complete addres).
So if the script is located at http://www.domain.com/script.php I want to load this URL into a variable dynamicaly, and if the script name is changed, so does the variable. Can anione help? |
Quote:
Create a file, phpinfo.php for example, and put <?phpinfo();?> . you will find the variable (and many more) in the output. Joe |
$_SERVER['PHP_SELF'] will give you the path of the php file that is executing...... so do this :
$current_page = $_SERVER['PHP_SELF']; $full_web = "http://www.yourdomain.com" . $current_page; |
That will work for PHP 4.1+ .. for lower version numbers (get your ass current lol) try $HTTP_SERVER_VARS instead of $_SERVER . That should work even if php is buried in several different dirs. So DONT change the "http://www.yourdomain.com" part to something like "http://www.yourdomain.com/path/to" . Just thought I would clarify.
Rory :helpme |
Quote:
|
$_SERVER['HTTP_HOST'] then
|
So here is everything you need :
PHP Code:
PHP Code:
Rory :helpme |
I have seen some of the variables that PHP has using the phpself() function and I now know how to solve the problem.
hanks to all, especialy to NotJoe |
|
Quote:
|
All times are GMT -7. The time now is 02:06 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123