rewriting a splash page; using sessions, changing links
Posted: Sat Jan 09, 2010 6:37 am
Hello. I have googled and read till I'm blue in the face but I can't find what I need. The problem is, I'm soooo new to php so here is the long story...
I have done plenty of html/css stuff and that's fine. Recently someone asked me to redesign their splash page. Great. At the moment it is a basic splash with info about the site (adult literature} and it has two buttons. "No I'm not 18" goes to google and "yes I am 18" goes to the main site. At the moment, it sets a cookie ans starts a session so that once the user is in the main site, when they click for home, they go to the index page not back to the splash page.
The redesign involved putting loads more links onto the splash page because it's otherwise quite sterile and offputting. I have a disclaimer up which says "clicking on ANY of these links certifies that you are over 18, yadda yadda" and I want each link to go into the site.
The current code in the header reads:
and at the "enter button" it says:
So my question is this. Can I leave the php as it is in the header, and will that mean it will work for all the links, or do I need to modify the code for every new link I put on the splash page? In the back of my mind there must be some way of globally assigning the same thing to each link so I don't need to retype it each time.
I hope that makes sense. Like I say, I've been reading every php101 I can find but I am out of my depth, it's taking some time to get my head round this.
Oh I do have WAMP now so I can test locally, but the people I'm redesigning for have not given me access to thier server not any code except for this splash page. Someone else did all the other coding.
Thanks folks.
I have done plenty of html/css stuff and that's fine. Recently someone asked me to redesign their splash page. Great. At the moment it is a basic splash with info about the site (adult literature} and it has two buttons. "No I'm not 18" goes to google and "yes I am 18" goes to the main site. At the moment, it sets a cookie ans starts a session so that once the user is in the main site, when they click for home, they go to the index page not back to the splash page.
The redesign involved putting loads more links onto the splash page because it's otherwise quite sterile and offputting. I have a disclaimer up which says "clicking on ANY of these links certifies that you are over 18, yadda yadda" and I want each link to go into the site.
The current code in the header reads:
Code: Select all
<?PHP
setcookie("ageauth", "yes" , 0);
//call session_start() to have access to SESSION[...] variables
session_start();
// Set this to the default value in case the $_SESSION['original_user_url'] isn't set
$enterUrl = "http://www.loveyoudivine.com/";
//If the original_user_url is presesnt in the session, get it and use it to make the link for the "Enter" button.
if (isset($_SESSION['oringal_user_url'])) {
$enterUrl = $_SESSION['oringal_user_url'];
}
?>Code: Select all
<div id="yes_button"><a href=<?php print "\"" . $enterUrl . "\""; ?>><img src="http...etc etcSo my question is this. Can I leave the php as it is in the header, and will that mean it will work for all the links, or do I need to modify the code for every new link I put on the splash page? In the back of my mind there must be some way of globally assigning the same thing to each link so I don't need to retype it each time.
I hope that makes sense. Like I say, I've been reading every php101 I can find but I am out of my depth, it's taking some time to get my head round this.
Oh I do have WAMP now so I can test locally, but the people I'm redesigning for have not given me access to thier server not any code except for this splash page. Someone else did all the other coding.
Thanks folks.