Page 1 of 1

PHP AND XML

Posted: Wed Nov 05, 2003 12:38 am
by idpexec
Hey,

New at the xml thing. For some reason when I run a simple php script nothing is echoed to the browser.

this is the first line in the script:

echo "<?xml version='1.0' encoding'UTF-8'?>";

I've tried writing it serveral different ways. Is there something missing? Has my host not configured something?

Anything I can do?

Thanks,
Ward

Posted: Wed Nov 05, 2003 1:56 am
by m3mn0n
Post the full code. It might have to do with how you open up php.

<? vs. <?php

[big_search]php and xml tutorial[/big_search]

Posted: Wed Nov 05, 2003 2:43 am
by twigletmac
Have you viewed the source of the page to see what's there? Do you have display_errors turned on in your php.ini and is your error reporting level at E_ALL? Run:

Code: Select all

<?php
echo '<pre>';
echo 'PHP Version: '.phpversion()."\n";
echo 'Display Errors: '.(ini_get('display_errors') == '1' ? 'On' : 'Off')."\n";
echo 'Error Level: '.(ini_get('error_reporting') == '2047' ? 'E_ALL' : 'Not E_ALL')."\n";
echo 'Register Globals: '.(ini_get('register_globals') == '' ? 'Off' : 'On')."\n";
echo '</pre>'; 
?>
to find out.

Mac

Thanks for the tip

Posted: Wed Nov 05, 2003 7:24 am
by idpexec
Thanks for the response, I ran the code you posted. Here is the output:

PHP Version: 4.3.3
Display Errors: On
Error Level: Not E_ALL
Register Globals: On

The deal is that my host provides me with php. I don't know if I even have access to php.ini.

This whole thing started after I read the data binding tutorial from this site. Looks like the php script is straight forward and simple. Doesn't say anything about any other requirements to use xml in a php script. Am I missing something? Does something need to be installed on the host's end?

Thanks,
Ward