What does <?xml have to do with it?

From: Date: Sun, 28 Dec 2008 16:40:46 +0000
Subject: What does <?xml have to do with it?
Groups: php.general 
Request: Send a blank email to php-general+get-285144@lists.php.net to get a copy of this message
Hi gang: I have a small php routine to provide the user with a style choice. The working url is here: http://php1.net/a1/david/ The simple code that allows style switching follows: <?php session_start(); $the_style = isset($_SESSION['the_style']) ? $_SESSION['the_style'] : 'style1'; if(isset($_GET['set'])) { $set = $_GET['set']; if($set == 'style1')
      {
      $the_style = 'style1.css';
      }
else
      {
      $the_style = 'style2.css';
      }
$_SESSION['the_style'] = $the_style; } $the_style = $_SESSION['the_style']; ?> As you can see, the code works. However, if I add the following line IN THE HTML (i.e., after ?>): <?xml version="1.0" encoding="UTF-8" ?> I receive a: Parse error: syntax error, unexpected T_STRING What's up with that? Apparently the php interpreter is considering "<?xml" tag as a php declaration -- how do I turn that off? Or is this something else? Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#285144) next »