Login Issue's


Posted on 16th Feb 2014 07:03 pm by admin

Code: <?php
$file = fopen('user.txt', 'r');

/* Set login to false initially */
Did you know?Explore Trending and Topic pages for more stories like this.
$login = false

/* Break out of loop if login becomes true OR EOF is encountered */
while(($login == false) && (!eof($file)))
{
$data = explode(":", fgets($file));

/* assume field 0 is username, field 1 is password */
if( ($data['0'] == $username) && ($data['1'] == $password)
{
/* login is true, so will break out of loop after this iteration */
$login = true;
}
}
if $login = true
{
echo 'hi there user';
} else {echo 'nope';}
fclose($file);

?>
<html>
<body>
<form action="login4.php" method="post">
<ul>
<li><label for="username">
USERNAME: </label><input type="text"
name="username" id="username"/></li>
<li><label for="password">
PASSWORD: </label><input type="password"
name="password" id="password"/></li>
</ul>
<input name="login" type="submit" value="Login"/
</form>
</body>
</html>
Parse error: syntax error, unexpected T_WHILE in C:xampplitehtdocslogin testslogin4.php on line 8

having trouble writing a login script that uses .txt files.
No comments posted yet

Your Answer:

Login to answer
313 Like 30 Dislike
Previous forums Next forums
Other forums

blank page.... nothing is happening.
I'm new to a lot of this but in the last 24hrs have learned a lot.
Installed latest version of my

Problem related to Creation of PDF File?
Hi All,
I am facing a problem related to creation pdf file. when I am creating a pdf file of do

Export hangs
Hi all, please help

I have a Oracle 10.2.0.3.0 database. When I want to query the dba_segmen

SuperCali PHP Event Calendar
does anyone have any experience with the SuperCali PHP Event Calendar? I could use some assistance

Comparing Values
Hi
I'm reading data from a database and this seems to work OK.

Each system has an associat

Big O & time complexity ???
can you help me how to calculate the Big O & time complexity for any algorithm and c++ program pleas

Sort Alternative/bi-monthly
Hi all,

Am going mad trying to get something to work.

I'm creating a CMS for a magazi

how to transport the Query and insfoset
Hi

I have created the query using SQ01........
How to created T-code for query..

Clean URLs
Hi I was wandering if anyone has ever implemented URLs on their PHP run website using URLS like wiki

Array question
Does anyone know how to create a program that takes the $ amount for 8 different departments and gi

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash