What does <?xml have to do with it?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux