View Single Post
Old 12-27-2012, 12:40 PM   PM User | #5
rgEffects
New Coder

 
Join Date: Aug 2012
Posts: 76
Thanks: 22
Thanked 0 Times in 0 Posts
rgEffects is an unknown quantity at this point
The only thing on 277 is <?php

I carefully went through all of the previous lines of code and removed all of the opening and closing php tags until I got to the validate user and session section on line 44. The entire problem went away then. Funny thing is that in the validate user section at the head of my document is exactly the same on all the restricted pages. This is the only page where that section causes this error.

Now everything is working fine.

So here's a general question then. I usually separate different operations by opening and closing php tags when I'm above the HTML because it makes the sections easier to find. I also will put common pieces of code in an include. For example, the code I use to generate menu's is in two sections. The last php call I make before the HTML looks like this:

PHP Code:
<?php include('../includes/commonMenuRS.php'); ?>
<!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>
.... then farther down the page
PHP Code:
<div id="menu">
<?php include('../includes/commonNavMenu.php'); ?>
</div>
Is this a good practice? It certainly makes editing the site easier.

Last edited by rgEffects; 12-27-2012 at 01:19 PM..
rgEffects is offline   Reply With Quote