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
Old 12-14-2009, 05:37 PM php syntax bothers
Junior Talker

Posts: 4
Name: alan byrne
Trades: 0
hey .. im trying to write a login script and keep receiving this :
Parse error: syntax error, unexpected T_STRING, expecting ']' in /home/a3866796/public_html/logins.php on line [B]37 error

ive proof read that part of the script and cant see whats gone wrong any help appreciated
PHP Code:
if($result){
}
else {
$error_message "Error Logging On";
}
if (
$num_rows 0) {
session_start();
$_SESSION['login']] = "1";
header ("Location: Index.htm");
}
else {
    
$error_message="Invalid Login";
    
session_start();
    
$_SESSION['login'] = ";    <<< line 37

    
$error_message = "Invalid Logon"; 

Last edited by chrishirst; 12-14-2009 at 05:41 PM..
AlanB09 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-14-2009, 05:40 PM Re: php syntax bothers
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
$_SESSION['login']] = "1";
__________________
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 12-14-2009, 05:45 PM Re: php syntax bothers
Junior Talker

Posts: 4
Name: alan byrne
Trades: 0
thanks .. but still nop it hasnt sorted it , same error message
AlanB09 is offline
Reply With Quote
View Public Profile
 
Old 12-14-2009, 05:47 PM Re: php syntax bothers
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
And the rest of the script would be?
__________________
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 12-14-2009, 05:48 PM Re: php syntax bothers
Junior Talker

Posts: 4
Name: alan byrne
Trades: 0
sorry lol okay :

PHP Code:
<?php

$uname
=$_POST['Username'];
$pass $_POST['password;]:

$uname = htmlspecialchars($uname);
$pass= htmlspecialchars($pass);

$username = "edited";
$password = "edited";
$database = "userlists";
$server = "msql7.000webhost.com"

$db_handle= mysql_select($server, $username, $password);
$db_found=($database, $db_handle;

if $db_found;
}
else {
 $error_message =" Error Logging On";
}

$uname = quote_smart($uname, $db_handle);
$pword = quote_smart($pass, $db_handle);

$SQL = "SELECT * FROM userlist WHERE username = $uname AND password = $pass";
  
$result = mysql_query($SQL) or die(mysql_error()); 

if($result){
}
else {
$error_message = "Error Logging On";
}
if ($result) {
            if ($num_rows > 0) {
                session_start();
                $_SESSION['
login'] = "1";
                header ("Location: index.htm");
            }
            else {
else {
    $error_message="Invalid Login";
    session_start();
    $_SESSION['
login'] = ";

    $error_message = "Invalid Logon";


if($_SERVER['
REQUEST_METHOD'] == 'POST']{

}
}
<?

Last edited by chrishirst; 12-14-2009 at 05:54 PM..
AlanB09 is offline
Reply With Quote
View Public Profile
 
Old 12-14-2009, 05:56 PM Re: php syntax bothers
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
spotted the missing ' yet?
__________________
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 12-14-2009, 05:57 PM Re: php syntax bothers
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
oh and the ":" instead of ";"?
__________________
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 12-14-2009, 06:00 PM Re: php syntax bothers
Junior Talker

Posts: 4
Name: alan byrne
Trades: 0
found a few problems with it lol !! including the ";" at password and the <? instead of ?> at the end lol but i dont see the ":" ... the only instance of that is at the header :S... i know i seem like a fool lol but this is my first attempt at a big(ish) script lol

**edit** haha never mind, right beside it!! ** how embarassed am i
AlanB09 is offline
Reply With Quote
View Public Profile
 
Old 12-14-2009, 06:02 PM Re: php syntax bothers
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
$_POST['password;]:
__________________
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 12-15-2009, 03:48 PM Re: php syntax bothers
Physicsguy's Avatar
404 - Title not found

Posts: 920
Name: Scott Kaye
Location: Ontario
Trades: 0
PHP Code:
 <?php

$uname
=$_POST['Username'];
$pass $_POST['password'];

$uname htmlspecialchars($uname);
$passhtmlspecialchars($pass);

$username "edited";
$password "edited";
$database "userlists";
$server "msql7.000webhost.com";

$db_handlemysql_select($server$username$password);
$db_found=($database$db_handle;

if 
$db_found;
}
else {
 
$error_message =" Error Logging On";
}

$uname quote_smart($uname$db_handle);
$pword quote_smart($pass$db_handle);

$SQL "SELECT * FROM userlist WHERE username = $uname AND password = $pass";
  
$result mysql_query($SQL) or die(mysql_error()); 

if(
$result){
}
else {
$error_message "Error Logging On";
}
if (
$result) {
            if (
$num_rows 0) {
                
session_start();
                
$_SESSION['login'] = "1";
                
header ("Location: index.htm");
            }
            else {
else {
    
$error_message="Invalid Login";
    
session_start();
    
$_SESSION['login'] = "";

    
$error_message "Invalid Logon";


if(
$_SERVER['REQUEST_METHOD'] == 'POST']{

}
}
?>
Try that...?
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to php syntax bothers
 

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.29431 seconds with 12 queries