Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <?php>
- echo "welcome to php programming";
- ?>
- <body>
- <form action="begin.php" method="post">
- username:<input type="text" name="username"><br>
- password:<input type="password" name="password"><br>
- <input type="submit">
- </form></body></html>
- <?php
- $host='localhost:3306';
- $dname='dbname';
- $can=mysql_connect($host,'root','root') or die (mySql_user());
- $db=mySql_Select_db($dbname,$can) or die (mySql_error());
- $id=$_post['username'];
- $paid=$_post['password'];
- echo $id;
- if(!empty($_post['username']))
- {
- $query=mySql_query("select * from student") or die(mySql_error());
- $row=mySql_fetch_array($query) or die (mySql_error());
- if($row['name']=$id and $row['password']==$pwd)
- {
- echo "login successful";}
- else
- {
- echo "login failed ";
- }}
Add Comment
Please, Sign In to add comment