I am having a crazy time with trying to get the $_SERVER working in the following code:
$content = '<div id="mainContent">' .'<h1>purchase tickets to the BEAC national students awards gala!</h1>' .'<div id="navcrumb"><a href="/index.php">home</a> :: awards :: purchase gala tickets</div>' .'<div id="tix_container"><form name="tickets" id="tickets" method="post" class="tix" action="<?php echo $_SERVER["PHP_SELF"]?>">' .'<fieldset><legend>Shipping Info</legend>'
It goes on to build up the entire form, which is stored in $content.
It then draws this content in a specific place on the html template I mentioned earlier.
What is happening is that when I go to the original page (gala-tix.php, the page loads but I get a bit of php code which shows up on the page which does not seem to be being drawn by PHP. (See attached image). When I submit the form, I get an error saying that the page is not found and shows a url of /conference/< which looks like the first bit of the <?php echo $_SERVER["PHP_SELF"]?>
So I am thinking that there is something wrong with the way I am adding the $_SERVER["PHP_SELF"], or, because the page gala-tix.php is already a php page, the error is caused by inserting the entire php block in the action of the form. i.e. <?php echo $_SERVER["PHP_SELF"]?>, rather than something like just echo $_SERVER;, which also does not work.
What am I missing here?