Cookie problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Reffo

    Cookie problem

    *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("sent message","$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_conne ct ("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_dec ode(strip_tags( $navn));
    $email = html_entity_dec ode(strip_tags( $epost));
    $phone = html_entity_dec ode(strip_tags( $telefon));
    $sn1 = html_entity_dec ode(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



  • Geoff Berrow

    #2
    Re: Cookie problem

    I noticed that Message-ID: <vNpSd.2078$4c. 242076@juliett. dax.net> from
    Reffo contained the following:
    [color=blue]
    >*This message is also posted in alt.php*[/color]

    See my reply in same.

    And do not multipost. Crosspost, if you must.

    --
    Geoff Berrow (put thecat out to email)
    It's only Usenet, no one dies.
    My opinions, not the committee's, mine.
    Simple RFDs http://www.ckdog.co.uk/rfdmaker/

    Comment

    Working...