Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Login.html
- //bob - look at lines 24-34 and 41-42
- //just some small things
- <html>
- <head>
- <style type="text/css">
- body
- {
- background-color:#b0c4de;
- margin-top:100px;
- margin-bottom:100px;
- margin-right:50px;
- margin-left:50px;
- border-style:solid;
- border-width:3px;
- border-style:solid;
- border-width:1px;
- }
- </style>
- </head>
- <?php
- //prints out some erros
- if (!empty($errors)) {
- echo '<h1>error!</h1>
- <p class="error">the following error(s) occurred:br />';
- foreach ($error as $msg){
- echo " - $msg<br />\n";
- }
- echo '</p><p>Please try again.</p>';
- }
- ?>
- <body>
- <h1>Login</h1>
- <form action="login.php" method="post">
- Name: <input type="text" name="username" size="20" maxlength="20" />
- Name: <input type="text" name="password" size="20" maxlength="20"/>
- <input type="submit" value="Login" />
- </form>
- </html>
- login.php
- <?php
- $con = mysql_connect("*****","*****","*******");
- if (!$con)
- {
- die('Could not connect: ' . mysql_error());
- }
- mysql_select_db("******", $con);
- $select_user =
- mysql_query('select * from users where username = "' . $_POST['username'] . '" and password = "' . md5($_POST['password'] . '"'));
- if ($select_user.mysql_num_rows > 0){
- session_start();
- }else{
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement