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 #178348 is a reply to message #178347] Fri, 08 June 2012 11:32 Go to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 6/8/2012 5:49 AM, Jonathan Stein wrote:
> 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

Not necessarily. It all depends on how the server is configured. I've
seen some which only pass it as a $_POST value in an XML form, and not
call it PHPSESSID.

It all depends on what's on the other end.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[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 18:41:25 GMT 2024

Total time taken to generate the page: 0.04591 seconds