Hi all BHW members!
This is kinda my first post in here so i would like to start by saying "thank you" to all you guys that make this forum so nice! Hopefully I too could start sharing some nice info when I get better at all this BH stuff
I have a problem with some php code (I am not an expert) and I cant seem to get it right. Maybe someone in here could help me out.. Thanks in advance..
Here is my prob:
I have a php page that starts a session and then redirect the user to another page where i would like to show 2 different html pages based on if/else the session is true or not (Did the user come from the previous site or not).
page 1 looks like this:
Page 2 looks like this:
In case you dont see my point I will try to explain the usage of the script. I would like to start a session "page1" and then when the session starts bring the user to "page2" where the person then see 1 html code if they came from "page1" otherwise 2 html code.
Maybe this code is totally wrong or it could be made more simple! if so then please advise me
Please help!
Bagging
This is kinda my first post in here so i would like to start by saying "thank you" to all you guys that make this forum so nice! Hopefully I too could start sharing some nice info when I get better at all this BH stuff
I have a problem with some php code (I am not an expert) and I cant seem to get it right. Maybe someone in here could help me out.. Thanks in advance..
Here is my prob:
I have a php page that starts a session and then redirect the user to another page where i would like to show 2 different html pages based on if/else the session is true or not (Did the user come from the previous site or not).
page 1 looks like this:
Code:
<?php
session_start();
$_SESSION['BeenToA']='yes';
header('Location: page2.php');
?>
Page 2 looks like this:
Code:
<?php
session_start();
if ($_SESSION['BeenToA']=='yes')
unset($_SESSION['BeenToA']);
{
print ('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<div><h1>Hello world!</h1>
</div>
</body>
</html>');
}
else ($_SESSION=='no')
{
print ('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</body>
</html>');
}
?>
In case you dont see my point I will try to explain the usage of the script. I would like to start a session "page1" and then when the session starts bring the user to "page2" where the person then see 1 html code if they came from "page1" otherwise 2 html code.
Maybe this code is totally wrong or it could be made more simple! if so then please advise me
Please help!
Bagging