Expand|Select|Wrap|Line Numbers
- <html> <head> <title>Untitled Document</title> </head> <body> <center> <form action="http://bytes.com/signup.php" method="post"> <table width="400" border="1" cellspacing="3" cellpadding="3"> <tr> <td width="195" bgcolor="#33FF33"><div align="justify"><em><strong>Name</strong></em></div></td> <td width="178"><input name="name" type="text"/></td> </tr> <tr> <td bgcolor="#33FF33"><div align="justify"><em><strong>Password</strong></em></div></td> <td><input name="password" type="password"/></td> </tr> <tr> <td bgcolor="#33FF33"><div align="justify"><em><strong>Email</strong></em></div></td> <td><input name="email" type="text" /></td> </tr><tr><table><tr><input name="submit" type="submit" value="submit" /></tr></table></tr> </table> </form> </center> </body> </html> <?php
- $con=mysql_connect('localhost','root','') or die (mysql_error());
- $db=mysql_select_db('zohaib',$con) or die (mysql_error());
- if(isset($_POST['submit'])){
- $name=$_POST['name'];
- $password=$_POST['password'];
- $email=$_POST['email'];
- if($name==''){
- echo "<script>alert('Please enter the Number')</script>";
- exit();
- }
- if($password==''){
- echo "<script>alert('Please enter the Number')</script>";
- exit();
- }
- if($email==''){
- echo "<script>alert('Please enter the Number')</script>";
- exit();
- }
- else {
- $que="insert into table (name,password,email) values ('$name','$password','$email')";
- if(mysql_query($a)){
- echo "<script>window.open('welcome.php','_self')</script>";
- }
- }
- }
- ?>