RE: [PHP] Re: how to pass variable for $_GET

From: Date: Sun, 23 Mar 2003 22:40:07 +0000
Subject: RE: [PHP] Re: how to pass variable for $_GET
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-140783@lists.php.net to get a copy of this message
Don't know if you realize this or not, but when you pass the variables, you DO NOT enclose them in ' marks... So... http://blah.com/myscript.php?date=2003-2-1%2000:00:01'%20AND%20'2003-3-1%202 3:59:59&othervar=1234 Then on your myscript.php page, $_GET['date'] will equal "2003-1-3 00:00:01 AND 2003-3-10 23:59:59" (sans the " marks) $_GET['othervar'] will equal "1234" The browser pads the spaces with %20 If you really do need the ' marks, put them in the myscript.php page where needed like this: $sql = "SELECT * FROM foo WHERE blah = '".$_GET['othervar']."'"; > -----Original Message----- > From: DomIntCom [mailto:info@domintcom.com] > Sent: Sunday, March 23, 2003 2:08 PM > To: php-general@lists.php.net > Subject: [PHP] Re: how to pass variable for $_GET > > > thanks - found a solution... both method's worked for me > > > "Nate" <nate@greedyfools.com> wrote in message > news:20030323021737.15418.qmail@pb1.pair.com... > > stripslashes("\'2003-1-3 00:00:01\' AND \'2003-3-10 > > 23:59:59\'"); > > > > "Domintcom" <info@domintcom.com> wrote in message > > news:20030323012348.84601.qmail@pb1.pair.com... > > > ok - found urldecode which is now giving me the following; > > > > > > \'2003-1-3 00:00:01\' AND \'2003-3-10 23:59:59\' > > > > > > original string; > > > > > > '2003-1-3 00:00:01' AND '2003-3-10 23:59:59' > > > > > > > > > "Domintcom" <info@domintcom.com> wrote in message > > > news:20030323000050.44158.qmail@pb1.pair.com... > > > > ok - I know how to pass these variables by appending > variables to the > > > link. > > > > however, I'm trying to pass the following string; > > > > > > > > '2003-1-1 00:00:01' AND '2003-3-20 23:59:59' > > > > > > > > now - when I pass it what I get is the following; > > > > > > > > date='2003-2-1%2000:00:01'%20AND%20'2003-3-1%2023:59:59' > > > > > > > > it seems what I'm going to have to do is replace %20 > with a space, but > > I'm > > > > unclear of how to do that with php. > > > > > > > > thanks, > > > > > > > > Jeff > > > > > > > > > > > > > > > > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#140783) next »