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
How do I get this Script to ReDirect?
Old 07-15-2008, 08:34 AM How do I get this Script to ReDirect?
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 680
Name: Lashtal
Trades: 0
So here's what's going on...

I have an HTML page with an order form on it: http://www.magickcircles.com/formindb.html

When a user enters the information into that page, they are directed to a differant page: http://www.magickcircles.com/formindb.php

HOWEVER:

they are left on that PHPpage, whereas, I would like the script to redirect to a Differant URL.

Here is the script for that PHPpage:

PHP Code:
<?php
$con 
mysql_connect("LOCALHOST","USERNAME","PASSWORD"); //Replace with your actual MySQL DB Username and Password
if (!$con

die(
'Could not connect: ' mysql_error()); 

mysql_select_db("DATABASENAME"$con); //Replace with your MySQL DB Name
$name=mysql_real_escape_string($_POST['name']); //This value has to be the same as in the HTML form file
$email=mysql_real_escape_string($_POST['email']); //This value has to be the same as in the HTML form file
$sql="INSERT INTO form_data (name,lastname,streetaddress,city,state,zipcode,phonenumber,email,date,time,timezone,coupon,itemname1,quantity1,price1,itemname2,quantity2,price2,itemname3,quantity3,price3,itemname4,quantity4,price4,itemname5,quantity5,price5,itemname6,quantity6,price6,itemname7,quantity7,price7,itemname8,quantity8,price8,itemname9,quantity9,price9,itemname10,quantity10,price10,itemname11,quantity11,price11,itemname12,quantity12,price12,sh,ordertotal) VALUES ('$name','$lastname','$streetaddress','$city','$state','$zipcode','$phonenumber','$email','$date','$time','$timezone','$coupon','$itemname1','$quantity1','$price1','$itemname2','$quantity2','$price2','$itemname3','$quantity3','$price3','$itemname4','$quantity4','$price4','$itemname5','$quantity5','$price5','$itemname6','$quantity6','$price6','$itemname7','$quantity7','$price7','$itemname8','$quantity8','$price8','$itemname9','$quantity9','$price9','$itemname10','$quantity10','$price10','$itemname11','$quantity11','$price11','$itemname12','$quantity12','$price12','$sh','$ordertotal')"/*form_data is the name of the MySQL table where the form data will be saved.
name and email are the respective table fields*/
if (!mysql_query($sql,$con)) {
 die(
'Error: ' mysql_error()); 

echo 
"Your order is processing..."
mysql_close($con);
?>
How is it done?

keep in mind that I do want the user to see the "Your order is processing..." message at the top left of their screen before being redirected to a thank you page
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-15-2008, 08:40 AM Re: How do I get this Script to ReDirect?
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 680
Name: Lashtal
Trades: 0
oh and...

Here's a twist.

I want it to redirect to the next page On A Timer.
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
Reply With Quote
View Public Profile
 
Old 07-15-2008, 07:47 PM Re: How do I get this Script to ReDirect?
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
In PHP, you can send a post httpd header to set a new location. However a timed refresh will require a refresh meta tag in the html head.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 07-15-2008, 11:22 PM Re: How do I get this Script to ReDirect?
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 680
Name: Lashtal
Trades: 0
(Links Removed from first post)

Thanks guys, I got it
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How do I get this Script to ReDirect?
 

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.70867 seconds with 12 queries