Login Register


Creating Video Streaming site/Social Network filter_list
Author
Message
RE: Creating Video Streaming site/Social Network #4
(06-09-2014, 06:42 PM)BlueCat Wrote:
(06-09-2014, 06:41 PM)zomgwtfbbq Wrote:
(06-09-2014, 06:34 PM)BlueCat Wrote: 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.
Uhm tbh that is the easiest part of creating a streaming and/or social site. I assume you want to learn by creating things. I'm like that too, but in this case, believe me look at very basic open source community tools and expand them and learn from that.
You even start with mysql_xxx functions which is a very bad thing as it maybe not supported anymore within a year. Switch to PDO/mysqli.

I was using mysqli earlier on, But I kept getting errors so I just done some Mysql to get started with
For now it's actually wasting your time, better post the error that you got from using mysqli.

Reply





Messages In This Thread



Users browsing this thread: 1 Guest(s)