Re: [PHP-DB] Re - Direct a User after a completed Form

2002-04-01 Thread wesley grubbs:.

header is the appropriate one you're looking for:

header( Location: thanks.php );


what i do is use the page that processes all the data to also validate the
data. if the data does not pass through, it stays on this page with all the
errors listed in the body.
if it goes through.. then the 'header()' is loaded.

example.
page1
form action=send-form.php method=post
all the stuff in your form.
i.e.
email:br
  input type=text name=Email size=30
/form
..
page2 (send-form.php)

?php
$from = $Email;
$from = From: $from;
$headers = $from\n;

$emailto =[EMAIL PROTECTED];
$exclude = array( Submit_x, Submit_y, submit );

  $title =custom title - $Title;

  $message = \n;
  $message .= ---\n;
  $message .= This information was sent on .date('dS of F Y (H:i)').from
Netdiver.\n;
  $message .= ---\n;
  $message .= Email: $Email\n;

  function checkemail( $Email ) {
  $regexp =
/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
  if( !preg_match( $regexp, $Email ) )
  return false;
  return true;
  }

  $emailOK = checkemail( $Email );
  if ($emailOK == true ){
   // echo $message;
   header( Location: thanks.php );
   mail( $emailto, $title, $message, $headers );
   exit( );
  }
?
html
head
titleError!! Form not filled properly./title
/head
body
you need to enter a valid email address
/body
/html

..
page 3 (thanks.php)
html
head
titlethanks/title
/head
body
Thanks!
/body
/html
.

hope this helps
wes


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Re - Direct a User after a completed Form

2002-03-31 Thread Peter Lovatt

?php

{do submit data routine}

include(thanks.htm)

?


should do the trick

HTH

Peter
---
Excellence in internet and open source software
---
Sunmaia
www.sunmaia.net
[EMAIL PROTECTED]
tel. 0121-242-1473
--- 

 -Original Message-
 From: Ethan J. Mings [mailto:[EMAIL PROTECTED]]
 Sent: 01 April 2002 01:08
 To: PHP Mailing List
 Subject: [PHP-DB] Re - Direct a User after a completed Form
 Importance: Low
 
 
 PHP-DB Mailing List
 --
 
 I've created a form which loads data to my data table.  Works great.
 
 Is there a way to allow the user to go to a thank you after the form
 is completed. Where could I find this is the manual.
 
 Tried Location() with little success.
 
 Suggestions.
 
 
 
 
 
 --
 Ethan J. Mings
 mailto:[EMAIL PROTECTED]
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Re - Direct a User after a completed Form

2002-03-31 Thread Jason Wong

On Monday 01 April 2002 08:08, Ethan J. Mings wrote:

 PHP-DB Mailing List
 --

Could you NOT use the two hyphens to separate the different parts of your 
post? A lot of email clients interpret whatever follows the two hyphens as a 
signature and strips it away when replying. 


 I've created a form which loads data to my data table.  Works great.

 Is there a way to allow the user to go to a thank you after the form
 is completed. Where could I find this is the manual.

 Tried Location() with little success.

I can't find a function called Location(). Try header().


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
I can mend the break of day, heal a broken heart, and provide temporary
relief to nymphomaniacs.
-- Larry Lee
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php