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 = '[email protected]';
  # 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
https://forums.phpfreaks.com/topic/61924-confermation-page/
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
https://forums.phpfreaks.com/topic/61924-confermation-page/#findComment-308358
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.