Keith
Keith

Reputation: 26499

Problem with setting a session with data from an xml file in PHP

Howdy again Stack Overflowers,

I have this feed that I want to store the session_id in that xml file as a string to play with outside the loop, what am I doing wrong?

if($xmlobj = simplexml_load_string(file_get_contents($xml_feed)))
      {
            foreach($xmlobj as $listing)
            {
                 echo $session_Id = $listing->sessionId;
            }

            if(isset($_SESSION['sessionId'])): 
                  echo 'Your Session Id is' . $_SESSION['sessionId'] = $session_Id;
            else: 
                  echo 'Your Session Id is' . $_SESSION['sessionId'] = $session_Id;
            endif;
      }

Upvotes: 0

Views: 138

Answers (1)

corymathews
corymathews

Reputation: 12619

I Don't think you can have the : in php.

its on the else: and the end of the if:

Upvotes: 1

Related Questions