Hello,
I don't have much experience with PHP and I need your help.
I am busy with making a visiting-card webshop and people have to choose a background for their visiting card.
I use PHP Sessions for saving the variables. This is because there are more pages where people can type their name, company etc. In the end (after the customer visits more php-pages), I try to put the background, names, company etc into a MySQL database.
I made two phpfiles: index.php and look.php
Sourcecode of index.php
<?php
session_start();
session_register("backgroundcolor");
echo "<form name=myform method=post action=$PHP_SELF>
<p>Choose your backgroundcolor:<br>
<input TYPE=radio NAME=backgroundcolor VALUE=blue checked>BLUE <br>
<input TYPE=radio NAME=backgroundcolor VALUE=red>RED <br>
<input TYPE=radio NAME=backgroundcolor VALUE=green>GREEN <br>
<input TYPE=radio NAME=backgroundcolor VALUE=yellow>YELLOW <br>
<input TYPE=submit name=submit value=Submit>
</p>
</form>";
echo "<p>Click <a href=look.php>here</a> to see the variable backgroundcolor.</p>";
if (isset($submit))
{
echo "Thank you sooooooo much!";
}
?>
Sourcecode of look.php
<?php
session_start();
echo "$backgroundcolor";
?>
The problem is: when you choose your backgroundcolor, press submit and go to look.php, then you'll see the variable you have chosen. But if you go back to index.php and you choose an another color, press Submit and go to look.php, then you'll see the color you've chosen the first time!!
Does anybody know how I can fix this problem (so that everytime you'll select a color and press send, you'll see on look.php the color you've just selected (no previous color you've selected)
See here ----> PROBLEM IN ACTION <-------
Thanks in advance for helping me.