954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

have 3 landing pages, one common destination, how can i make it so each can go back..

Hello, all:

Say have 3 separate landing pages on my site (or more even), but they all end up at one common destination, how can i make it so each visitor can then go back to landing page they came from? here's the scenario:

Say I have links from Google, Yahoo, and mySpace that take people to each "site's" landing page; so for Google ads I would have my own "Google-Landing-page"... so this way I can keep track of visitors on a per landing-page basis. Thing is, once each person reaches their own landing page, they are then taken to set of pages whcih are then common to all... I want to in turn be able to put a link ("Back to Landing Page" button) in these common pages so they each can go back to the landing page each of them came from (Yahoo-persom, goes back to yahoo-landing page, Google person goes back to Google Landing-page and so forth.

I thought probably set some kind of a cookie, but not exatly sure how, or even if it's the right way... to do that.

thanks in advance!

websurfer
Junior Poster in Training
65 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

Thats one I'd like to know myself. My initial thoughts would be to play around with the command: $_SERVER['HTTP_REFERER'].

However I do not think this would work because the browser history is client-side, and the php would be server-side.

There's a 99% chance I'm talking rubbish but I'm sure a PHP Guru will be along shortly to save the day!

Anthony

antwan1986
Junior Poster
110 posts since May 2008
Reputation Points: 14
Solved Threads: 8
 

right, I thought about that... a REFERER, probably could be done, thru there somehow...

websurfer
Junior Poster in Training
65 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

Hey, Anthony.. if it helps you here is answer.. thru SESSIONS. such a simple and elegant solution, nothig beats PHP! I got from somebody at another forum:

on landingPage.php:

<?php
session_start();
$_SESSION['landing_url'] = 'http://www.cnn.com/';
?>


Link on common destination pages:

<?php
session_start();
echo "Back to landing page.";
?>

I just tested it, works like a charm!

websurfer
Junior Poster in Training
65 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You