DevilMayCry
03-20-2003, 04:35 PM
Can anyone get me a logging in form?
I need one which if you put in the right information and you click Submit you get redirected to another page. But if you put in the wrong information you get redirected to a page saying something like wrong information entered :)
bejayel
03-20-2003, 06:59 PM
umm you need to have access to cgi or php or somehting along those lines. anyway tons of scripts ehre: http://www.hotscripts.com
Cagez
03-20-2003, 07:38 PM
You don't need cgi or php, you can do it with javascript but it will be very insecure. If you don't have access to cgi or php, then a more secure way to do it with JS is to use a input box for the username and password, then redirect to the users username or something. Still very insecure.
If you do have PHP, a very easy way to do it would be to hard code it right into the script, make a script similar to below:
<?php
// If you want to add more users, copy the line below and just change the username and password (or you can edit the one there already)=
$users[] = array("user"=>"admin", pass=>"pass");
// The page to redirect the user to if successful
$redir_ok = "http://users.mydomain.com/secure/blah.html";
// The page to redirect the user to if unsuccessful
$redir_bad = "http://users.mydomain.com/secure/bad/blah.html";
$ok = 0;
if($_POST['submit']) {
for(i=0; i<= count($users); i++)
{
if($users[i]['user'] = $_POST['user'] && $users[i]['pass'] = $_POST['pass'])
$ok = 1;
}
if($ok >= 1)
header("Location: ".$redir_ok);
else
header("Location: ".$redir_bad);
}
else {
?>
<form action="<?php $PHP_SELF ?>" method="post">
User name: <input type="text" name="user"> <br />
Password: <input type="password" name="pass"> <br />
<input type="submit" name="submit" value="1">
?>
}
I tried to make it as noobie as possible, so if you don't know PHP you will still understand it. It probably has some bugs - give yourself some experience and try to fix them yourslef ;)
bejayel
03-22-2003, 02:00 AM
lol i am a noob to hp as wel. but what i am pretty sure s/he wanted was to have a register/logging in thing. you need to have it make files for you at the same time...hmm take a bit to do it though. and i cant remember off the top of my head. anyway like i said hotscripts.com is loaded with scripts.