PHP cURL Dynamic Address

General discussions related to php

Moderators: macek, egami, gesf

Post Reply
johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: PHP cURL Dynamic Address

Post by johnj » Fri Jul 06, 2012 7:10 am

curlopt_url is expecting a string. Are you sure that $_GET["address"] is returning a string?

What I mean is ...it should be something like thuis..."http://www.abcde.com" and not just http://www.abcde.com

Also, do error checking:
if($result === false)
{
echo 'Curl error: ' . curl_error($ch);
}

johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: PHP cURL Dynamic Address

Post by johnj » Fri Jul 06, 2012 7:13 am

Assign $_GET["address"] to a variable, check if it has a value and then pass it to curl.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest