*This message is also posted in alt.php*
Hi.
This is a part of a form I'm using:
<?php
if($sentmessage == '3'){
echo "You have already posted 3 times!";
exit();
}else{
$num = $sentmessage + 1;
setcookie("sentmessage","$num",time()+600);
}
if ($submit) {
// process form
// I want the cookie to increase its value at this point not by updating
the page
$db=mysql_connect ("localhost", "***", "****") or die ('I cannot connect
to the database because: ' . mysql_error());
mysql_select_db ("****");
mysql_select_db("mydb",$db);
$today = date("F j, Y, G:i");
$name = html_entity_decode(strip_tags($navn));
$email = html_entity_decode(strip_tags($epost));
$phone = html_entity_decode(strip_tags($telefon));
$sn1 = html_entity_decode(strip_tags($sn1));
I need the cookie to run after submitting, or after this code:
if ($submit) {
// process form
The problem now is that the cookie is increasing the value for
one update, not by submitting.
Regards,
Reffo
>> Stay informed about: Cookie problem