Jump to content

cURL


playa

Recommended Posts

I am new to php and I learned quite a lot but I don't know anything about cURL or where to find a good tutorial about it. I really need a script to do a few things on different sites daily. However, I am not really sure how to set that so I was looking for a good tutorial on it. It would be really good if any of you could find a video tutorial cause it's so much easier to learn that way but I would really still like to see any good tutorial even if it is written.

 

Thanks a lot

 

-Playa

Link to comment
Share on other sites

  • 3 weeks later...

Well, I got this so far:

 

<?

$phoneNumber = '4045551111';

$message = 'This message was generated by curl and php';

$curlPost = 'pNUMBER='  . urlencode($phoneNumber) . '&MESSAGE=' . urlencode($message) . '&SUBMIT=Send';

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'http://www.example.com/sendSMS.php');

curl_setopt($ch, CURLOPT_HEADER, 1);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);

$data = curl_exec();

curl_close($ch);

?>

 

but how do I execute it? When i run the file, nothing happens, it's just white. And yes, I did change all the variables to what I needed as well as the URL. help please?  ???

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.