Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
parse error, unexpected T_IS_EQUAL in
Old 08-21-2008, 07:33 AM parse error, unexpected T_IS_EQUAL in
Average Talker

Posts: 18
Name: joseph
Trades: 0
keep getting this error and have no clu as to why. cod copied and pasted from my lecturers example. help much appricated.

<?php
session_start();
ini_set('arg_separator.output',';');
$con = mysql_connect("host","database","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("a6005321", $con);

// process log in form
if (isset($_POST['login'])){
if (!empty($_POST['user'])){
$user = $_POST['user'];
}
if (!empty($_POST['password'])){
$password = $_POST['password'];
}

// query whether there is a user with $usr for username and $pwd for password in the users database
$result = mysql_query("SELECT * FROM users WHERE user = '$user'");
while($row = mysql_fetch_array($result))
{
$password = $row['password'];
$user = $row['user'];
}
if($user){
if($password != 'Password'){
if ( $_POST['password']) == "$password"){ <-----doesnt like ==
$_SESSION['user'] = $_POST['user'];

setcookie("user", $user, time()+3600);
}
}
}
mysql_close($con);
}
// log out
if (isset($_GET['logout'])){
unset($_SESSION['user']);
session_destroy();
setcookie("user", "", time()-3600);
}
?>

Last edited by ajm22386; 08-21-2008 at 07:39 AM..
ajm22386 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-21-2008, 07:58 AM Re: parse error, unexpected T_IS_EQUAL in
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
if ( $_POST['password']) == "$password"){ <-----doesnt like ==
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-21-2008, 08:03 AM Re: parse error, unexpected T_IS_EQUAL in
Average Talker

Posts: 18
Name: joseph
Trades: 0
thank you so much that worked worked
ajm22386 is offline
Reply With Quote
View Public Profile
 
Old 08-21-2008, 08:05 AM Re: parse error, unexpected T_IS_EQUAL in
Average Talker

Posts: 18
Name: joseph
Trades: 0
i think i mite have another for u
ajm22386 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to parse error, unexpected T_IS_EQUAL in
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13183 seconds with 12 queries