Jump to content

Curl testing problem


graham23s

Recommended Posts

Hi Guys,

 

From tutorials and snippets of code i have this:

 

<?php

////////////////////////////////////////////////
// Auto Login with Curl
////////////////////////////////////////////////
   
   $email = '[email protected]'; 
    $pass = 'test'; 
   
   $curlPost = 'email='  . urlencode($email) . '&password=' . urlencode($pass) . '&submit=Login'; 
   $ch = curl_init();
    
   curl_setopt($ch, CURLOPT_URL, 'http://www.firstchoicepharmacy.co.uk/login.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($ch); 

   print("$data");

   curl_close($ch);  
?>

 

(i used my own site for testing on) but when i execute the fields aren't filled in!

 

is there something i am missing at all?

 

cheers guys

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/131953-curl-testing-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.