Forum Moderators: coopster

Message Too Old, No Replies

cURL question

php cURL

         

strudel67

1:50 pm on Aug 20, 2009 (gmt 0)

10+ Year Member



I am wondering if someone can tell me how I can get cURL to get me to craigslist posting page... this is the page I want to get to [post.craigslist.org...]

and if typed into a browser window works fine as I am taken to posting page but when I try to use cURL it doesn't work - I get a message saying I must be logged in...

Here's my code... any insights much appreciated.

<?php
// INIT CURL
$ch = curl_init();

// SET HTTP LOCATION
curl_setopt($ch, CURLOPT_URL, 'https://post.craigslist.org/den/H/reb/none/x');

// EXECUTE
$content = curl_exec ($ch);
echo $content;
// CLOSE CURL
curl_close ($ch);

?>

Psychopsia

5:27 pm on Aug 20, 2009 (gmt 0)

10+ Year Member



I tested your code and got the same content for both, direct link and using the script.

strudel67

5:49 pm on Aug 20, 2009 (gmt 0)

10+ Year Member



Psychopsia - no kidding? So you get to a page where you can post a listing?