FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PHP Sessions and XML
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: PHP Sessions and XML [message #178347 is a reply to message #178342] Fri, 08 June 2012 09:49 Go to previous messageGo to previous message
Jonathan Stein is currently offline  Jonathan Stein
Messages: 43
Registered: September 2010
Karma:
Member
Den 07-06-2012 21:27, Jim Higgins skrev:

> The XML file will contain a Session ID. So a few PHP keywords related
> to initiating a PHP session using that Session ID would be really
> helpful.

You must pass the session ID in a cookie (normally the cookie name is
PHPSESSID).

Take a look at
http://www.php.net/manual/en/function.file-get-contents.php - especially
the "context" parameter.

You can find an example of a context with a cookie at
http://www.php.net/manual/en/function.stream-context-create.php

Your code could be something like this:

$context = array(/* set the cookie here */);
$xml = file_get_contents('http://example.com/path/to/file', false,
$context);
$data = new SimpleXMLElement($xml);
print_r($data); // Look what we got...

Regards

Jonathan
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: sessions causing refreshing not to work
Next Topic: Query about WWW-Authenticate: Basic and bad UserID/Password recovery
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 16:39:40 GMT 2024

Total time taken to generate the page: 0.03718 seconds