Dave3765 Posted October 27, 2007 Share Posted October 27, 2007 Hi, Ok, I have 2 landing pages and I need to display a different contact phone number as an image for each page. The thing that's got me thinking is that I need this image (which is in a standard header file) to stay the same for each visitor across all the pages on my site, depending on which landing page they came in from. I need the phone number image to stay the same for 30 minutes even if a user revisits one or more of the landing pages within that 30 minutes. So is a visitor comes in from landingpage1 they see phonenumber1 throughout the site for 30mins - if a visitor comes in from landingpage2 they see phonenumber2 across the site for 30mins. What would be the best way to do this? php? javascript? would it need cookies? Any suggestions? Thanks Guys Quote Link to comment https://forums.phpfreaks.com/topic/75033-change-an-image-based-on-landing-page-possible/ Share on other sites More sharing options...
Dave3765 Posted October 27, 2007 Author Share Posted October 27, 2007 Any ideas guys? Quote Link to comment https://forums.phpfreaks.com/topic/75033-change-an-image-based-on-landing-page-possible/#findComment-379473 Share on other sites More sharing options...
GingerRobot Posted October 27, 2007 Share Posted October 27, 2007 You could do it all through sessions. When someone comes to either page, you first check to see if the session exists. If it does, we know they've already been on your website, and so don't need to do anything. If, on the other hand, it does not exist, we simply set which image we should display throughout the site. On each page, we load the correct image - the name/link to which will be in the session. Quote Link to comment https://forums.phpfreaks.com/topic/75033-change-an-image-based-on-landing-page-possible/#findComment-379475 Share on other sites More sharing options...
Dave3765 Posted October 27, 2007 Author Share Posted October 27, 2007 Hey thanks for the reply. I wanted to stay away from sessions if possible and use something that will keep my url's the same. I've been looking into setting cookies with javascript and am trying to work out the code ??? Quote Link to comment https://forums.phpfreaks.com/topic/75033-change-an-image-based-on-landing-page-possible/#findComment-379507 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.