Jump to content

need help setting up a PHP redirect (websites)


abcdabcd

Recommended Posts

I don't know anything about php, I have seen the codes but, that's it.  I have basic html skills but, I don't think what I'm wanting can be done in html.

 

 

I have a webpage that asks users to enter a promo code (which is really a tracking code that I use to see where my sales came from).

 

The way the tracking works normally is that it's setup like this, you pick a code and if you attach it to the url like this www.website.com/blahblah?sub=trackingcode  - see where it says "trackingcode" that's where I'd normally attach what would be the promo code manually.  When I check my sales reports that code will show up and I'll know where the sale came from.

 

What I'm trying to figure out is how to attach the promo code which is the tracking code to the url automatically and pass through a redirect. 

 

This is how I have my websites setup ---

 

webpage 1 ----> redirect page ----->webpage 2

 

So the promo code is entered on webpage 1 by a customer and then it redirects to some other webpage.  Then it goes to the final webpage. 

 

I need to figure out how to record the promo code that is entered and attached to the url all the way from webpage1 where it's entered through to the redirect page which will then open webpage2 with the promo code (tracking code) attached to the url.

 

 

Any help would be greatly appreciated.

 

 

Thanks!

 

 

Link to comment
Share on other sites

without using sql you culd have

 

if you are on about just adding it by a form then it wuld be something like this

 

//first you culd do your simple form such as this

<form name="redirect" method="POST">
name: <input type="TEXT" name="tracking_code" /> 
<input type="SUBMIT" name"postthisform" value="Confirm Code" >
</form>

//then you would have a php code like so..
<?PHP //php open tag

//this is basicaly saying if user submits form do the fallowing actions between the brackets

if(isset($_POST['postthisform']) { //open bracket

//you are also better of to confirm that they have entered a code into the field so they dont post it blank so..
//this is basicaly saying if tracking_code is empty then do action between the brackets
if(empty($_POST['tracking_code'])) {

echo "You must enter the tracking code before beginning please go back and try again";

//this basical states ELSE do this
} else {
//here is where ur redirect code would be for any input form its normal $_POST['inputformname']
echo '<META HTTP-EQUIV=Refresh CONTENT="3; URL=http://www.website.com/blahblah?sub="'.$_POST['tracking_code'].'">';

}
} //close bracket

?> //php close tag

 

i wuld advise u to learn abit of php not everyone wuld help u like this most people expect u to have a abit of code or to have atleast tried.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.