473,386 Members | 1,710 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,386 software developers and data experts.

Controlling user flow with forms

I have a screen where I ask the user their payment type. Once they
select the payment type either check or credit card, I would like them
to go to a seperate checkout page. How can I write a bit of code to
make .php re-direct them to the proper page? (I considered doing this
with Javascript, but would rather keep it all in .php)

Thanks,
ja***@davispowers.com
Jul 17 '05 #1
3 1600
Are you validating the credit card before you redirect them

Jeremy

Jason wrote:
I have a screen where I ask the user their payment type. Once they
select the payment type either check or credit card, I would like them
to go to a seperate checkout page. How can I write a bit of code to
make .php re-direct them to the proper page? (I considered doing this
with Javascript, but would rather keep it all in .php)

Thanks,
ja***@davispowers.com


Jul 17 '05 #2
Jason wrote:
I have a screen where I ask the user their payment type. Once they
select the payment type either check or credit card, I would like them
to go to a seperate checkout page. How can I write a bit of code to
make .php re-direct them to the proper page? (I considered doing this
with Javascript, but would rather keep it all in .php)

Thanks,
ja***@davispowers.com


Two things you can do.
1) (my preferred method): Just have it on the same page, and output
different things on that page based on the payment type.

for example:
if ($_GET['paymentType'] == "creditcard")
{
// output the form for credit card crap
}
else
{
// output for check etc
}

2) If they are radically different and it really is appropriate to send them
to different actual pages, you can do (at the top of the page, before
*anything* is outputted, including blank spaces/lines etc)

<?php
// process whatever you need to, but output NOTHING
if ($_GET['procType'] == "creditcard")
header("Location: http://www.mysite.com/creditcard.php");
else
header("Location: http://www.mysite.com/otherpayment.php");
?>
Jul 17 '05 #3
Regarding this well-known quote, often attributed to Jason's famous "2 Jan
2004 11:17:46 -0800" speech:
I have a screen where I ask the user their payment type. Once they
select the payment type either check or credit card, I would like them
to go to a seperate checkout page. How can I write a bit of code to
make .php re-direct them to the proper page? (I considered doing this
with Javascript, but would rather keep it all in .php)

Thanks,
ja***@davispowers.com


What's the problem in just having a "Check" and a "Credit Card" link in
plain HTML?

--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Scott M | last post by:
Hi, I am currently trying to write a simple game using vb.net the form I am working on is 800*600 (this is set as the maximum size) and autoscroll is set to true. The user moves around the...
15
by: Deano | last post by:
I've posted about this subject before but haven't really got anywhere yet. I have now come up with a plan of action that takes into account my strong desire to implement save/discard functionality...
8
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
1
by: Jeremy S. | last post by:
I'm writing a Windows Forms app (connecting to SQL Server db) that will need to enable/disable access to various UI controls based on the particular user that is currently logged in. My...
2
by: ApexData | last post by:
Hello In order to control keyboard keystrokes in my application, I use the KeyPreview=Yes, OnKeyDown Events of every Form with great success. HOWEVER, these events are not available in REPORTS,...
0
by: Coleen | last post by:
I guess I didn't make my problem clear enough, or maybe there is no better way to do this... I have an ASP.Net (1.0 at the moment but we are upgrading to 2.0 using VB.net as the codebehind) web...
2
by: mark4asp | last post by:
This is a simplified version of my site. There are Premium users who have access to the Premium directory. Anyone else attempting to access it should be logged and then redirected to the...
0
by: mylog | last post by:
I have downloaded a GLEE(Graph Layout Execution Engine) and written the following code to display a windows form from a web page but i am encountering with a small problem on displaying the graph...
7
by: DeZZar | last post by:
Hi all, Unfortunately I am quite a novice with Access!! I've created a number of data bases for my work however becuase my skills are limited to really built in functionality and wizards my...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.