Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #6269
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: PHP Sessions and XML |
| Date | 2012-06-08 07:32 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <jqsnsi$mkt$1@dont-email.me> (permalink) |
| References | <lev1t7l8qnphm30kq6b7knkg7k560osk18@4ax.com> <4fd1ca9d$0$291$14726298@news.sunsite.dk> |
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@attglobal.net
==================
Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread
PHP Sessions and XML Jim Higgins <invalid@invalid.invalid> - 2012-06-07 19:27 +0000
Re: PHP Sessions and XML Jerry Stuckle <jstucklex@attglobal.net> - 2012-06-07 16:04 -0400
Re: PHP Sessions and XML Jim Higgins <invalid@invalid.invalid> - 2012-06-08 01:33 +0000
Re: PHP Sessions and XML Jerry Stuckle <jstucklex@attglobal.net> - 2012-06-07 21:38 -0400
Re: PHP Sessions and XML "Mr. B-o-B" <mr.chew.baka@gmail.com> - 2012-06-07 23:10 -0500
Re: PHP Sessions and XML Jonathan Stein <jstein@image.dk> - 2012-06-08 11:49 +0200
Re: PHP Sessions and XML Jerry Stuckle <jstucklex@attglobal.net> - 2012-06-08 07:32 -0400
csiph-web