Hi,
I want to give a variable to page2.php, where the variable given from page1.php is linked to some extra information (a short story). But how? ..probably it's just a very small piece of code..
thanx in advance,
OScar
################page1.php##################
<form method="get" action="page2.php">
<select name="color">
<option value="green">green</option>
<option value="yellow">yellow</option>
<option value="purple">purple</option>
<option value="green">green</option>
<option value="red">red</option>
<input type="submit" value="Verzenden">
</select>
</form>
################page2.php##################
<body>
<?php $green="green, with a nice accent.";?>
<?php $yellow="another short story.";?>
<?php $purple="purplehills.";?>
<?php $red="redstory.";?>
<?php
switch($color)
{
case 'green':
$color_txt="green text, nice";
case 'yellow':
$color_txt="small text about yellow";
case 'purple':
$color_txt="small text for purple";
}
?>
Your color's story: <?php echo $HTTP_GET_VARS[ "color" ];?>
</body>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
So the choosen story has to replace this code:
<?php echo $HTTP_GET_VARS[ "color" ];?>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
Hi, tried it out,
but came to one problem:
Every data the variable has, it always displays the last "case", so in this example, "purple", with it's text: "small text for purple".
And that's not how it should work. So, if anyone have the solution, please reply!
Oscar.
P.S. thanks for reading and your time!!