Hey guys.
I have cURL 7.12 installed on my server, and am trying to post variables to another script. So I followed a script found on another forum (one not as good as this), and I get a blank webpage. Any idea what is going on here?
<?php
// This works like a charm!!
$username = $_REQUEST['username'];
$pass = $_REQUEST['password'];
if($username != "owner"){
$user = $username.'@domain.org';
}
else{
$user = $username;
}
//======================\\
//This cURL Script doesn't work.
$URL = "webmail.domain.org/index.php";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://$URL");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "user=$user&pass=$pass");
curl_exec($ch);
curl_close($ch);
?>
I have tried plenty of options to change them like:
// Option 1
curl_setopt($ch, CURLOPT_URL, "http://".$URL);
//Option 2
curl_setopt($ch, CURLOPT_URL, "http://'$URL'");
Applying that to all variable dependent lines of code.
Thanks for the help.
~Brett