Re: Re: Automating POST/GET

From: Date: Mon, 26 Apr 2004 09:51:44 +0000
Subject: Re: Re: Automating POST/GET
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-184612@lists.php.net to get a copy of this message
Saulius wrote:
I've tried ... <?php $siteurl = "www.whatever.com"; $description = "Description with spaces and commas, in it.";
include 'http://www.google.com/addurl?q=$siteurl&dq=$description';    //
Works - but passes the variable name instead of its value.Any variation
from
this format doesn't work - such as double-quotes, periods, etc.
when you are forming quoted string expression with variables in it, you should use double quotes (http://www.google.com/addurl?q=$siteurl&dq=$description;) or single quotes, but insert variables in other way: 'http://www.google.com/addurl?q='.$siteurl.'&dq='.$description;
and use urlencode(): 'http://www.google.com/addurl?q='.urlencode($siteurl).'&dq='.urlencode($description);

« previous php.general (#184612) next »