Heey allemaal!
Ik heb net een loginsysteempje gemaakt, en dat werkt allemaal.
Alleen wil ik dat als je correcte gegevens hebt ingevuld dat ie dan een sessie of cookie aanmaakt, alleen heb ik geen idee hoe ik dat moet doen.
Dit is mijn code (werkt):
Gebr.naam= test
Pass = demo
Alvast bedankt,
Jos
Ik heb net een loginsysteempje gemaakt, en dat werkt allemaal.
Alleen wil ik dat als je correcte gegevens hebt ingevuld dat ie dan een sessie of cookie aanmaakt, alleen heb ik geen idee hoe ik dat moet doen.

Dit is mijn code (werkt):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Inloggen</title>
</head>
<body>
[COLOR= #0000BB]<?php
$gebruiker[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$wachtwoord[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$gebruiker[/COLOR] [COLOR= #007700]===[/COLOR] test [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$wachtwoord[/COLOR] [COLOR= #007700]===[/COLOR] demo[COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<font color="#009900">Je bent succesvol ingelogd!</font>[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$gebruiker[/COLOR] [COLOR= #007700]!==[/COLOR] [COLOR= #0000BB]$wachtwoord[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<font color="#FF0000">De ingevulde gegevens zijn niet correct.</font>[/COLOR][COLOR= #007700];
}[/COLOR]
?>
<form action="" method="post">
<table border="0">
<tr>
<td><input type="text" name="naam" value="Gebruikersnaam" size="20px"></td>
</tr>
<tr>
<td><input type="password" name="pass" value="Wachtwoord" size="20px"></td>
</tr>
<tr>
<td><input type="submit" name="inloggen" value="Inloggen"></td>
</tr>
</table>
</form>
</body>
</html> Gebr.naam= test
Pass = demo
Alvast bedankt,
Jos



