Server 1 (file1.php) - File Content:
$ch = curl_init('www.pasydypremium.com/postme.php');
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "email=info@domain.com&username=xxxxx&password=xxxxxx");
curl_setopt($ch, CURLOPT_HEADER, true);
$result = curl_exec($ch);
return $result;
curl_close ($ch);
Server 2 (file2.php) - File Content:
$email = $_POST['email'];
$username = $_POST['username'];
$password = $_POST['password'];
//check for duplicate
$duplicate = @mysql_num_rows(@mysql_query("SELECT email FROM table WHERE email='$email'"));
if($duplicate == 0){
//Add email into our database
$result = (int)$query = @mysql_query("INSERT INTO users2 (email) VALUES ('$email')");
if($result){
$error = "Email Inserted";
}else{
$error = "Query Error";
}
}else{
$error = "Email Duplilcate";
}
My Question is, i want the second server (file2.php) to send the first server (file1.php) the $error message:
Case 1: email was inserted successfully
Case 2: query could not be excuted
Case 3: Duplicate found
how can then be done?
Thank you.