Hi,
Yes you maybe are correct but if he's on Windows and using IIS then he has already got MSAccess support. He now just need an mdb file with desired fields. But anyways its his choice.
Thanks.
Printable View
Hi,
Yes you maybe are correct but if he's on Windows and using IIS then he has already got MSAccess support. He now just need an mdb file with desired fields. But anyways its his choice.
Thanks.
in my first post i thought that MySQL was only avalible on linux or whatever but now i have MySQL on my windows server and now would like to have a login page with or without mysql
i cant get mysql to work at all now so how do you make a login page that uses a text document? can the user change the password for only there user account?
Hi,
Why not use asp and access ?
Thanks
because i dont know much asp.
Hi,
Its been very long so here it is: The script looks for data in users.txt file in the following format:
This is the script. Hope this will help you.Quote:
someuser, somepass
someuser1, somepass1
someuser2, somepass2
someuser3, somepass3
someuser4, somepass4
ThanksPHP Code:<?php
$handle = fopen("users.txt", "r");
// Get username and password
$username = $_POST["username"];
$password = $_POST["password"];
while (!feof($handle))
{
$buffer = fgets($handle);
if ($buffer == $username . ", " . $password)
{
// If username and password matches then
// set username in session variable for later use,
// redirect the user to manage.php or where ever you
// like, close the users.txt file and exit the script
// so it does not keeps executing.
$_SESSION["isLogged"] = "Y";
$_SESSION["username"] = $username;
header ("Location: manage.php");
fclose($handle);
exit();
}
// If loop is over and username and password did'nt matched then
// we show the invalid login message, reset session variables for
// tight security and close file exit the script.
$_SESSION["isLogged"] = "Y";
$_SESSION["username"] = $username;
}
fclose($handle);
?>
i tried your code and made a page with a form with three things on it. a text box called password, a text box called username and a button names submit.
this is the code:
and textlogin.php is your code. according to the comments it is ment to forward to manage.php but it does not for some reason.i have made a simple script that prints a few words onto the page but it does not forward.HTML Code:<html>
<head>
<title>Dan's Web Server 2005!</title>
</head>
<body>
<form name="input" action="textlogin.php"
method="post">
Username:
<input type="text" name="username">
<br>
Password:
<input type="password" name="password">
<input type="submit" value="Login">
</form>
</body>
</html>