Wrox Programmer Forums
|
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
 
Old July 24th, 2007, 10:52 AM
Registered User
 
Join Date: May 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default CH2 p54-55 parse error.

I've been racking my little brain on this one. I know that a parse error is generally a sytnax error (missed ; or ") but i can't find the problem.

Here is my code
Quote:
quote: <?php
session_start();
$_SESSION['username'] =$_POST['user'];
$_SESSION['userpass'] =$_POST['pass'];
$_SESSION['authuser'] = 0;

//Check username and password information
if (($_SESSION['username'] =='Joe') and
    ($_SESSION['userpass'] =='12345')) {
 $_SESSION['authuser'] =1;
 } else {
     echo "Sorry , but you don't have permission to view this page!";
    exit();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Find my Favourite Movie!</title>
</head>

<body>
<?php
$myfavmovie = urlencode('Life of Brian');
echo "<a href='moviesite.php?favmovie=$myfavmovie'>";
echo "Click here to see information about my favourite movie!";
echo "</a>";
?>
</body>
</html>
which is giving me the following error

Quote:
quote:Parse error: parse error, unexpected $ in /home/../php/ch2/movie1.php on line 31
Line 31 is /html so the error is before this.

Could somebody look at it and tell me where i've gone wrong.
Thanks

 
Old July 25th, 2007, 11:16 AM
Registered User
 
Join Date: May 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Never mind found the error.

had missed a )






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
apache 2.0.55 / PHP 5.1.1 - error in variables srama PHP How-To 0 December 9th, 2005 12:55 PM





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