Variable Stays the same even when url assigns new value...
Posted: Mon May 20, 2002 7:44 am
I am making a webpage that will alow people to view images of models by choosing a model and an image number, however whenever anyone tries to change models, it seems to be stuck on Alexa.
Here is the code...
THIS IS THE CODE FOR INDEX.PHP
<?php
if (empty($model))
{
$model = "Select A Model";
include 'header.php';
include 'firstvisit.php';
include 'footer.php';
}
else
{
if ($model = "Alexa") $path = "alexablkdrscch";
elseif ($model = "Alexia and Tyler") $path = "alextwgrsbg";
elseif ($model = "Allisin") $path = "aliovergr";
elseif ($model = "Annie and Hanna") $path = "anihangg";
elseif ($model = "Erica") $path = "erccampjungle";
elseif ($model = "Kaylee") $path = "kaybluelng";
elseif ($model = "Monica") $path = "moniroselng";
elseif ($model = "Sydney") $path = "sydfence";
include 'header.php';
include 'photos.php';
include 'footer.php';
}
?>
THIS IS THE CODE FOR PHOTOS.PHP
<div align="center">
<?php if (empty($pic)) $pic = "001"; ?>
<img src="images/<?php echo $path . $pic . ".jpg\">"?>
</div>
THE HEADER ONLY HAS 1 LINE OF CODE
<? echo $model ?>
THE FOOTER DOESN'T HAVE ANY PHP CODE
And the FIRST VISIT.php page only contains links like the following,
index.php?model=Kaylee&pic=001
Not sure why the variable refuses to change, the code seems to be in the right order.
Here is the code...
THIS IS THE CODE FOR INDEX.PHP
<?php
if (empty($model))
{
$model = "Select A Model";
include 'header.php';
include 'firstvisit.php';
include 'footer.php';
}
else
{
if ($model = "Alexa") $path = "alexablkdrscch";
elseif ($model = "Alexia and Tyler") $path = "alextwgrsbg";
elseif ($model = "Allisin") $path = "aliovergr";
elseif ($model = "Annie and Hanna") $path = "anihangg";
elseif ($model = "Erica") $path = "erccampjungle";
elseif ($model = "Kaylee") $path = "kaybluelng";
elseif ($model = "Monica") $path = "moniroselng";
elseif ($model = "Sydney") $path = "sydfence";
include 'header.php';
include 'photos.php';
include 'footer.php';
}
?>
THIS IS THE CODE FOR PHOTOS.PHP
<div align="center">
<?php if (empty($pic)) $pic = "001"; ?>
<img src="images/<?php echo $path . $pic . ".jpg\">"?>
</div>
THE HEADER ONLY HAS 1 LINE OF CODE
<? echo $model ?>
THE FOOTER DOESN'T HAVE ANY PHP CODE
And the FIRST VISIT.php page only contains links like the following,
index.php?model=Kaylee&pic=001
Not sure why the variable refuses to change, the code seems to be in the right order.