Jump to content

Confermation Page


bigrossco

Recommended Posts

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);}

  ?>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.