PHP Code to Redirect URL's using Promotional codes / vouchers

Hi, hope someone can help as I have limited programming language experience!
I want to add a section on my website where a guest can type in a promotional code, click submit and this then automatically redirects them to another web page specific to the code entered. Is this possible? If so how do I do this.
Thanks.

How are you wanting to list your promotion code? Database or just in an array?
How often are you going to be changing your promotional codes? If often, use a database.

To do this very simply do something like this.

code-input.php

[code]
- Promotional code

[/code]

promotion.php
[php]<?php
$validation = array( ‘sept’ => ‘10’ );
if($validation[$_POST[‘code’]]){
//process
}
?>[/php]

Ofcourse you will need to do more such as code validation etc.
With a database you will be able to update your codes a lot easier, I would suggest date restrictions so that codes can be set to be valid for specific months.

Sponsor our Newsletter | Privacy Policy | Terms of Service