PHP AND XML

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
idpexec
Forum Newbie
Posts: 2
Joined: Wed Nov 05, 2003 12:38 am

PHP AND XML

Post 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
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post 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]
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
idpexec
Forum Newbie
Posts: 2
Joined: Wed Nov 05, 2003 12:38 am

Thanks for the tip

Post 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
Post Reply