Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 976519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:45:31+00:00 2026-05-16T03:45:31+00:00

I have been trying to output XML with PHP but encountered a strange(!) error

  • 0

I have been trying to output XML with PHP but encountered a strange(!) error in Internet Explorer.

The expected xml output is this:(simplified)

<root>
<match_id>12</match_id>
<stadium_id>43</stadium_id>
<tribune_id>2</tribune_id>
<fan_id>453</fan_id>
</root>

I am producing this output with the following PHP code:

echo "<?xml version='1.0' encoding='utf-8' ?>
<root>
<match_id>"; echo $match->getId(); echo "</match_id>
<stadium_id>43</stadium_id>
<tribune_id>2</tribune_id>
<fan_id>".$_SESSION['user_id']."</fan_id>
</root>";

In Firefox, the output is same as expected. However, in IE, the output is this:

<?xml version="1.0" encoding="utf-8" ?> 
<root>
  <match_id>0</match_id> 
  <stadium_id>43</stadium_id> 
  <tribune_id>2</tribune_id> 
  <fan_id /> 
</root>

This is a really annoying error. I have set the PHP header for XML output, and changed lots of other things but could not make it work.

The $match->getId() part is just returning an integer but IE always shows this value as 0. If I set <fan_id> and <match_id> manually, IE shows the values correctly.

By the way, I am using this XML output in Flash (AS3) and this also shows the same result with IE.

What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:45:32+00:00Added an answer on May 16, 2026 at 3:45 am

    This looks like it’s due to a session difference – the IE session isn’t storing the user id. Similarly, $match->getId() is actually 0 – I imagine you’d get a similar result using Chrome or Safari or a web browser on any other computer.

    One other thing: Flash may not be sending the PHP session cookie to the server on the request – which would match the IE behavior / no valid session.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to send xml message from php to asp and output
I have been trying to decipher what this output means, but I just can't
I have been trying to filter tcpdump output based on packets lengths. But I
I've been trying for hours to find a solution this problem but have not
I have been trying to use XStreamMarshaller to generate XML output in my Java
Have have been trying to make a validator for my xml files. I have
I have been trying to understand the way ActionScript's events are implemented, but I'm
I am trying to have PHP read an XML file and then convert it
Ive been trying to sort out output using AWK, and have been pretty successful
I have been trying very hard to achieve rounded corners with IE6+jquery ui tabs.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.