Login Register


Creating Video Streaming site/Social Network filter_list
Author
Message
Creating Video Streaming site/Social Network #1
I am working on a Social network/Video streaming site from scratch.

This is what I have so far.

Code:
<?php $host = "localhost"; $user = "root"; $pass = ""; $db = "Testing"; mysql_connect($host, $user, $pass); mysql_select_db($db); if (isset($_POST['username'])) { $username = $_POST['username']; $password = $_POST['password']; $sql = "SELECT * FROM users WHERE username='".$username."' AND password='".$password."' LIMIT 1"; $res = mysql_query($sql); if (mysql_num_rows($res) == 1) { echo "You've successfully logged in"; exit(); } else { echo "You have entered invalid details"; exit(); } } ?> <html> <head> <title>HitVideo!</title> <link rel="stylesheet" type="text/css" href="css/head.css"> </head> <body> <div id="head"> <form method="post" action="Index.php"> Username: <input type="text" name="username" placeholder="Username"> Password: <input type="password" name="password" placeholder="Password"> <input type="submit" name="submit" value="Log-In"> </form> <h1>HitVideo</h1> </div> </body> </html>

I have a css, but am not going to post that. It looks likes this though.

[Image: 3NvwiGN.png]

Not really designed as Ive been working on the important bit.

Now if you look at the code it says.

Code:
echo "You've successfully logged in"; exit();

Now, How would I make it as if when they are successfully it logs them into the Homepage? (Have not created it yet) because I am not sure how am suppose to make it as so when they look it directs them to that page.







Reply





Messages In This Thread
Creating Video Streaming site/Social Network - by BlueCat - 06-09-2014, 06:34 PM



Users browsing this thread: 1 Guest(s)