NYCPHP Meetup

NYPHP.org

[nycphp-talk] I can't code today to save my life! :

Christopher Hendry chendry at nyc.rr.com
Sat Jan 4 16:59:22 EST 2003


Hey Phil, your message broke up a bit, so can't quite make out your code,
but I use this function to do what you're trying:

	function CheckURL($page_name)
	{
		if(strpos($GLOBALS["SCRIPT_NAME"], $page_name ) == false)
		{
			return false;
		}
		else
		{
			return true;
		}
	}

I'm not sure how this function is as far as security goes, and would be
curious if anyone can tell me...

Thanks,
C


-> -----Original Message-----
-> From: Phil Powell [mailto:soazine at erols.com]
-> Sent: Saturday, January 04, 2003 4:24 PM
-> To: NYPHP Talk
-> Subject: [nycphp-talk] I can't code today to save my life! :
->
->
-> This is a multi-part message in MIME format.
->
-> ------=_NextPart_000_03B3_01C2B40D.5C74FAE0
-> Content-Type: text/plain;
-> 	charset="iso-8859-1"
-> Content-Transfer-Encoding: quoted-printable
->
-> I have $REQUEST_URI that will take two values:
->
-> "/event/login.php"
->
-> and
->
-> "/event/register.php"
->
-> What I need to do is so simple it's brainless!!! I need to look into =
-> $REQUEST_URI and find if it contains "register.php".  I tried this and =
-> it completely failed, the results were wrong every time:
->
-> if (strpos($REQUEST_URI, "register.php") !=3D=3D 0) { // you're in =
-> login.php }
->
-> I don't know why I can't get this other than weekend stupidity, can =
-> someone help?
->
-> Thanx
-> Phil
->
-> ------=_NextPart_000_03B3_01C2B40D.5C74FAE0
-> Content-Type: text/html;
-> 	charset="iso-8859-1"
-> Content-Transfer-Encoding: quoted-printable
->
-> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-> <HTML><HEAD>
-> <META http-equiv=3DContent-Type content=3D"text/html; =
-> charset=3Diso-8859-1">
-> <META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
-> <STYLE></STYLE>
-> </HEAD>
-> <BODY bgColor=3D#ffffff>
-> <DIV><FONT face=3DArial size=3D2>I have $REQUEST_URI that will
-> take two=20
-> values:</FONT></DIV>
-> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
-> <DIV><FONT face=3DArial size=3D2>"/event/login.php"</FONT></DIV>
-> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
-> <DIV><FONT face=3DArial size=3D2>and</FONT></DIV>
-> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
-> <DIV><FONT face=3DArial size=3D2>"/event/register.php"</FONT></DIV>
-> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
-> <DIV><FONT face=3DArial size=3D2>What I need to do is so simple it's =
-> brainless!!! I=20
-> need to look into $REQUEST_URI and find if it contains =
-> "register.php".&nbsp; I=20
-> tried this and it completely failed, the results were wrong every=20
-> time:</FONT></DIV>
-> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
-> <DIV><FONT face=3DArial size=3D2>if (strpos($REQUEST_URI, =
-> "register.php") !=3D=3D 0) {=20
-> // you're in login.php }</FONT></DIV>
-> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
-> <DIV><FONT face=3DArial size=3D2>I don't know why I can't get
-> this other =
-> than=20
-> weekend stupidity, can someone help?</FONT></DIV>
-> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
-> <DIV><FONT face=3DArial size=3D2>Thanx</FONT></DIV>
-> <DIV><FONT face=3DArial size=3D2>Phil</FONT></DIV></BODY></HTML>
->
-> ------=_NextPart_000_03B3_01C2B40D.5C74FAE0--
->
->
->
-> --- Unsubscribe at http://nyphp.org/list/ ---
->
->
->





More information about the talk mailing list