Hi All
PHP is refusing to cooperate with me and I have no clue why 😕
I'm trying to do a simple comparison using an IF statement and display an html page is the IF statement is true.
the first part of my code is (this comes from America.php)..
<td><img src="images/sanFranThumb.jpg" align="middle"/></td>
<td><?php echo "<a href=scriptA.php?place=1>"; ?>
<h3>San Francisco</h3></a> </td>
This is then scriptA.php...
<?php
session_start();
$temp = $_GET['place'];
$_SESSION['placeValue'] = $temp;
header('Location: http://localhost/Website Templates/America1.php');
?>
And the following in America1.php is where the problem is..
<?php $placeValue = $_SESSION['placeValue'];
if ($placeValue == 1)
{
$content = 'SanFranContent.htm';
}
if ($placeValue == 2)
{
$content = 'NewYorkContent.htm';
}
if ($placeValue == 3)
{
$content = 'MemphisContent.htm';
}?>
I do use session_start(); at the start of the page. However, none of these IF statments work. I've printed out the value of $placeValue to screen and it is the correct value but I don't understand why the IF's dont catch the value. Depending on the value of $placeValue, a different HTML page is displayed.
Thanks in advance