Note that there are some explanatory texts on larger screens.

plurals
  1. PONeed a PHP email send script for HTML an form
    primarykey
    data
    text
    <p>I have a single page portfolio website that I'm building and I have a contact form that I need to process using php send script. I'm a novice when it comes to PHP so I'm having trouble getting this to work. I've done some searching but I can't find what I'm looking for.</p> <p>Here's what I have done, I copied this from a PHP contact page that I had built but the PHP and form are on the same page and I need an external send.php to process my form.</p> <pre><code>&lt;?php $error = ''; // error message $name = ''; // sender's name $email = ''; // sender's email address $company = ''; // company name $subject = ''; // subject $comment = ''; // the message itself if(isset($_POST['send'])) { $name = $_POST['name']; $email = $_POST['email']; $company = $_POST['company']; $subject = $_POST['subject']; $comment = $_POST['comment']; if($error == '') { if(get_magic_quotes_gpc()) { $message = stripslashes($message); } // the email will be sent here // make sure to change this to be your e-mail $to = "example@email.com"; // the email subject // '[Contact Form] :' will appear automatically in the subject. // You can change it as you want $subject = '[Contact Form] : ' . $subject; // the mail message ( add any additional information if you want ) $msg = "From : $name \r\ne-Mail : $email \r\nCompany : $company \r\nSubject : $subject \r\n\n" . "Message : \r\n$message"; mail($to, $subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n"); } } if(!isset($_POST['send']) || $error != '') { header("location: http://www.#.com/#contact"); } ?&gt; </code></pre> <p>So for my form I want to have:</p> <pre><code>&lt;form method="post" action="send.php" class="form"&gt; </code></pre> <p>I plan on using HTML5 and jQuery to validate the form, so I really only need the script to capture the info and send the email to a single address. After it sends I want the script to redirect back to the Contact page.</p> <p>Edit:</p> <p>I found a solution after spending a while on google. http://www.website.com/#contact"); ?></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload