Forum Moderators: open

Message Too Old, No Replies

Image Submit button

         

section

11:49 pm on Mar 14, 2005 (gmt 0)



Hi i am trying to make a submit button that i have of a login form into an image button.Well i know how i can made it image but i realize that when the submit button is image it cant parse the values of the input boxes right and it cant login.

WELL THIS IS THE CODE THAT I USE FOR THE BUTTON.AND NOT WORKING..

echo"<table class=\"boxes\"><tr><td>";
echo"<form action=\"login.php\" method=\"post\"> ";
echo" <img src=\"images/bnb_usrtitle.gif\"><BR><INPUT maxlength=\"20\" ";
echo" name=\"username\" class=\"input\"><BR><img src=\"images/bnb_passtitle.gif\"><BR><INPUT type=\"password\" maxlength=\"24\" ";
echo" name=\"password\" class=\"input\"> <INPUT type=\"image\" SRC=\"images/enterbtn.gif\" name=\"login\" value=\"Log in\" WIDTH=\"44\" HEIGHT=\"15\" BORDER=\"0\" STYLE=\"border: 1px none;\" align=\"absmiddle\"><BR><INPUT ";
echo" type=\"checkbox\" name=\"autologin\" STYLE=\"border: 1px none; \" > Remember Password ";
echo"<INPUT type=hidden value=\"redirect.php\" name=\"redirect\">";

AND THIS IS THE ORIGINAL CODE...

echo"<table class=\"boxes\"><tr><td>";
echo"<form action=\"login.php\" method=\"post\"> ";
echo" <img src=\"images/bnb_usrtitle.gif\"><BR><INPUT maxlength=\"20\" ";
echo" name=\"username\" class=\"input\"><BR><img src=\"images/bnb_passtitle.gif\"><BR><INPUT type=\"password\" maxlength=\"24\" ";
echo" name=\"password\" class=\"input\"> <INPUT type=\"submit\" value=\"Log in\" name=\"login\"><BR><INPUT ";
echo" type=\"checkbox\" name=\"autologin\" STYLE=\"border: 1px none; \" > Remember Password ";
echo"<INPUT type=hidden value=\"redirect.php\" name=\"redirect\">";

i hope that anyone can help me thanx...

gooflox

3:16 pm on Mar 15, 2005 (gmt 0)

10+ Year Member



when you use an image for the submit, it passes the x and y coordinates of where the user clicked on the image.

here are the parameters from the "image form":
?username=&password=&redirect=redirect.php&login.x=24&login.y=6

Here they are from the submit button:
?username=&password=&login=Log+in&redirect=redirect.php

you can see that if you are testing the value for the parameter "login" you will get different values.

Try adding a hidden input like this with your image:
echo"<INPUT type=hidden name=\"login\" value=\"Log in\" >";

and change (or take out) the name and value in the input type=image.

That should work.