Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

66 users online



login script CAN someone Put This IN IT

login script CAN someone Put This IN IT

Currently viewing this thread: 1 (0 members and 1 guests)


Fresh

Fresh

Web Designer
Status: Offline!

login script CAN someone Put This IN IT

this is my script by Ben (forgot his nick )

PHP:

<?php

// 2nd PAGE IF CONDITION
if(isset($submit)){

//COOKIE VARS
$cookieName "TMD";
$cookieContent "test";
            
//SET COOKIE
setCookie($cookieName$cookieContenttime()+(2592000), '/''fresh.nsmail.com.au/clarion'0);

echo 
"this is the code for the second page";
echo 
"<form name=\"form\" method=\"post\" action=\"login_2.php\"><input type=\"submit\" name=\"submit3\" value=\"logout?\">";
echo 
"<input type=\"checkbox\" name=\"cook2\" value=\"checkbox\">";
echo 
"<a href=Javascript:window.history.go(-1)>Back</a>";
die();
}

//IF DELETE COOKIE CHECKBOX SELECTED THEN EXECUTE CODE TO DELETE IT
if(isset($cook) || isset($cook2)){
$cookieName "TMD";
$cookieContent "test";
setCookie($cookieName$cookieContenttime()-2592000'/''fresh.nsmail.com.au/clarion'0);
die(
"thankyou, the cookie has been deleted<br> please click <a href=\"login_2.php\">here</a>");
}

// IF LOGIN UNSECCESFUL DISPLAY LOGIN ATTEMPTS 
if($user !== $username && $pass !== $password){
$num_tries == 0;
$num_tries++;
print 
'You have tried to login '$num_tries.' times';
print 
"<br><br>"
if(
$num_tries == 4){
die(
"no more tries left sorry");
 }
}
 
$username "visalink";
$password "benny";
$password "benny2";
$password "benny3";
$password "benny4";
 
$var2 == $username "visalink";
$var1 == $password "benny";
$var1 == $password "benny2";

/* for($i = 0; $i<count($users); $i++)

$users =    array(
            '0' => array(
                    'username' => 'test',
                    'password' => '098f6bcd4621d373cade4e832627b4f6'),
            '1' => array(
                    'username' => 'test2',
                    'password' => '098f6bcd4621d373cade4e832627b4f6'),
            '2' => array(
                    'username' => '',
                    'password' => ''),
            '3' => array(
                    'username' => '',
                    'password' => ''),
            '4' => array(
                    'username' => '',
                    'password' => ''), );  */

 
// IF LOGIN SUCCESFUL
if ($user == $username && $pass == $password){

//-- ESTABLISH VARIABLES TO STORE
$cookieName "TMD";
$cookieContent "test";
            
//-- SET COOKIE
setCookie($cookieName$cookieContenttime()+(2592000), '/''tmd.bounceme.net'0);

//-- AFTER SUCCESSFUL LOGIN
echo "Cookie Stored : ".$HTTP_COOKIE_VARS['TMD']."<br>";
echo 
"Hello, feel free to administrate this page"
echo 
"<form name=\"form\" method=\"post\" action=\"$PHP_SELF\"><input type=\"submit\" name=\"submit\" value=\"2nd page\">";

/* if the button just there ^ executes then the variable $page2 will be set and the 
and the code for the 2nd page will be executed no problemo */
die();
 }

?>

<form name="form" method="post" action="<? echo $PHP_SELF ?>">
  <p>
    <input type="text" name="user">
    user<br>
    <input type="password" name="pass">
    pass</p>
  <p> 
    <input type="submit" name="submit2" value="submit">
    <input type="hidden" name="num_tries" value="<? print $num_tries?>">
    <input type="hidden" name="for">
    <input type="checkbox" name="cook" value="checkbox">
    Delete cookie? </p>
</form>


and i would like it to go through a txt file to get the matching password so if it matches 1 inside txt doc let em in here is wat he thought would do it ( in theory )

PHP:

<?php
$fp is the file resource

foreach($fp as $val){

if(
$user == $username && $pass == $val){

print 
"you are logged in because you used one of the many passwords in the text file"; }

?>

___________________

http://www.fweb.ws/images/design/fresh.gif
Fresh Web
Free 5mb Storage

BigToach

BigToach

Neversidian
Status: Offline!

you never make any sense.

___________________

Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0186 seconds.