parse error

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


        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,


// User Login

if(!isset($_POST['username']) || !isset($_POST['pass']))
    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
    echo "</p>\r\n";

    echo "<p><b>Password:</b><br>\r\n";
    echo "<input type=\"PASSWORD\" name=\"pass\" size=16
    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";




Re: parse error

new kid wrote (in part):

Quoted text here. Click to load it

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 "}".

Quoted text here. Click to load it

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.


Re: parse error

*** new kid escribió/wrote (11 Feb 2005 11:15:37 -0800):
Quoted text here. Click to load it

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? :)

-+ Álvaro G. Vicario - Burgos, Spain
+- (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

Site Timeline