Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form id='login' action='login.php' method='post' accept-charset='UTF-8'>
- <fieldset >
- <legend>Login</legend>
- <input type='hidden' name='submitted' id='submitted' value='1'/>
- <label for='email' >E-mail :</label>
- <input type='text' name='email' id='email' maxlength="50" />
- <label for='password' >Password:</label>
- <input type='password' name='password' id='password' maxlength="50" />
- <input type='submit' name='Submit' value='Submit' />
- </fieldset>
- </form>
- <?php
- include '/home/pieter/Documents/Project 2.2/kyoto-website/login-page/connect.php';
- function Login()
- echo "hoi3";
- {
- echo "hoi2";
- if(empty($_POST)['email']))
- {
- echo "hoi1";
- return("Fill in an e-mail address!");
- }
- if(empty($_POST['password']))
- {
- return("Fill in an Password");
- }
- $email = trim($_POST)['email']);
- $password = trim($_POST)['password']);
- echo "hoi";
- connect($email,$password);
- echo "hoi";
- }
- ?>
- <?php
- function connect($email,$password)
- {
- $connection = mysql_connect("localhost", "root", "");
- $db = mysql_select_db("company",$connection);
- $query = mysql_query("select * from login where password='$password' AND username='$email'", $connection);)
- $rows = mysql_num_rows($query);
- if ($rows == 1) {
- session_start();
- $_SESSION['login_user']=$username;
- header("location: index.html");
- }
- else {
- return("Username or Password is invalid");
- }
- mysql_close($connection);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement