Jump to content

[SOLVED] perplexing parsing error applying a "for Dummies" script


argan328

Recommended Posts

Hi

 

I cannot figure out why I am getting the following error when I apply the login application from Janet Valade's PHP & MySQL Everyday Apps for Dummies:

 

Parse error: parse error, unexpected '{' in /home/content/x/x/x/xxxx/html/user_login/login-OO.php on line 16

 

Here is the first 30 or so lines from the script:

 

<?php

/* Program:  Login-OO.php

  * Desc:    User Login Application script. The program

  *          displays the Login Web page. New customer

  *          registration information is validated and

  *          stored in a database. Existing customers'

  *          passwords are compared to valid passwords.

  */

require_once("WebForm.class");                            #9

require_once("Account.class");

require_once("Database.class");

require_once("Session.class");

require_once("Email.class");

 

try                                                      #15

{

  $form =

    new WebForm("double_form.inc","fields_login.inc",$_POST);

}

catch(Exception $e)

{

  echo $e->getMessage();

  exit();

}

//First time form is displayed. Form is blank. //

if (!isset($_POST['Button']))                            #26

{

  $form->displayForm();

  exit();

}

 

It seems like it would be so simple but have spend many hours and I can't figure it out- Please help me understand why PHP has a problem with that first curly bracket on line 16!  Thanks!! ???

 

Argan

Link to comment
Share on other sites

I tried it monk.e.boy but still am getting the same error:

 

 

Parse error: parse error, unexpected '{' in /home/content/x/x/x/xxxxx/html/user_login/login-OO.php on line 16

 

Even when I comment out all of them like below:

 

<?php

/* Program:  Login-OO.php

  * Desc:    User Login Application script. The program

  *          displays the Login Web page. New customer

  *          registration information is validated and

  *          stored in a database. Existing customers'

  *          passwords are compared to valid passwords.

  */

//require_once("WebForm.class");                            #9

//require_once("Account.class");

//require_once("Database.class");

//require_once("Session.class");

//require_once("Email.class");

 

try                                                      #15

{

    $form =

    new WebForm("double_form.inc","fields_login.inc",$_POST);

}

catch(Exception $e)

{

  echo $e->getMessage();

  exit();

}

//First time form is displayed. Form is blank. //

if (!isset($_POST['Button']))                            #26

{

  $form->displayForm();

  exit();

 

Am I doing it wrong?  Any other ideas?

Link to comment
Share on other sites

well is starts by saying: "PHP 5 has an exception model similar to that of other programming languages."  If I'm running 4.3.11 I guess the error would make sense now.  Forgive me for throwing out a newbie question but if my host (godaddy) says they support 4.3.11 and 5.1.4 how do I upgrade so that when I call

 

<?php

phpinfo();

?>

 

it says 5.1.4 at the top instead of the 4.3.11 I'm getting now?

Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.