Click to See Complete Forum and Search --> : login script


rachyrach
06-21-2005, 06:17 PM
I was wondering if anyone could tell me what script this guy is using for his login/profile system www.camgirlshide.com
Thanks!

LiLcRaZyFuZzY
06-22-2005, 03:11 AM
dunno, the most standard login script would be to add username/password to a database when users register and then to check them when they try to login

rachyrach
06-22-2005, 09:41 AM
well this one the users dont register. they have to fill out a form requesting username/PW and if the webmaster accepts then he creates a a password for them and sends them an email with their new username/pw. also on the page that shows his girls your able to see which ones are logged in etc.. anyone might know what exactly or something simular that hes using ? i have looked at scripts at like hotscripts.com and noticed some dont even require mySQL. does this guys script ?

ffurnai
06-22-2005, 09:51 AM
Here are two tutorials for membership/login systems using PHP. I can't remember which one I used but this site has great tutorials.

I believe that I used the second one. It uses MySQL for the backend, though. I think the other one does too . . .

http://www.phpfreaks.com/tutorial_cat/7/Membership-Systems.php

scragar
06-22-2005, 09:51 AM
I think if he doesn't use a db it's all hand coded, something like:
<?
$users = ["bob", "admin"];
$passes = ["obo", "de boss"];
if(isset($_POST['login'])){
for($i = 0; $i < count($users); $i++){
if(strtolower($_POST['username']) == $users[$i] && strtolower($_POST['password']) == $passes[$i]){
$_SESSION['login'] = $i;
};
};
if(isset($_SESSION['login'])){
echo "your now logged in.";
}else{
echo "please try again.";
};
};
?><form action="?" method="post">
username: <input type="text" name="username" value="<?=$_POST['username'];?>"><br>
password: <input type="password" name="password" value=""><br>
<input type="submit" value="login" name="login">
</form>

ffurnai
06-22-2005, 09:56 AM
You'll probably want to put something like this:

<?php

session_start();

if (!isset($_SESSION['login'])) {
Header( "Location: http://mydomain.com/index.php" );
exit;
}

?>
in your subpages.

so that you can't get to the other parts of the site without logging in.

That's assuming you set a session variable upon logging in . . .

rachyrach
06-24-2005, 12:44 AM
scragar, i copy n pasted your script and i get a "Parse error: parse error, unexpected '[' in /public_html/testing.php on line 17
"
whats wrong ?

scragar
06-29-2005, 08:14 AM
sorry, I mixed up bit's of PHP and javascript again:
<?


$users = array("bob", "admin");
$passes = array("obo", "de boss");


if(isset($_POST['login'])){
for($i = 0; $i < count($users); $i++){
if(strtolower($_POST['username']) == $users[$i] && strtolower($_POST['password']) == $passes[$i]){
$_SESSION['login'] = $i;
};
};
if(isset($_SESSION['login'])){
echo "your now logged in.";
}else{
echo "please try again.";
};
};
?><form action="?" method="post">
username: <input type="text" name="username" value="<?=$_POST['username'];?>"><br>
password: <input type="password" name="password" value=""><br>
<input type="submit" value="login" name="login">
</form>

camgirlshide
07-10-2005, 09:14 AM
Just wondering why it is you want to copy my work without my permission?

Mike
webmaster
www.camgirlshide.com (http://www.camgirlshide.com)

Sanim
07-10-2005, 09:23 AM
Copy your work!? I think he just wanted to have a login script, or wouldn't you have known that if you'd read the post(s)?

SpectreReturns
07-10-2005, 05:03 PM
Just wondering why it is you want to copy my work without my permission?

A) It's not your work if he makes it make it himself (or with help from us)
B) He doesn't need your permission if he makes it himself
C) It's near impossible without your server information to actually steal it

BeachSide
07-12-2005, 05:22 AM
Just wondering why it is you want to copy my work without my permission?

Mike
webmaster
www.camgirlshide.com (http://www.camgirlshide.com)

And here I've always thought that imitation was the greatest form of flattery :rolleyes: