Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Alright, so I am currently in the process of developing my website, and am trying to create a login script.
I don't have full understanding of php yet, so forgive me if I made a really stupid mistake.
<?php if( file_exists("webusers/".$_GET['username']) ) { $content = file("webusers/".$_GET['username'],"r"); if($content[0]==$_GET['password']) { setcookie("randomhomepage.com",$_GET['username'],time()+(60*60*60)); $loggedin=true; } } ?> <!-- apply div settings for login result window --> <style type="text/css"> .loginresult { position:absolute; left:0%; top:0%; width:100%; height:100%; background-color: #ffffff; } </style> <html> <div class="loginresult"> <?php if( $loggedin ) { echo "<center>You have successfully logged in</center>"; } else { echo "<center>Login attempt unsuccessful</center>"; } ?> <center><u><a href="randomhomepage.com" ?>Click here to return to the home page</a></u></center> </div> </html>I get a parse error on line 3. Could someone please tell me what is the cause of this?

Go read the manual about file() :D
http://php.net/manual/en/function.f...
... removing ,"r" should do the trick.
---
Fubar

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |