Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

A little PHP script help...

  • 09-05-2011 5:04pm
    #1
    Registered Users, Registered Users 2 Posts: 10,245 ✭✭✭✭


    I'm new to PHP and I've run into a little problem with a basic contact form. It was working OK but for whatever reason it now isn't returning any information from the comments section. Any ideas?
    <?php
    
    $name = Trim(stripslashes($_POST['name']));
    $email = Trim(stripslashes($_POST['email']));
    $address = Trim(stripslashes($_POST['address']));
    $comments = Trim(stripslashes($_POST['comments']));
    $EmailTo = "somebody@me.com";
    $Subject = "website contact";
    $validationOK=true;
    if(Trim($name)=="") $validationOK=false;
    if(Trim($email)=="") $validationOK=false;
    if (!$validationOK){
    	print "<meta http-equiv=\"refresh\" content=\"0;URL=fail.html\">";
    	exit;
    }
    $Body = "";
    $Body .= "Succesful message from:";
    $Body .= "\n";
    $Body .= $name;
    $Body .= "\n";
    $Body .= $email;
    $Body .= "\n";
    $Body .= $address;
    $Body .= "\n";
    $Body .= $comments;
    $Body .= "\n";
    $success = mail($EmailTo, $Subject, $Body);
    if($success){
    	print "<meta http-equiv=\"refresh\" content=\"0;URL=success.html\">";
    }
    else {
    	print "<meta http-equiv=\"refresh\" content=\"0;URL=fail.html\">";
    }
    ?>
    


Comments

  • Registered Users, Registered Users 2 Posts: 10,245 ✭✭✭✭Fanny Cradock


    This is sorted! The HTML wasn't matching the script. comment =/= comments. :o


Advertisement