POST/REDIRECT/GET what's wrong?
<p>I have a website where any visitor can subscribe to receive the newsletter.I encountered the problem of having my resubmitted when everytime when i refreshed the page.I solved it by applying the PRG concept. Now a user never submits the same form twice, i have just one problem  : i have designed the form in such a way that when the is  succesfully/or fails  a message is display under the input fields. Unfortunatly now that i have the PRG concept applied i never get any message displayed . What to do ?</p>

<p>index.php - where i have the divs containing the submit form and the message display</p>

<pre><code>        &lt;div id="newsletter" &gt;
            &lt;form id="abonat" name="abonat" action="formular.php" method="post" onsubmit="return golire()" autocomplete="on"  &gt; 
            &lt;span&gt;Subscribe&lt;/span&gt;
            &lt;input type="text" id="nume" name="nume"  placeholder="Name" required /&gt;
            &lt;input type="email" id="email" name="email" placeholder="Email" autocomplete="off"  required/&gt; 
            &lt;input type="submit" value="Subscribe" class="button" style="width:26%;float:left;" /&gt; 

            &lt;/form&gt;
    &lt;/div&gt;  

    &lt;div id="mesaj_newsletter"&gt;
        &lt;span&gt;&lt;?php if (isset($mesaj)) echo $mesaj; ?&gt; &lt;/span&gt;
    &lt;/div&gt; 
</code></pre>

<p>formular.php - where the validation takes place,and the message is decided</p>

<pre><code>include('conect.php');    
function validEmail($email){
    //code that verifies if it is a valid email adress
}

if( (isset($_POST['email']))&amp;&amp;(isset($_POST['nume'])) ){
    $nume=mysql_real_escape_string($_POST['nume']);
    $email=mysql_real_escape_string($_POST['email']);
    $z=1;
    if(validEmail($email)==TRUE){
        $result=mysql_query("SELECT * FROM abonat");
        while($data=mysql_fetch_row($result)){
                if(($data[1]==$email)||($data[2]==$nume))
                    $z=0;
        }

        if($z==1){
           mysql_query("INSERT INTO abonat(email,nume) VALUES ('$email','$nume')");
           $mesaj="Your email has been registered";
        }
        else $mesaj="You are already registered";   
    }
    else $mesaj="You have not entered a valid email adress";
}
mysql_close($con);
header('Location:index.php');
?&gt;
</code></pre>
