p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: impossible parse error on if statement


Message #1 by "Lawrence" <lkrubner@g...> on Thu, 14 Feb 2002 06:03:38
I'm getting a the following parse error on the following block of code. 

The parse error can't be right. Line 9 is pretty straightforward. What 

gives? 







Parse error: parse error, expecting `'('' 

in /www/krubner/lr_controlPanel.php on line 9







<?php 

// make sure this file path is correct in these include statements

// for nothing will work if the control panel can not find these files. 

include ("lr_config.php") ;

include ("lr_functionsFile.php") ;

//

// this tests to see if the variable $passwordLr is set. If it isn't, the 

include

// address for lr_config.php is probably wrong, or the file has been 

overwritten

if !($passwordLr) {

echo "The file config.php could not be found or it has been damaged. 

Please check all include path addresses in the file lr_controPanel.php." ;

} else {

//

// this registers $passwordSubmit so the user doesn't have to log in 

everytime

// they commit an action

session_register ("passwordSubmit") ;



// check to see if the user is logged in, if not, ask them to log in

if ($passwordSubmit != $passwordLr){

session_unregister ("passwordSubmit") ;

echo "<form method=\"post\" action=\"$PHP_SELF\">

Please type in the correct password:<br>

<input type=\"password\" name=\"passwordSubmit\"><br>

<input type=\"submit\">

</form>" ;

} else {

Message #2 by "The Veales" <bveale@t...> on Wed, 13 Feb 2002 23:09:33 -0700
Well Lawrence, I'm a rookie at this but I'll give it a shot.

Could line 9 work this way:

if (!($passwordLr)) {

Let me know if that works or not. It'll help me out in my learning of this

stuff.



Bob



----- Original Message -----

From: "Lawrence" <lkrubner@g...>

To: "beginning php" <beginning_php@p...>

Sent: Thursday, February 14, 2002 6:03 AM

Subject: [beginning_php] impossible parse error on if statement





> I'm getting a the following parse error on the following block of code.

> The parse error can't be right. Line 9 is pretty straightforward. What

> gives?

>

>

>

> Parse error: parse error, expecting `'(''

> in /www/krubner/lr_controlPanel.php on line 9

>

>

>

> <?php

> // make sure this file path is correct in these include statements

> // for nothing will work if the control panel can not find these files.

> include ("lr_config.php") ;

> include ("lr_functionsFile.php") ;

> //

> // this tests to see if the variable $passwordLr is set. If it isn't, the

> include

> // address for lr_config.php is probably wrong, or the file has been

> overwritten

> if !($passwordLr) {

> echo "The file config.php could not be found or it has been damaged.

> Please check all include path addresses in the file lr_controPanel.php." ;

> } else {

> //

> // this registers $passwordSubmit so the user doesn't have to log in

> everytime

> // they commit an action

> session_register ("passwordSubmit") ;

>

> // check to see if the user is logged in, if not, ask them to log in

> if ($passwordSubmit != $passwordLr){

> session_unregister ("passwordSubmit") ;

> echo "<form method=\"post\" action=\"$PHP_SELF\">

> Please type in the correct password:<br>

> <input type=\"password\" name=\"passwordSubmit\"><br>

> <input type=\"submit\">

> </form>" ;

> } else {

>




$subst('Email.Unsub').

>



Message #3 by "Nikolai Devereaux" <yomama@u...> on Wed, 13 Feb 2002 22:19:52 -0800

You're right, but you're overdoing it.



if(!$passwordLr) should be sufficient.



-----Original Message-----

From: The Veales [mailto:bveale@t...]

Sent: Wednesday, February 13, 2002 10:10 PM

To: beginning php

Subject: [beginning_php] Re: impossible parse error on if statement





Well Lawrence, I'm a rookie at this but I'll give it a shot.

Could line 9 work this way:

if (!($passwordLr)) {

Let me know if that works or not. It'll help me out in my learning of this

stuff.



Bob



----- Original Message -----

From: "Lawrence" <lkrubner@g...>

To: "beginning php" <beginning_php@p...>

Sent: Thursday, February 14, 2002 6:03 AM

Subject: [beginning_php] impossible parse error on if statement





> I'm getting a the following parse error on the following block of code.

> The parse error can't be right. Line 9 is pretty straightforward. What

> gives?

>

>

>

> Parse error: parse error, expecting `'(''

> in /www/krubner/lr_controlPanel.php on line 9

>

>

>

> <?php

> // make sure this file path is correct in these include statements

> // for nothing will work if the control panel can not find these files.

> include ("lr_config.php") ;

> include ("lr_functionsFile.php") ;

> //

> // this tests to see if the variable $passwordLr is set. If it isn't, the

> include

> // address for lr_config.php is probably wrong, or the file has been

> overwritten

> if !($passwordLr) {

> echo "The file config.php could not be found or it has been damaged.

> Please check all include path addresses in the file lr_controPanel.php." ;

> } else {

> //

> // this registers $passwordSubmit so the user doesn't have to log in

> everytime

> // they commit an action

> session_register ("passwordSubmit") ;

>

> // check to see if the user is logged in, if not, ask them to log in

> if ($passwordSubmit != $passwordLr){

> session_unregister ("passwordSubmit") ;

> echo "<form method=\"post\" action=\"$PHP_SELF\">

> Please type in the correct password:<br>

> <input type=\"password\" name=\"passwordSubmit\"><br>

> <input type=\"submit\">

> </form>" ;

> } else {

>




$subst('Email.Unsub').

>








$subst('Email.Unsub').



Message #4 by "The Veales" <bveale@t...> on Wed, 13 Feb 2002 23:23:48 -0700
Ya, that does make it easier to read, doesn't it.

Thanks

Bob

----- Original Message -----

From: "Nikolai Devereaux" <yomama@u...>

To: "beginning php" <beginning_php@p...>

Sent: Wednesday, February 13, 2002 11:19 PM

Subject: [beginning_php] Re: impossible parse error on if statement





>

> You're right, but you're overdoing it.

>

> if(!$passwordLr) should be sufficient.

>

> -----Original Message-----

> From: The Veales [mailto:bveale@t...]

> Sent: Wednesday, February 13, 2002 10:10 PM

> To: beginning php

> Subject: [beginning_php] Re: impossible parse error on if statement

>

>

> Well Lawrence, I'm a rookie at this but I'll give it a shot.

> Could line 9 work this way:

> if (!($passwordLr)) {

> Let me know if that works or not. It'll help me out in my learning of this

> stuff.

>

> Bob

>

> ----- Original Message -----

> From: "Lawrence" <lkrubner@g...>

> To: "beginning php" <beginning_php@p...>

> Sent: Thursday, February 14, 2002 6:03 AM

> Subject: [beginning_php] impossible parse error on if statement

>

>

> > I'm getting a the following parse error on the following block of code.

> > The parse error can't be right. Line 9 is pretty straightforward. What

> > gives?

> >

> >

> >

> > Parse error: parse error, expecting `'(''

> > in /www/krubner/lr_controlPanel.php on line 9

> >

> >

> >

> > <?php

> > // make sure this file path is correct in these include statements

> > // for nothing will work if the control panel can not find these files.

> > include ("lr_config.php") ;

> > include ("lr_functionsFile.php") ;

> > //

> > // this tests to see if the variable $passwordLr is set. If it isn't,

the

> > include

> > // address for lr_config.php is probably wrong, or the file has been

> > overwritten

> > if !($passwordLr) {

> > echo "The file config.php could not be found or it has been damaged.

> > Please check all include path addresses in the file lr_controPanel.php."

;

> > } else {

> > //

> > // this registers $passwordSubmit so the user doesn't have to log in

> > everytime

> > // they commit an action

> > session_register ("passwordSubmit") ;

> >

> > // check to see if the user is logged in, if not, ask them to log in

> > if ($passwordSubmit != $passwordLr){

> > session_unregister ("passwordSubmit") ;

> > echo "<form method=\"post\" action=\"$PHP_SELF\">

> > Please type in the correct password:<br>

> > <input type=\"password\" name=\"passwordSubmit\"><br>

> > <input type=\"submit\">

> > </form>" ;

> > } else {

> >




> $subst('Email.Unsub').

> >

>

>




> $subst('Email.Unsub').

>

>




$subst('Email.Unsub').

>




  Return to Index