note 75166 added to language.basic-syntax

From: Date: Tue, 15 May 2007 21:56:20 +0000
Subject: note 75166 added to language.basic-syntax
Groups: php.notes 
Request: Send a blank email to php-notes+get-126634@lists.php.net to get a copy of this message
It would appears that you cannot include a file that ends in the middle of control structure. For example, suppose I have 3 files where the first is requested by the browser. File 1: <?php include_once('header.php'); <p>some conditional content</p> include_once('footer.php'); ?> File 2: header.php <?php $showpage = true; //or some really complex permissions condition if ($showpage) { ?> File 3: footer.php <?php } else { <p>You cannot see this page right now.</p> } ?> This produces and error "Unexpected $end in header.php on line [last line]" ---- Server IP: 194.145.210.4 Probable Submitter: 82.41.227.125 ---- Manual Page -- http://www.php.net/manual/en/language.basic-syntax.php Edit -- https://master.php.net/note/edit/75166 Del: integrated -- https://master.php.net/note/delete/75166/integrated Del: useless -- https://master.php.net/note/delete/75166/useless Del: bad code -- https://master.php.net/note/delete/75166/bad+code Del: spam -- https://master.php.net/note/delete/75166/spam Del: non-english -- https://master.php.net/note/delete/75166/non-english Del: in docs -- https://master.php.net/note/delete/75166/in+docs Del: other reasons-- https://master.php.net/note/delete/75166 Reject -- https://master.php.net/note/reject/75166 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#126634) next »