Why isn't this working?

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Why isn't this working?

Postby timstring » 28. September 2012 19:19

I have this code buried in a PHP file surrounded by HTML:

Code: Select all
<?php
   echo "<div align='center'>";
   echo $_SESSION['FirstName'] . " " . $_SESSION['LastName'] . "<br />";
   echo $_SESSION['System'] . "<br /><br />";
   echo "</div>";
?>


I have two pages that link to this page. When the first page hits this one, I get this output:

Code: Select all
"; echo $_SESSION['FirstName'] . " " . $_SESSION['LastName'] . "
"; echo $_SESSION['System'] . "

"; echo ""; ?>


as if the site was skipping over the "<?php"

I pulled the "div align" code out of the php script and bookended the script with it. When I do this, I get this output, centered as it should:

Code: Select all
"; echo $_SESSION['System'] . "

"; ?>


When the second page goes back to my troubled script, it works wonderfully.

Y'all are sure a talkative bunch
"If builders built buildings the way that programmers write programs, the first woodpecker to come along would destroy civilization."
User avatar
timstring
 
Posts: 22
Joined: 17. September 2010 02:16

Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 76 guests