By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,746 Members | 1,924 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,746 IT Pros & Developers. It's quick & easy.

Form Processing Issue

P: 1
Hi, I am working on a somewhat complicated form wherein I am collecting data for a client and then submitting the data for credit card processing and submitting it to a gateway and sending a confirming email to both the client and the regstrant. Everything is working great except one small issue. In some cases there is a promotional cide that is sumitted in the form that offers a discounted function. I need to check if code is valid and if it is not, stop, the process and alert the user that he needs to go back and enter a valid code.

Again this is not an issue. I have the proper code and everything is fine. The problem I am having is that the rest of the process does not stop like I want it to. Here is the scenario:

I have a form: registration.php that posts to regproc.php

regproc.php gathers all of the variables calculates pricees based on criteria, etc., then I submit the data to the gateway and send the email.

I check for the valid promotional code BEFORE I submit to the gateway. Is there a way I can stop the rest of the code in regproc.php from running if the code is invalid?

Thanks
Feb 21 '07 #1
Share this Question
Share on Google+
1 Reply


Motoma
Expert 2.5K+
P: 3,235
I check for the valid promotional code BEFORE I submit to the gateway. Is there a way I can stop the rest of the code in regproc.php from running if the code is invalid?

Thanks
Welcome to theScripts.

[PHP]
//somewhere in the code:
$validPromo = false;

//later in the code
if(!$validPromo)
{
header("Location: error.php?errorNumber=5");
}
[/PHP]

Your error page can then check the error number, and perform the necessary actions.
Feb 21 '07 #2

Post your reply

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