I am trying to create three mini-forms, each one with an image button. They're not actual forms, they're just buttons that send a variable to the next page. I don't want to use links because they would append the variables to the URI and I want to avoid that. The form action is the PHP script itself, so the page just reloads using the new variable values. Here are the forms:
<tr><td bgcolor="#ffffff" align="center">
<form name="preto" method="post" action="<?php print $PHP_SELF; ?>>
<input type="hidden" name="layout" value="preto">
<input name="form image" type="image" src="pics/cores-preto.bmp" border="0">
</form>
<tr><td bgcolor="#ffffff" align="center">
<form name="cinza" method="post" action="<?php print $PHP_SELF; ?>>
<input type="hidden" name="layout" value="cinza">
<input name="form image" type="image" src="pics/cores-cinza.bmp" border="0">
</form>
The problem is: it doesn't work. PHP is printing a lot HTML garbage instead of the link to itself. However, the same page also contains a form with two drop-down boxes and a "submit" button. This form also points to $PHP_SELF, and works fine. I tried turning the small forms into one drop-down form, and it works:
<form method=get action="<?php print $PHP_SELF; ?>">
<input type="hidden" name="page" value="forum_cat">
<table><tr><td width="5%">
<select name="layout">
<option>Fundo preto<option>Fundo cinza<option>Fundo branco<option>GRANDE
</select>
<tr><td><input type="submit" value="Recarregar">
</table>
</form>
What is the difference? How come the drop-down forms work and the other ones don't?
Thank you,
Luciano ES
Santos, SP - Brasil