Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body bgcolor="#352000">
- <center>
- <?php
- $host="pavo.volt-host.com";
- $username="1393_main";
- $password="fatlard";
- $db_name="1393_main";
- $tbl_name="users";
- mysql_connect("$host", "$username", "$password")or die("cannot connect");
- mysql_select_db("$db_name")or die("cannot select DB");
- $myusername=$_POST['username'];
- $mypassword=$_POST['password'];
- $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
- $result=mysql_query($sql);
- $count=mysql_num_rows($result);
- if($count==1){
- session_register("username", $myusername);
- session_register("password", $mypassword);
- echo "Welcome " .$_POST[username]. "!";
- }
- ?>
- </center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement