473,394 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

redirect to a thankyou page

I need to redirect to a thankyou page after a user submit form. I am new in PHP and trying to use header("Location: thankyou.html"); but it is going to thankyou page. Everything else seems to be working fine - Please help me out !!!


<?php
error_reporting(E_PARSE);
define("ADMIN_MAIL", "jb@bwp.net");
define("HOST_NAME", $_SERVER['HTTP_HOST']);
define("PHP_SELF", $_SERVER['PHP_SELF']);
define('FORM_RECIPIENT', 'webmaster@lenapebuilder.net');
$isHideForm = false;
if( $HTTP_POST_VARS["formmail_submit"] ){
header("Location: thankyou.html");
exit();
}
?>


<!-- Reminder: Add the link for the 'next page' (at the bottom) -->
<!-- Reminder: Change 'YourEmail' to Your real email -->

<?php

$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$customer_name = $_POST['customer_name'];
$customer_email = $_POST['customer_email'];
$customer_address = $_POST['customer_address'];
$customer_city = $_POST['customer_city'];
$customer_state = $_POST['customer_state'];
$customer_zip = $_POST['customer_zip'];
$customer_phone = $_POST['customer_phone'];
$customer_email = $_POST['customer_email'];

$todayis = date("l, F j, Y, g:i a") ;

$message = " $todayis [EST] \n
Name: $customer_name \n
Address: $customer_address \n
City: $customer_city \n
State: $customer_state \n
Zip: $customer_zip \n
Phone: $customer_phone \n
";

$from = "From: $customer_email\r\n";

mail("webmaster@lenape.net", $subject, $message, $from );
?>
Feb 13 '08 #1
5 2106
harshmaul
490 Expert 256MB
Hi,
Are you getting an error? if so what is the error message?
Feb 13 '08 #2
Markus
6,050 Expert 4TB
Could you re-explain the problem please?
Feb 13 '08 #3
ronverdonk
4,258 Expert 4TB
I don't understand this part of your thread:
..... and trying to use header("Location: thankyou.html"); but it is going to thankyou page .....
what is that last 'thankyou' page??

Ronald
Feb 13 '08 #4
helraizer1
118 100+
For the errors, try using

error_reporting(E_ALL);

ini_set("display_errors", true);

That will give you any error that occurs.

If you have header location as thankyou.html, it will go to the thankyou page, do you not think?
Feb 13 '08 #5
nomad
664 Expert 512MB
For the errors, try using

error_reporting(E_ALL);

ini_set("display_errors", true);

That will give you any error that occurs.

If you have header location as thankyou.html, it will go to the thankyou page, do you not think?
you might want to think of a redirect section that will open the link above if it is True if it fails then it does something....
it might look some thing like this
// redirect to success page
if ($success){
code here;
}
else{
some more code here;
}



nomad
Feb 13 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Damo | last post by:
Could someone please help me. I am a newbie at PHP. I downloaded formail.php Version 5.0 from Jacks scripts( http://www.dtheatre.com/scripts/ )and changed the required areas to my email address and...
0
by: Danny | last post by:
Hi, I have no idea if this is actually possible in plain asp but any help might be welcome : After a user has downloaded some content/file from my webserver (http_status =200) I would like to...
7
by: Donna Hawkins | last post by:
I want to use javascript to redirect to a URL which has been passed as a variable (in php). I have searched but cannot find any solution. I think this code is a basic redirect: <script...
4
by: Jim in Arizona | last post by:
I'm wanting to do a simple controlled voting page. I too our webserver off anonymous and everyone who accesses the website is a domain authenticated user. I've already done some control structure...
5
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
1
by: Siva | last post by:
Hi, Can somebody help me in getting me a code for automatic redirection. I have a message box in my project. If somebody post a message, after clicking the submit button a thankyou.aspx page...
1
by: jhmace | last post by:
I have embedded a script into a simple page that allows a visitor to join an email list. The email list is hosted by campaigner.com. The site is: http://www.GreenFinds.com The email signup is...
2
by: Jon Paal | last post by:
I can't seem to get this to redirect on confirm. Dialog appears but does not change pages on "ok" what's missing here ? btnComplete.Attributes.Add("onclick", "if(confirm(' complete...
4
by: deepaks85 | last post by:
Dear Friends, I may take your little bit time to teach me on Credit card information encryption. I know it can be done through SSL certificate. I am very new to SSL Certificate which I need to...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.