Connecting Tech Pros Worldwide Help | Site Map

parse error

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 11:27 AM
new kid
Guest
 
Posts: n/a
Default parse error


hi,

i am new to php programming.i am getting a parse error in
configuratuion file of the web site which i am designing ,i.e(th file
in which u specify the paths to various folders like folder where
uploaded files r stored etc).This is occuring when i click login button
after typing the username and password in the login page. the line of
error is

// Location of files for committee members
$files_members = 'c:\bbn\committee_review\';


the login page is,

<?php

// User Login
include_once('bbn_header.php');

if(!isset($_POST['username']) || !isset($_POST['pass']))
{
include_once('bbn_header.php');
echo "<form enctype=\"application/x-www-form-urlencoded\"
action=\"login.php\" method=\"POST\" name=\"file_form\">\r\n";
echo "<p><b>Username:</b><br>\r\n";
echo "<input type=\"text\" name=\"username\" size=25
maxlength=35>\r\n";
echo "</p>\r\n";

echo "<p><b>Password:</b><br>\r\n";
echo "<input type=\"PASSWORD\" name=\"pass\" size=16
maxlength=16>\r\n";
echo "</p>\r\n";
echo "<input type=\"submit\" name=\"submit\" value=\"Login\">\r\n";
echo "<input type=\"reset\" name=\"clear\" value=\"Clear form\">\r\n";
}
else
{

include_once('includes_path.php');
include_once($bbn_includes_path.'authentication.ph p');

}

include_once('bbn_footer.php');

?>


  #2  
Old July 17th, 2005, 11:27 AM
Ken Robinson
Guest
 
Posts: n/a
Default Re: parse error


new kid wrote (in part):
[color=blue]
> i am new to php programming.i am getting a parse error in
> configuratuion file of the web site which i am designing ,i.e(th file
> in which u specify the paths to various folders like folder where
> uploaded files r stored etc).This is occuring when i click login[/color]
button[color=blue]
> after typing the username and password in the login page. the line of
> error is
>
> // Location of files for committee members
> $files_members = 'c:\bbn\committee_review\';
>[/color]

Can you post the last few lines above the lines you posted? The line
where PHP reported the parse error is just where it finally said to
itself "I can't figure out what I'm supposed to do anymore". Usually a
line or two above, there is a missing closing quote, no semi-colon, a
missing closing ")" or "}".
[color=blue]
>
> the login page is,
>
> <?php
>
> // User Login
> include_once('bbn_header.php');
>
> if(!isset($_POST['username']) || !isset($_POST['pass']))
> {
> include_once('bbn_header.php');
> echo "<form enctype=\"application/x-www-form-urlencoded\"
> action=\"login.php\" method=\"POST\" name=\"file_form\">\r\n";
> echo "<p><b>Username:</b><br>\r\n";
> echo "<input type=\"text\" name=\"username\" size=25
> maxlength=35>\r\n";
> echo "</p>\r\n";
>
> echo "<p><b>Password:</b><br>\r\n";
> echo "<input type=\"PASSWORD\" name=\"pass\" size=16
> maxlength=16>\r\n";
> echo "</p>\r\n";
> echo "<input type=\"submit\" name=\"submit\" value=\"Login\">\r\n";
> echo "<input type=\"reset\" name=\"clear\" value=\"Clear[/color]
form\">\r\n";

A note on your coding style. Your code will be much easier to read if
you use single quotes to enclode strings that include double quotes.
Then you won't have to escape the double quotes. For example, you have:

echo "<form enctype=\"application/x-www-form-urlencoded\"
action=\"login.php\" method=\"POST\" name=\"file_form\">\r\n";

That can be changed to:

echo '<form enctype="application/x-www-form-urlencoded"
action="login.php" method="POST" name="file_form">'."\r\n";

Which is much easier on the eyes. The '\r\n' need to be in double
quotes or they won't be converted to the correct ASCII characters.

Ken

  #3  
Old July 17th, 2005, 11:27 AM
Alvaro G. Vicario
Guest
 
Posts: n/a
Default Re: parse error

*** new kid escribió/wrote (11 Feb 2005 11:15:37 -0800):[color=blue]
> $files_members = 'c:\bbn\committee_review\';[/color]

The back-slash character (\) is a escape character with a special meaning.
For instance, you use it to insert single quotes inside a single quiote
delimited string:

$foo='Patrick O\'Brian';

Got a clue now? :)

http://www.php.net/manual/en/language.types.string.php


--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Manda tus dudas al grupo, no a mi buzón
-+ Send your questions to the group, not to my mailbox
--
 

Bookmarks

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.