0

i am designing a login page using html and php.it includes two buttons one for login and another one to redirect to the registration page.i am planning to use php code to validate login data on the same page.here is my code

<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" method="post"> <div> <table style="width: 100%; height: 377px;"> <tr> <td rowspan="4"><img src="woman.jpg" height="100%" width="100%" alt="woman"/></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td align="right" style="padding:0px;color:white" >username:</td> <td><input runat="server" name="Text1" type="text" /></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td align="right" style="padding:0px;color:white">password</td> <td><input runat="server" name="Text2" type="text" /></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td></td> <td ><input name="Submit1" type="submit" value="login" />&nbsp; <input onclick="document.location.href='regforswa.php'" name="Submit2" type="submit" value="register" /><br/> <a href="fp.php" style="color:white">forgot password</a></td> </tr> </table> </div> </form> 

but the button for registration is not working properly.it is not redirecting to the registration page.i don't want to put register button outside the form.i want to keep the same design and achieve required functionality.

1
  • why don't you make register button type to type="button" Commented Apr 28, 2014 at 5:34

1 Answer 1

1

Change the Button-Type from type="submit" to type="button" to disable the form submission:

 <input onclick="document.location.href='regforswa.php'" name="Submit2" type="button" value="register" /> 
Sign up to request clarification or add additional context in comments.

2 Comments

thank you sir.now it is working fine.sir can you please suggest me some website to learn front end designing/
Not really. I'm not a designer ;)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.