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

FTP issues
Hi all,


I am currently facing some serious problems with a script and really need some ad

updating a single value to multiple non consecutive rows
I need to update the same value to multiple non consecutive rows. I need to add an experation date t

ctype() validation - allowing illegal characters
Hello,
I use ctype() to filter and validate a user form. However, I am trying to allow certain c

Career Change into SAP
Hai
I am sajesh ,did my diploma in Mechatronics i have a 4 years of experience in

phph within href not showing php if change ? to &
Code: [Select]<a href="<?php echo $puser; ?>?m=<?php=(($m-1)&l

include problem
I have my root folder as:
Code: $root = $_SERVER["SITE_HTMLROOT"]; // the server root<

mysql_affected_rows() usage
Possibly a MySQL issue, but the function that is not behaving in the anticipated way is a PHP functi

Update data to upper case in parent/child tables
Hi Gurus!

In production we have a product table and which is being reference by many tabl

Pro-rata Billing in Periodic Billing for Rental
Hi guys,

We have a situation, where a rental contract starts at the mid of the month say

ORA-01655: unable to extend cluster SYS.C_FILE#_BLOCK# by 128
Hi all,

Oracle 10g. Linux.

I'm facing the below error while trying to import a dumpfil

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