![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Sep 2001
Location: Iasi
Posts: 1,281
|
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?
__________________
-=Free Webmaster Tools=- |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 | |
Confirmed User
Industry Role:
Join Date: May 2002
Location: Toronto, Canada
Posts: 5,599
|
Quote:
Create a file, phpinfo.php for example, and put <?phpinfo();?> . you will find the variable (and many more) in the output. Joe |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Jul 2002
Location: I Love Ixtapa, Mexico ö
Posts: 616
|
$_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; |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Jul 2002
Location: I Love Ixtapa, Mexico ö
Posts: 616
|
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 ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
Confirmed User
Join Date: Sep 2001
Location: Iasi
Posts: 1,281
|
Quote:
__________________
-=Free Webmaster Tools=- |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Join Date: Jul 2002
Location: I Love Ixtapa, Mexico ö
Posts: 616
|
$_SERVER['HTTP_HOST'] then
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Join Date: Jul 2002
Location: I Love Ixtapa, Mexico ö
Posts: 616
|
So here is everything you need :
PHP Code:
PHP Code:
Rory ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Sep 2001
Location: Iasi
Posts: 1,281
|
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
__________________
-=Free Webmaster Tools=- |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Join Date: Jul 2002
Location: I Love Ixtapa, Mexico ö
Posts: 616
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Confirmed User
Join Date: Sep 2001
Location: Iasi
Posts: 1,281
|
Quote:
__________________
-=Free Webmaster Tools=- |
|
![]() |
![]() ![]() ![]() ![]() ![]() |