Announcement

Collapse
No announcement yet.

just a simple e-mail sript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • just a simple e-mail sript

    Hey i have a question about a simple e-mail script i use for a site.
    I have a form with some fields and when i click the submit button those fields are being sent to another page where i have this code:

    Code:
    <? 
    session_start(); 
    if(isset($_SESSION['gepost'])) 
    { 
    echo 'You cannot send this more then 1 time!'; 
    } 
    else 
    { 
    	if(!isset($_POST)) 
    	{ 
    	 echo "You did not post anything!"; 
    	} 
    	else 
    	{ 
    $email = "Firstname:\t".$_POST['FirstName']."\nSecondname:\t".$_POST['SecondName']."\nE-Mail:\t".$_POST['Email']."\nMessage:\t".$_POST['Comments']."\nIP:\t".$_SERVER['REMOTE_ADDR']."\n\n"; 
    $to = [email protected]; 
    $subject = "reaction form the website"; 
    mail ($to,$subject,$email); 
    $_SESSION['gepost'] == 1; 
    	} 
    } 
    ?>
    After this theres some html.

    And it works. But when i hit F5 i get the same e-mail.

    I have used
    Code:
     <? mail ($to,$subject,$email)?>
    with
    Code:
     <? 
    unset($to); 
    unset($subject); 
    unset($email); 
    ?>
    but none of it works

    Can somebody help me plz ?

  • #2
    "$_SESSION['gepost'] == 1;" - Your just asking if it does equal one - change it to "$_SESSION['gepost'] = 1;" which will set gepost to 1.

    Thanks,
    Alan.

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    X