NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page can someone try and spot an error in this for me please?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 07-04-2003, 02:24 PM THREAD STARTER               #1 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer

can someone try and spot an error in this for me please?


ok creating a user system and ive got the code layed out but it ays this error

Parse error: parse error, unexpected $end in f:binapacheapachehtdocsnew scriptinhuser systemnew folderlogin.php on line 43
so im asuimg ive either missed a $ or a ; somewhere but i cannot see it

line 43 is the last line of code
PHP Code:
<?php
//Check for required feilds from form
if ((!$_POST[username]) || (!$_POST[password])) {
header("Location: login.php");
exit;
}

//connect to server and database
$conn mysql_connect("localhost""adam123""adam123") or die(mysql_error());
mysql_select_db("contentsystem",$conn) or die(mysql_error());
????: NamePros.com http://www.namepros.com/programming/14952-can-someone-try-spot-error-me.html
????: NamePros.com http://www.namepros.com/showthread.php?t=14952

//create and login
$sql "SELECT f_name, l_name FROM auth_users WHERE username = '$_POST[username]' AND password = password('$_POST[password]')";
$result mysql_query($sql,$conn) or die(mysql_error());

//get the number of rows in the rsult set; should be 1 if a match
if (mysql_num_rows($result) == 1) {

//if authorized, get the values of names
$f_name mysql_result($result0'f_name');
$l_name mysql_result($result0'l_name');
    
// Cookie
setcookie("auth""1"0"/""adamuk.serveftp.com"0);

//echo success
$msg "you are logged in";
$msg .= "<a href='secret.php'>secret.php</a>";

} else {
//redirect to login page if auth failed
echo "****";
?>

thanks
adam_uk is offline  
Old 07-04-2003, 03:11 PM   #2 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



PHP Code:
} else {
//redirect to login page if auth failed
????: NamePros.com http://www.namepros.com/showthread.php?t=14952
echo "****";
}
?> 
Try it like that.
deadserious is offline  
Old 07-04-2003, 03:16 PM THREAD STARTER               #3 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
ah yeh that actually is a swear word but it filtered it
adam_uk is offline  
Old 07-04-2003, 03:17 PM THREAD STARTER               #4 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
god im a burk i didnt even see what you added lol
adam_uk is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 04:45 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger