Jump to content

[SOLVED] login form


alin19

Recommended Posts

i have this login for:

 

it's from the net

 

 

<html>

<head>

<title>Log-In</title>

 

<style>

h1{font:12pt arial}

h2{font:11pt arial}

</style>

 

</head>

<body>

 

<br>

<center>

<h2>Webmasters feel free to change this log in form/page to suit your needs</h2>

<br>

<br>

<br>

<h1>Log in to my secret page...

<br>

<br>

Example usernames and passwords are:<br>

<br>

<b>

name1 and pass1<br>

name2 and pass2<br>

name3 and pass3<br>

</b>

</h1>

<br>

 

 

<form method="post" action="dataProcess.php">

<p style="font:11pt arial">Enter Name: <input type="text" name="loginName">

<p style="font:11pt arial">Enter Pass:   <input type="password" name="passWord">

<p><input type="submit" name="submit" value="Log In">

</form>

 

 

</body>

</html>

 

 

and this secure page:

 

 

 

<?php

 

// Secure multiple user Log-In script by Dave Lauderdale - Originally published at: www.digi-dl.com

 

$filename = "user.log";

$log = fopen($filename, "r");

$contents = fread($log, filesize($filename));

fclose($log);

 

//  Add usernames below

if ($contents == "name1" || $contents == "name2"  || $contents == "name3")

{

 

$filename = "user.log";

$log = fopen($filename, "w+");

fputs($log,"");

fclose($log);

 

 

here i have a php script

 

 

 

 

}

else

{

echo "<center><Br><font color=red face=arial size=3 >Error</font>...<font face=arial size=3 >You will have to log on via the log on form to view this page.<br><br><a href='login.html' style='color:black'>Click here</a> to try again.";

}

 

?>

 

 

i login, i view the page but when i press a submit button i recive the message that i'm not log in;

 

 

 

and this error

Warning: fread(): Length parameter must be greater than 0. in c:\program files\easyphp1-8\www\ext\secure.php on line 7

 

 

Link to comment
https://forums.phpfreaks.com/topic/89683-solved-login-form/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.