Forum Moderators: coopster
<form action="index.php" method="post" id="loginform">
<fieldset>
<span class="label-u">Username:</span>
<input type="text" class="text-inp-u" name="username" value="" />
<span class="label-p">Password:</span>
<input type="password" class="text-inp-p" name="password"value="" />
<input type="image" src="images/okconfirm.jpg" class="button" id="submit" name="submit" />
<span><a href="#">Lost?</a> - <a href="register.php">Register</a></span>
</fieldset>
</form>
and this right here is the php post code:
<?php
if($_POST){
print_r($_POST);
}
if($_POST['submit_x']) {
echo "IMAGE BUTTON SET";
$username = $_POST['username'];
$password = $_POST['password'];echo $username;
echo "<br />";
echo $password;
echo "<br />";
if ($username = "val" && $password == "pass") {
echo "successful login";
}
else {
echo "incorrect login";
}
}
else {
echo "IMAGE BUTTON NOT SET";
}
?>
i put the
if($_POST){
print_r($_POST);
}
The print_r is just for diagnostics.
This here:
if($_POST['submit_x']) {
You don't have a form element by that name, instead you'd want:
if(isset($_POST['submit'])) {
since that's what your submit's name is.
And finally, you might want to try a button element instead:
<button style="background: url(images/okconfirm.jpg);" name="submit"...