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.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 05-26-2005, 06:21 AM   #1
Zester
Confirmed User
 
Zester's Avatar
 
Industry Role:
Join Date: Jul 2003
Posts: 5,344
PHP question

is there a way in a php script to detect if it was called with this url:
http://domain.com/myscript.php#12

or this:
http://domain.com/myscript.php

some kind of server variable I don't know of?
__________________
* Mainstream ? $65 per sale
* new male contraception
Zester is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-26-2005, 06:34 AM   #2
arnette
Confirmed User
 
Join Date: Feb 2005
Posts: 283
nope, those pages are considered one and the same with php.
it could probably be done with a php/javascript combo
arnette is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-26-2005, 06:36 AM   #3
StuartD
Sofa King Band
 
StuartD's Avatar
 
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
$_SERVER[HTTP_HOST]
StuartD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-26-2005, 06:36 AM   #4
Fetish Gimp
Confirmed User
 
Industry Role:
Join Date: Feb 2005
Posts: 1,699
Is the php script you're talking about running on the same server? Cuz depending on the situation you can use the $_SERVER['REFERER'] or $_SERVER['SCRIPT_FILENAME']. Here's more about the server variables
http://ca3.php.net/reserved.variables
Fetish Gimp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-26-2005, 06:37 AM   #5
AcidMax
Confirmed User
 
Join Date: May 2002
Location: MI
Posts: 1,827
You could probably use a preg_match to look at the url and see if its being called that way.

Andy
__________________
Latest MMA news. http://www.mmawrapup.com
AcidMax is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-26-2005, 06:55 AM   #6
Serge Litehead
Confirmed User
 
Serge Litehead's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: Behind the scenes
Posts: 5,190
Code:
if (isset($_SERVER['HTTP_REFERER']))
{
	if (strpos($_SERVER['HTTP_REFERER'],"domain.com/myscript.php") !hahahaha false)
	{
		echo "this script called with domain.com/myscript.php";
	}
	else
	{
		echo "call by ".$_SERVER['HTTP_REFERER'];
	}
}
else 
{
	echo "no referer";	
}
replace hahahaa with double equal signs (=)
__________________
Serge Litehead is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-26-2005, 07:04 AM   #7
Serge Litehead
Confirmed User
 
Serge Litehead's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: Behind the scenes
Posts: 5,190
regarding previous post
that code will work only if myscript.php is linking to the php file this code is on.
if its not the case then more info needed how is current script beign called by myscript.php
__________________
Serge Litehead is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-26-2005, 07:08 AM   #8
Zester
Confirmed User
 
Zester's Avatar
 
Industry Role:
Join Date: Jul 2003
Posts: 5,344
i tried every server variable, everything in $_SERVER , the #12 is mentioned no where.
referer is not set - it is a bookmark
__________________
* Mainstream ? $65 per sale
* new male contraception
Zester is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-26-2005, 07:12 AM   #9
Zester
Confirmed User
 
Zester's Avatar
 
Industry Role:
Join Date: Jul 2003
Posts: 5,344
Quote:
Originally Posted by arnette
nope, those pages are considered one and the same with php.
it could probably be done with a php/javascript combo
yes, i have no problem detecting it in javascript, but in order to use a combo with PHP, i have to use either a cookie or post or get to that same page which i want to avoid

and as far as i know and tried you can not pass a javascript var to a php var - only the other way around
__________________
* Mainstream ? $65 per sale
* new male contraception
Zester is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-26-2005, 08:24 AM   #10
Serge Litehead
Confirmed User
 
Serge Litehead's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: Behind the scenes
Posts: 5,190
Quote:
Originally Posted by Zester
i tried every server variable, everything in $_SERVER , the #12 is mentioned no where.
referer is not set - it is a bookmark
unless you going to your script from myscript.php you wont see the referer
may need to check your apache logs to see if there were any referer from that particular location, or write your own log
__________________
Serge Litehead is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.