Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Contact form not redirecting after submittal
Old 10-07-2007, 07:58 PM Contact form not redirecting after submittal
Experienced Talker

Posts: 45
Name: Tonyo
Trades: 0
In this script that I am using as a contact form on www.atriskstoriesofhope.com, the php script will say Data has been submitted to blah@email.com and then it just sits there. How can i get it to redirect to a page of my choice? Can I use a javascript redirection?

PHP Code:
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>


<?php
if(isset($_POST['submit'])) {
$to "hectorperez@atriskstoriesofhope.com";
$subject "At Risk: Stories Of Hope";
$name_field $_POST['name'];
$email_field $_POST['email'];
$location_field $_POST['location'];
$telephone_field $_POST['telephone'];
$message $_POST['message'];
$body "From: $name_field\n E-Mail: $email_field\n Location:  $location_field\n telephone: $telephone_field\n Message:\n $message";
echo 
"Data has been submitted to $to!";
mail($to$subject$body);
} else {
echo 
"blarg!";
}
?>
</body>
</html>
master_debator is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-07-2007, 09:13 PM Re: Contact form not redirecting after submittal
joder's Avatar
Flipotron

Posts: 6,442
Name: James
Location: In the ocean.
Trades: 0
At the top of the php add
header("Location:file_to_redirect_to.php");
joder is offline
Reply With Quote
View Public Profile
 
Old 10-08-2007, 07:28 AM Re: Contact form not redirecting after submittal
solomongaby's Avatar
Webmaster Talker

Latest Blog Post:
How Do You Find Music Online ?
Posts: 522
Name: Gabe Solomon
Location: Romania
Trades: 1
replace this lines
Quote:
echo "Data has been submitted to $to!";
mail($to, $subject, $body);

with
Quote:

mail($to, $subject, $body);
header("Location:file_to_redirect_to.php");
__________________
If you like my posts ... TK is appreciated:)

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
solomongaby is offline
Reply With Quote
View Public Profile Visit solomongaby's homepage!
 
Reply     « Reply to Contact form not redirecting after submittal
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12610 seconds with 12 queries