Incrementing Variables
Posted: Wed Aug 08, 2007 6:53 pm
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
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
So far, im trying to do this
<?php
Code: Select all
if (isset ($_POST['back'])) {
$variable = variable + 1;
} else {
$variable = variable + 2;
}
?><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