php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29742 Parse error when using a script for displaying contents by url querys
Submitted: 2004-08-18 19:59 UTC Modified: 2004-08-18 23:07 UTC
From: cheetah-z at web dot de Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.3.8 OS: FreeBSD
Private report: No CVE-ID: None
 [2004-08-18 19:59 UTC] cheetah-z at web dot de
Description:
------------
I wanted to build a website with an structure as easy as possible. So i decided to use a php script displaying different contents on the same site by using querys.

BTW: Sorry for my english, it may be a bit lame, but I am German so just try to understand my special germenglish.

Reproduce code:
---------------
<?php
     if ($site == "home") {
     echo "<h2>Willkommen auf der Webseite von TM-Servers
     <br>Diese Webseite wurde zum Zweck der Information...
     ...tm-server.de.vu ging heute online.";
     if ($site == "server") {
     echo "Serverdaten folgen in K&uuml;rze!";
     }
     if ($site == "members") {
     echo "Mitgliederliste folgt in K&uuml;rze!";
     }
     if ($site == "links") {
     echo "Hier werden demn&auml;chst sehenswerte Links
     gesammelt!";
     }
     if ($site == "partner") {
     echo "Demn?chst werden hier alle Partner und Sponsoren
     von TM-Serversaufgef&uuml;hrt!";
     }
?>

Expected result:
----------------
I expected my website to open regularly and when clicking a link containing a query
(for example: "index.php?site=members" to display the content defined by the echo function (for example: "Mitgliederliste folgt in K?rze!")

Actual result:
--------------
Parse error: parse error, unexpected $ in /home/export/www/vhosts/funnetwork/hosting/cheetah7/index.php on line 97


an important information is, that line 97 is the very end of index.php and just contains: "</html>" The php tag was already closed many lines before!

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-18 23:07 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

You forgot to close the 1st if() 
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 16:01:34 2025 UTC