Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <?php
- $a=$_post['name'];
- $b=$_post['passwd'];
- $dbhost="localhost";
- $db="mysql";
- $dbuser="root";
- $dbpassword="";
- $con=mysql_connect("localhost","root","");
- mysql_select_db($db);
- $sql="insert into demo1(name,password),values('$a' , '$b')";
- $res=mysql_query($sql);
- if(!res)
- {
- die(mysql_error());
- }
- else
- {
- $s="select *form user where name='$a' ";
- $res=mysql_query($s);
- while($r=mysql_fetch_array($res))
- {
- echo "name" .$r[0] ."<br/>";
- }
- }
- mysql_close($con);
- ?>
- <head>
- <title>
- php
- </title>
- </head>
- <body>
- <form method="post" action="">
- name:
- <input type="text" name="name" /> <br/>
- passwd:
- <input type="password" name="password" /> <br/>
- <input type="submit" name="submit">
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement