In an attempt to prevent direct access to my scripts and included files I have defined constants using the define() function, which are then checked in the script files, and I have used the die() function if the constant is not defined.
This does work, i.e. I cannot access the scripts and included files directly by typing in their url path, and I receive the die("text here") message.
However when running the webpage normally I am getting a "; expected" error in both IE and Firefox. In Firefox the debugger error states:
missing ; before statement text here.
I have narrowed down the problem to a costant definition in the <head> section of the main webpage, so for example I've done this:
..so that the constant AUTHR is defined before the script is called, allowing the page to open properly.
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="mypage.css" type="text/css" />
[PHP]<?php define("AUTHR",1); ?>[/PHP]
I'm guessing I can't do this, or if I can I've gone about it the wrong way.
Any ideas or solutions would be very gratefully received!!