Page 1 of 1

Incrementing Variables

Posted: Wed Aug 08, 2007 6:53 pm
by compguru910
Im new to this forum, and pretty much to PHP and I have a general question. From my understanding, everytime you use a submit button, it "sets" the value of it, on the next page to be loaded. Now, if I set up an INPUT TYPE="image" and submit that with the name and value, shouldnt the $_POST return as "SET"? Im a little confused on how this works with the image type.
So far, im trying to do this
<?php

Code: Select all

if (isset ($_POST['back'])) {
     $variable = variable + 1;
     } else {
     $variable = variable + 2;
     }
?>
Here is my script for the button itself

<form method="post" action="player.php"><INPUT TYPE="image" src="player/back.jpg" name="back" value="1">

Now, if I click the button, shouldnt it "SET" the "back" variable and my above PHP script would work? Im confused, if anyones got any suggestions, I would appreciate it

Posted: Wed Aug 08, 2007 8:43 pm
by Christopher
Image inputs do not return a value, they return the coordinates of where the button was clicked.

http://www.w3.org/TR/html4/interact/for ... trol-types