[SOLVED] Forms...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dwfait
Forum Contributor
Posts: 113
Joined: Sun Aug 01, 2004 10:36 pm

[SOLVED] Forms...

Post by dwfait »

Hi, on my website i have an image as a submit button, however, i would like the image button to act as a normal button, so that i can get the entered feilds with $_POST[]. Here is the current code for the form:

Code: Select all

<td height=&quote;100%&quote;><table width=&quote;233&quote; height=&quote;100%&quote;  border=&quote;0&quote; cellpadding=&quote;0&quote; cellspacing=&quote;0&quote;>
                  <tr>
                    <td height=&quote;87&quote; align=&quote;left&quote; valign=&quote;top&quote; background=&quote;images/back_form.jpg&quote;><div style=&quote;padding-left:10px; padding-top:12px&quote;>
                      <table width=&quote;199&quote;  border=&quote;0&quote; cellspacing=&quote;0&quote; cellpadding=&quote;0&quote;><form action=&quote;test.php?page=loginp&quote;>
                        <tr align=&quote;right&quote; valign=&quote;middle&quote;>
                          <td width=&quote;52&quote; height=&quote;24&quote; class=&quote;style7&quote;>Login:</td>
                          <td height=&quote;24&quote;><input type=&quote;text&quote; name=&quote;a&quote; style=&quote;width:136px; height:15px; font-family:tahoma; font-size:9px; background-color:#9AB2A6 &quote;></td>
                        </tr>
                        <tr align=&quote;right&quote; valign=&quote;middle&quote;>
                          <td width=&quote;52&quote; height=&quote;24&quote; class=&quote;style7&quote;>Password:</td>
                          <td height=&quote;24&quote;><input type=&quote;password&quote; name=&quote;b&quote; style=&quote;width:136px; height:15px; font-family:tahoma; font-size:9px; background-color:#9AB2A6 &quote;></td>
                        </tr>
                        <tr align=&quote;left&quote; valign=&quote;middle&quote;>
                          <td colspan=&quote;2&quote;><table width=&quote;100%&quote;  border=&quote;0&quote; cellspacing=&quote;0&quote; cellpadding=&quote;0&quote;>
                              <tr align=&quote;right&quote; valign=&quote;top&quote;>
                                <td align=&quote;left&quote;><a href=&quote;#&quote; class=&quote;style8&quote;>forgot the password?</a></td>
                                <td><input name=&quote;image&quote; type=&quote;image&quote; src=&quote;images/sobes.jpg&quote; width=&quote;53&quote; height=&quote;16&quote;></td>
                              </tr>
                          </table></td>
                        </tr></form>
                      </table>
                      </div></td>
                  </tr>
When i click the submit button, it takes me to index.php?a=user&b=pass, however i just want it to take me to index.php?page=loginp.
Does anyone know how i can do this?
dakkonz
Forum Commoner
Posts: 69
Joined: Sat Dec 27, 2003 2:55 am
Location: Asia

Post by dakkonz »

maybe u can try putting method="post" in ur form tag for example like this

<form action="test.php?page=loginp" method="post">
dwfait
Forum Contributor
Posts: 113
Joined: Sun Aug 01, 2004 10:36 pm

Post by dwfait »

Thanks, it worked.
Post Reply