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:[EMAIL PROTECTED] 
> Sent: Sunday, March 23, 2003 2:08 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: how to pass variable for $_GET
> 
> 
> thanks - found a solution...  both method's worked for me
> 
> 
> "Nate" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > stripslashes("\'2003-1-3 00:00:01\' AND \'2003-3-10 23:59:59\'");
> >
> > "Domintcom" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > 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" <[EMAIL PROTECTED]> wrote in message
> > > news:[EMAIL PROTECTED]
> > > > 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
> 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to