I started making a webpage for my self using PHP.
I have an index.php page with a form on it. The form consist out of a Username and Password field, with the
Submit login button.
E.G
Code: Select all
<html>
<body>
<form action="Home.php" method="post">
Name: <input type="text" name="username" />
Age: <input type="password" name="password" />
<input type="submit" value="Login" />
</form>
</body>
</html>
and the home.php page $_POST gets the username and password from the previous page.
It then connects to MySQL and does a select from where field = Username and if passprd in database is the same as password from previous submited page it then sets a variable to TRUE E.G $Authenticated="TURE"
I then use an if statement.
Code: Select all
If ($Authenticated=="TURE")
{
ALL the rest of the code goes here........
}
ELSE
{
Echo "Username or Password is incorrect.";
I'm not very good with PHP, I read somewhere that you are supposed to use sessions ?
But its to complicated for me.
Will the web server not handle each connection as its own session.
Whats the chances of a user somehow grab another users content ?