473,408 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

help with T_IF error

I have checked this stuff six ways from Sunday and can not find an error....can anyone help? My error message is this:
Parse error: syntax error, unexpected T_IF in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\moviesite.php on line 14


Expand|Select|Wrap|Line Numbers
  1. <?php
  2. session_start();
  3.  
  4. //check to see if user has logged in with a valid password
  5. if ($_SESSION['authuser'] != 1) {
  6.     echo 'Sorry, but you don\'t have permission to view this page!';
  7.     exit();
  8. }
  9. ?>
  10. <html>
  11.  <head>
  12.   <title>
  13.  <?php>
  14.  if (isset($_GET['favmovie'])) {
  15.     echo ' - ';
  16.     echo $_GET['favmovie'];
  17.  }
  18. ?>
  19.   </title>
  20.  </head>
  21. <body>
  22. <?php include 'header.php'; ?>
  23. <?php
  24.   function listmovies_1() {
  25.     echo '1. Sound of Music<br/>';
  26.     echo '2. Wizard of Oz<br/>';
  27.     echo '3. Lord of the Rings Trilogy<br/>';
  28.     echo '4. Ten Commandments<br/>';
  29.     echo '5. Star Wars<br/>';
Jan 29 '10 #1

✓ answered by dlite922

Your second opening tag for php is <?php> instead of <?php

BTW: use code tags, please.




Dan

5 2899
dlite922
1,584 Expert 1GB
Your second opening tag for php is <?php> instead of <?php

BTW: use code tags, please.




Dan
Jan 29 '10 #2
dlite922
1,584 Expert 1GB
and I hope you have more to your file than what you pasted, because your listmovies_() function is not closed with a closing curly braces.





Dan
Jan 29 '10 #3
OMG!!! what a little thing....I have taught myself to make sure everything is inside <> and then I added one too many when not needed......code works perfect now. Yes there is more to it and it closes itself. Thanks for the feedback. And I am going to watch much more closely. Thanks again
Jan 29 '10 #4
thought about that after I posted...thanks
Jan 29 '10 #5
dlite922
1,584 Expert 1GB
If you get a PHP editor it usually flags it for you. I know what your error meant when I first saw it, but I'm lazy I did not go through it character by character to see where you missed it. I pasted it into my IDE (NuSphere PHPED), and it underlined the problem in red immediately.

Not all PHP editors have syntax checkers like this, but it really helps you time and frustration wise in the long run if you get one that does.



Dan
Feb 1 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: James Campbell | last post by:
ok, I am totally new to php and come from an asp background. I basically want to do an If > then > else > end if statement: my page is: <?php require_once('Connections/carresa.php'); ?>...
6
by: wukexin | last post by:
Help me, good men. I find mang books that introduce bit "mang header files",they talk too bit,in fact it is my too fool, I don't learn it, I have do a test program, but I have no correct doing...
5
by: xuatla | last post by:
Hi, I encountered the following compile error of c++ and hope to get your help. test2.cpp: In member function `CTest CTest::operator+=(CTest&)': test2.cpp:79: error: no match for 'operator='...
9
by: YZK | last post by:
Hello. I'm not a Web developer, just a user, and I think I may have somehow messed myself up majorly. I'm not quite sure how. Right now, javascript used by websites I go to either does not work at...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
2
by: thessjshawn | last post by:
I am getting the following error: Parse error: parse error, unexpected T_IF in C:\wamp\www\PHP Project\topics.php on line 20 the line of code is as follows: if(crypt($pass,...
2
by: Angahran | last post by:
I'm hoping someone can help me. I was trying to backup our eqdkp database and managed to remove all the admin access from the admin account :( I cannot use phpmyadmin or mysql to directly access...
12
by: =?Utf-8?B?ZGdvdw==?= | last post by:
I designed a "contact_us" page in visual web developer 2005 express along with EW2 after viewing tutorials on asp.net's help page. Features work like they should, but I cannot figure out how to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.