LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-21-2009, 01:08 PM   #1
esteeven
Senior Member
 
Registered: Oct 2001
Location: Bristol UK
Distribution: Arch Slackware Ubuntu
Posts: 1,082

Rep: Reputation: 52
validated form >> redirect to php form


I have an html form which contains this action :

<form action="<?=$_SERVER['PHP_SELF']?>" method="post">

The validation I have set up works (finally!!) using -

// import the validation library
require("validation.php");

Now that the form works, I would like to email the contents. Originally, before I started to validate the form, the form was processed by regform.php.

<form action="regform.php" method="post">

I see from some examples I have found that the following is possible -

// no errors! redirect the user to the thankyou page (or whatever)
else
{
$message = "All fields have been validated successfully!";

// here you would either email the form contents to someone or store it in a database.
// To redirect to a "thankyou" page, you'd just do this:
// header("Location: thanks.php");
}

I have tried to use my regform.php to process the data post validation but I can't make it work. Am I on the right road?

Thanks
 
Old 10-21-2009, 01:18 PM   #2
esteeven
Senior Member
 
Registered: Oct 2001
Location: Bristol UK
Distribution: Arch Slackware Ubuntu
Posts: 1,082

Original Poster
Rep: Reputation: 52
I tried -

// no errors! redirect the user to the thankyou page (or whatever)

else

{

//$message = "All fields have been validated successfully!";



// here you would either email the form contents to someone or store it in a database.

// To redirect to a "thankyou" page, you'd just do this:

header("Location: regform.php");

}

}

This worked ----- up to a point An email was sent but no data was included : just the field names.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to redirect after form self-post cmnorton Programming 7 04-03-2009 03:02 PM
how to show results of a php query from a form on the main form texmansru47 Programming 2 06-27-2008 01:26 PM
PHP: build query from form entry, then display results in the same form tonedeaf1969 Programming 4 06-22-2007 07:55 AM
How can i redirect where a form posts to? verbatim Programming 2 05-28-2005 12:24 AM
how do I copy a whoel folder form one directory to another form the command line? zwyrbla Linux - Newbie 8 08-24-2004 06:40 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration