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 #178344 is a reply to message #178343] Fri, 08 June 2012 01:33 Go to previous messageGo to previous message
Jim Higgins is currently offline  Jim Higgins
Messages: 20
Registered: November 2010
Karma:
Junior Member
On Thu, 07 Jun 2012 16:04:04 -0400, Jerry Stuckle
<jstucklex(at)attglobal(dot)net> wrote:

> On 6/7/2012 3:27 PM, Jim Higgins wrote:
>>
>> Could someone point me toward a very simple bare bones example of a
>> PHP script for connecting to a server external to the one running the
>> PHP script and accepting the small XML file that server will return?
>> And maybe give me a few PHP keywords I can study for parsing that XML
>> file?
>>
>> 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.
>>
>> Thank you.
>
> These are pretty broad questions, so it's almost impossible to answer
> them exactly.
>
> Some hints - for fetching the page, the simplest way is to just fetch
> the URL using the file functions. However, your server would have to be
> configured to allow this (allow_url_fopen set to ON). Also, while this
> is a simple interface, it is pretty much limited to opening a file for
> read only - no cookies, etc.
>
> A more versatile (but a bit more complicated) way is to fetch the url
> with the curl functions. Not hard once you've done it a couple of
> times, but there are a number of options.
>
> Once you have the file, if it's a well-formed XML file you can probably
> use the SimpleXML functions to process it. Again, this is somewhat
> limited, but relatively easy to use. Another way which is more
> versatile (and handles non-well-formed documents better) is the DOM
> classes.
>
> For handling the session - impossible to tell from what you're asking.
> It depends a lot on whether the session id is passed in the file or the
> URL (and you have to pass it back) or in a cookie (in which case you
> must use the cURL function). But if you're only fetching one file, you
> shouldn't have to worry about a session id - it's a single request.
>
> Any more detail would be pure conjecture, and would very probably steer
> you along the wrong path.

Thank you Jerry. It's supposedly a well formed XML file. And just
the words "DOM classes" scares me. ;-)

But in any case you've given me some things to look into and after
that if I haven't figured it out I'll at least be able to ask a more
focused question.

Thanks again.
[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: Tue Nov 12 20:33:32 GMT 2024

Total time taken to generate the page: 0.03762 seconds