FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Php login





shadowozera
Hello everyone, i am creating a php login syntax and seem to have hit a snag.

When a user clicks the login button, an error occurs saying
"
Parse error: syntax error, unexpected ';' in /home/shadowoz/domains/justthink.frihost.org/public_html/login.php on line 6"

Now i have tried deleting that, but that just leads to more errors.

What have i done wrong?

The syntax:
Code:
<?php
$_username = $_POST['Username'];
 $_password = $_POST['Password'];
if(username&&password){

$connect = mysql_connect("localhost","shadowoz_shadow","" or die("Sorry, there was an error. Please try again later.");
mysql_select_db("shadowoz_shadow") or die("Could not locate db.");

}
else
die("Please enter a Username and Password."); ?>
kacsababa
The mysql_connect() is not closed after the empty $password string.
shadowozera
Well, it kinda works. However there is no message saying that there is an error.

Why D=
shadowozera
kacsababa wrote:
The mysql_connect() is not closed after the empty $password string.



and actually i don't know what you mean by its not closed.
rjraaz
shadowozera wrote:
kacsababa wrote:
The mysql_connect() is not closed after the empty $password string.



and actually i don't know what you mean by its not closed.


You should have to change

Code:

$connect = mysql_connect("localhost","shadowoz_shadow","" or die("Sorry, there was an error. Please try again later.");


To

Code:
$connect = mysql_connect("localhost","shadowoz_shadow","") or die("Sorry, there was an error. Please try again later.");
Related topics
php login module
PHP login/logout problem
PHP Login Problem
php+mysql password / login screen
php login (with flash)
my first php login w/o database
Flex + PHP login
MSN network php login?
Frih$ on offer for PHP Login System
PHP login script problem
Free php script login / register , GREAT!
PHP Login Sessions & Security with Frihost
Simple PHP Login Script
PHP Login-Script (With Sessions)
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.