Form Submission page

This is a discussion on "Form Submission page" within the Web Page Design section. This forum, and the thread "Form Submission page are both part of the Design Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Aug 30th, 2007, 22:39
Junior Member
Join Date: Aug 2007
Location: London
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Form Submission page

Hi,

Was wondering if anyone could help.

I have creatred a contact form using 'formmail'. Once the submit button has been hit, instead of going to another 'redirect' page, I would like a prompt box to appear and say "thank you for submitting the form" the user clicks 'ok' and returns back to the page. I have attached my html for the form. It would be great if someone has a solution.

I look forward to your response.
Thanks
Mark
Attached Files
File Type: html index.html (850 Bytes, 17 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Sep 2nd, 2007, 05:16
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up Re: Form Submission page

You could add an onclick confirm to the submit button.

<input type="submit" value="submit" name="submit" onclick="return confirm('Thank you for submitting the form')" />

When the click submit they will given the box, if they click cancel, the form will not be submitted. If they click okay, the form will be submitted and you can change the redirect page of the formmail to be the form again.

Is that what you mean?

Cheers
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)

Last edited by Rakuli; Sep 3rd, 2007 at 16:08.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Sep 6th, 2007, 23:36
Highly Reputable Member
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Form Submission page

Here is a contact page with form validation

PHP: Select all

<?
// Change to your own email address
$your_email "youremail_yourdomain.com";
// This is what is displayed in the email subject line
// Change it if you want
$subject "Message via your contact form";
// This is displayed when the email has been sent
$thankyou_message "<p>Thankyou. Your message has been sent.</p>";
$self $_SERVER['REQUEST_URI'];
$name $_POST['txtName'];
$email $_POST['txtEmail'];
$message $_POST['txtMessage'];
$send $_POST['send'];
$msg="<p>Please fill in this form if you have any queries or suggestions.</p>";
echo (
$msg);
$form "
    <form method=\"post\" action=\"$self\">
    <p><label for=\"txtName\">Name:</label>
    <input type=\"text\" title=\"Please enter your name\" id=\"txtName\" name=\"txtName\" size=\"40\" value=\"$name\" /></p>
    <p><label for=\"txtEmail\">Email:</label>
    <input type=\"text\" title=\"Please enter your email address\" id=\"txtEmail\" name=\"txtEmail\" size=\"40\" value=\"$email\"/></p>
    <p><label for=\"txtMessage\">Comments:</label>
    <textarea title=\"Please enter your message\" id=\"txtMessage\" name=\"txtMessage\" rows=\"20\" cols=\"45\">$message</textarea></p>
    <p><label>&nbsp;</label>
    <input type=\"submit\" class=\"sendbutton\" name=\"send\" value=\"Submit\" /></p>
</form>"
;
if(
$send)
{
    
$valid=true;
 if( !
$name )
 { 
     
$errmsg.="Please enter your name:<br />";
     
$valid=false;
 }
 if( !
$email )
 {
     
$errmsg.="Please enter your email address:<br />";
     
$valid=false;
 }
 else
 {
  
$email trim($email);
  
$_name "/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+";
  
$_host "([-0-9A-Z]+\.)+";
  
$_tlds "([0-9A-Z]){2,4}$/i";
   
  if( !
preg_match($_name."@".$_host.$_tlds,$email))
  {
   
$errmsg.="Email address has incorrect format!<br />";
   
$valid=false;
  }
 }
 
 if( !
$message )
 { 
     
$errmsg.="Please enter your message:<br />";
     
$valid=false
 }
}
if( 
$valid !=true )
    {
 echo( 
"<span style=\"font-weight: bold; color:red;\">".$errmsg."</span>" $form );
    }
else {
    
// Stop the form being used from an external URL
    // Get the referring URL
    
$referer $_SERVER['HTTP_REFERER'];
    
// Get the URL of this page
    
$this_url "http://".$_SERVER['HTTP_HOST'].$_SERVER["REQUEST_URI"];
    
// If the referring URL and the URL of this page don't match then
    // display a message and don't send the email.
    
if ($referer != $this_url) {
        echo 
"You do not have permission to use this script from another URL.<br />";
 echo 
"If you are behind a firewall please check your referrer settings.";
        exit;
    }
    
// The URLs matched so send the email
    
if( mail($your_email$subject$message"From: $name <$email>"));
    {
     
// Display the thankyou message
     
echo $thankyou_message;
    }
}
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Sep 8th, 2007, 00:50
Reputable Member
Join Date: Dec 2005
Location: U.S.A.
Posts: 155
Thanks: 0
Thanked 4 Times in 4 Posts
Re: Form Submission page

The action part of your form is where the submission takes place. In order for the form to be submitted, it needs to go to the URL where the script is.

In order for the form to be useful, it needs that server side script. But you can display messages on failure or success and redirect. What I think is the best is to have your PHP/ASP script page laid out just like your site. That way it has your navigation and the user can decide where they would like to go next. Or even have additional content on that page trying to lure them to other sections of your site.

Good Luck, Scott
__________________
Web Design and Development
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
form, page, submission

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form Submission List Builder jb1984 Web Page Design 2 Dec 12th, 2007 18:10
form submission and mailing problems........aaaagh Gerry Web Page Design 3 Mar 15th, 2007 10:27
form submission with Javascript ktsirig JavaScript Forum 1 Dec 18th, 2006 21:16
Problem with Form Submission Page NewDesigner Web Page Design 4 Oct 6th, 2006 09:36
About form submission with Dreamweaver a.jenery Web Page Design 8 Feb 7th, 2006 11:20


All times are GMT. The time now is 20:22.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42