Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6
This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 24th, 2005, 09:51 PM
Registered User
 
Join Date: Jan 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 5 Parse Error

I am getting a parse error on line 45 of the code below, this is from chapter 5 in the forms examples. Not sure why it loks fine to me, and the error is not giving anything else like what it is expecting which usually happens with parse errors. I have bolded the code which is line 45 that is causing the error. Any help is greatly appreciated, thanks in advance:

<?php
   if ( $_POST['type'] == "Movie:Movie" &&
        $_POST['MovieType'] == ""){
      header("Location:form4.php");
   }
   $title = $_POST['Submit']." ".$_POST['type']." : ".$_POST['Name'];
   $name = $_POST['Name'];
   $name[0] = strtoupper( $name[0]);
?>
<html>
<head>
   <TITLE><?php echo $title?></TITLE>
</head>
<body>
<FORM action="form4.php?step=2" method="post">
   <input type="hidden" name="type" value="<?php echo $type[1]?>">
   <input type="hidden" name="action" value="<?php echo $_POST['Submit']?>">
   <table border=0 width="750" cellspacing=1 cellpadding=3 bgcolor="#353535" align="center">
      <tr>
         <td bgcolor="#ffffff" width="30%">
            Movie Name
         </td>
         <td bgcolor="#ffffff" width="70%">
            <?php echo $name?>
            <input type="hidden" name="Name" value="<?php echo $name?>">
         </td>
      </tr>
      <tr>
         <td bgcolor="#ffffff">
            Movie Type
         </td>
         <td bgcolor="#ffffff">
            <?php echo $_POST['MovieType']?><br />
            <input type="hidden" name="type" value="Movie: <?php echo $_POST['MovieType']?>">
         </td>
      </tr>
      <tr>
         <td bgcolor="#ffffff">
            Movie Year
         </td>
         <td bgcolor="#ffffff">
            <SELECT name="MovieYear">
               <option value="" SELECTED>Select a year...</option>
<?php
for ($year=date("Y"); $year >= 1970 ;$year--){
?>
<option value="<?php echo $year?>"><?php echo $year?></option>
<?php
}
?>
            </SELECT>
         </td>
      </tr>
      <tr>
         <td bgcolor="#ffffff">
            Movie Description
         </td>
         <td bgcolor="#ffffff">
            <textarea name="Desc" rows="5" cols="60"></textarea>
         </td>
      </tr>
      <tr>
         <td bgcolor="#ffffff" colspan=2 align="center">
            <INPUT type="SUBMIT" name="SUBMIT" value="Add">
         </td>
      </tr>
   </table>
</FORM>
</body>
</html>

razorack
  #2 (permalink)  
Old February 6th, 2005, 10:34 AM
Registered User
 
Join Date: Nov 2004
Location: Rochester, Kent, United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm getting the same error.

However in my case I only have the 1 '-' {ie $year- } wheras above you seem to have 2
  #3 (permalink)  
Old February 6th, 2005, 10:43 AM
Registered User
 
Join Date: Nov 2004
Location: Rochester, Kent, United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just solved my problem, which was the single - so mine now works and as far as I can tell is exactly the same as yours.

Which admittedly is not a lot of help, sorry.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 4: Parse error: syntax error, unexpected T_SL hanizar77 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 June 23rd, 2008 09:17 PM
PHP Parse error: parse error, unexpected T_STRING geminient PHP How-To 4 August 18th, 2007 02:27 AM
Parse error: parse error, unexpected $end Ayodeji Adegbaju Pro PHP 3 January 12th, 2007 12:21 PM
Chapter 2 {curly bracket} parse error of DEATH psychot BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 3 August 5th, 2005 03:36 PM
Parse error in error handler (Chapter 8) Funky Monk BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 August 6th, 2004 08:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.