bigrossco Posted July 26, 2007 Share Posted July 26, 2007 ok next question for my contact page, I want the contact form below, to redirect to a confirmation page after submit is selected so users know the message has sent <fieldset> <legend>Contact Form</legend> <p><label>Name:</label> <input name="name" type="text" id="name" size="40"> </p> <p><label>Email:</label> <input name="email" type="text" id="email" size="40"> </p> <p> <label>Message:<br /> </label><textarea name="comments" cols="50" rows="10" id="comments"></textarea> </p> <p><input type="submit" name="submit" id="submit" value="Send Message"></p> </fieldset> </form> <?php # Add your email address $to = 'archive@blairlogie-scotland.org'; # Add a default subject $subject = 'Blairlogie-Scotland.org Message'; $name = $_REQUEST['name']; $email = $_REQUEST['email']; $comments = $_REQUEST['comments']; $submit = $_REQUEST['submit']; $headers = "From: $email\n"; $headers .= "Reply-To: $email\n\n"; $body = "A new message has been posted by: $name \n Email address: $email \n Message: $comments \n\n To reply to this message simply click on REPLY"; if(isset($submit)) { mail($to, $subject, $body, $headers);} ?> Quote Link to comment Share on other sites More sharing options...
Albatross Posted July 26, 2007 Share Posted July 26, 2007 One I used looked like this... <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>WHSE Management System</title> <link type="text/css" rel="stylesheet" href="bio.css"> </head> <body> <div class="content"> <h1>Item added with the following credentials :</h1> <h1>Name : </h1><? echo "$_POST[name]"; ?> <h1>Position : </h1><? echo "$_POST[position]"; ?> <h1>Ref ID : </h1><? echo "$_POST[refid]"; ?> <h1>Password : </h1><? echo "$_POST[password]"; ?> </body> </html> Just change the names of the items to match your field names and it will return a confirmation. Quote Link to comment Share on other sites More sharing options...
DeepakJ Posted July 26, 2007 Share Posted July 26, 2007 Try <form action=contacts.php method=post> And on contacts.php list the confirmation message. Quote Link to comment Share on other sites More sharing options...
bigrossco Posted July 27, 2007 Author Share Posted July 27, 2007 i tried adding <form action=contacts.php method=post> but it redirects to the page contacts.php but the message is not emailed now, which it needs to do Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.