abcdabcd Posted March 8, 2008 Share Posted March 8, 2008 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! Quote Link to comment Share on other sites More sharing options...
amites Posted March 8, 2008 Share Posted March 8, 2008 simple script, write the promo code to a DB (or process it however you are tracking everything) then use the header('location: http://www.url.com'); to redirect, just make sure you don't print anything to screen on the redirect page http://us3.php.net/manual/en/function.header.php Quote Link to comment Share on other sites More sharing options...
SkullzY88 Posted March 8, 2008 Share Posted March 8, 2008 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. Quote Link to comment Share on other sites More sharing options...
abcdabcd Posted March 8, 2008 Author Share Posted March 8, 2008 Yeah, I don't understand anything you guys said. Seems I'll have to pay somebody to do this. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.