Jump to content

Recommended Posts

if (!isset($_POST['emailid'])) {echo 'There appears to be a problem, please go back and try again.'; exit;}
else
if (isset($_POST['emailid'])) {$emailid= $_POST['emailid'];}
$emailid= mysql_real_escape_string($emailid, $con);
$emailid= htmlspecialchars($emailid);

if (strlen($emailid) >5) {echo 'There appears to be a problem, please go back and try again.'; exit;}
else

$sql = ("SELECT * FROM postcode WHERE postcodeID='$emailid'")or die ('<p>There seems to be a problem, please try again.</p>');
$result = mysql_query($sql,$con);
$row = mysql_fetch_assoc($result);

$name = $_POST["name"];
$from = "[email protected]";
$contact = $_POST['contact'];
$message = $_POST["message"];

$verif_box = $_REQUEST["verif_box"];
$name = stripslashes($name);
$message = stripslashes($message); 
$from = stripslashes($from); 

if(md5($verif_box).'a4xn' == $_COOKIE['tntcon']){

$sql = "UPDATE postcode SET mailcount = mailcount + 1 WHERE postcodeID=$emailid";
      mysql_query($sql) or trigger_error('<p>There seems to be a problem, please try again soon.</p>');
      $result = mysql_query($sql);
mail("{$row['email']}", 'some message ', "\n $name just sent you a message  \n Their email address is: $contact  \n Their message is: $message  " , "From: $from" );

setcookie('tntcon','');
} else {
// if verification code was incorrect then return to contact page and show error
header("Location:".$_SERVER['HTTP_REFERER']."?subject=$subject&from=$from&message=$message&wrong_code=true");
exit;
}
?>

Link to comment
https://forums.phpfreaks.com/topic/181773-solved-update-1/#findComment-958672
Share on other sites

Right, you are actually calling it twice:

 

   $sql = "UPDATE postcode SET mailcount = mailcount + 1 WHERE postcodeID=$emailid";
      mysql_query($sql) or trigger_error('<p>There seems to be a problem, please try again soon.</p>');
      $result = mysql_query($sql);

 

Of course it'll update twice when you call it twice.

Link to comment
https://forums.phpfreaks.com/topic/181773-solved-update-1/#findComment-958675
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.