php-general Digest 31 Oct 2013 07:14:27 -0000 Issue 8414

Topics (messages 322393 through 322396):

Re: Starting with XML
        322393 by: Stuart Dallas

Re: Apache/PHP exploit
        322394 by: Tamara Temple
        322395 by: Joshua Kehn
        322396 by: Camilo Sperberg

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On 30 Oct 2013, at 13:43, leam hall <leamh...@gmail.com> wrote:

> I'm trying to work on an XML document and turn it into something I can put
> into a database or array. Am getting stuck as I try to learn the PHP stuff
> needed for XML.
> 
> What I have so far is just:
> 
> $xml = simplexml_load_file('my-file.xml');
> 
> $status = $xml->status;
> echo "status is $status.\n";
> 
> $href = $xml->reference->href;
> echo "href is $href.\n";
> 
> Which gives:
> 
> status is accepted.
> href is .
> 
> 
> If I do:
> 
>    print_r($xml);
> 
> It starts out with:
> 
> SimpleXMLElement Object
> (
>    [@attributes] => Array
>        (
>            [id] => My_Info
>        )
> 
>    [status] => accepted
>    [title] => Nice long string title
>    [reference] => SimpleXMLElement Object
>        (
>            [@attributes] => Array
>                (
>                    [href] => http://www.example.com
>                )
> 
>        )
> 
> 
> 
> How do I reference the nested objects? The file is fairly long and seems
> deeply nested.

The value you’re trying to retrieve is an attribute, and can be accessed using 
the attributes method: http://php.net/simplexmlelement.attributes

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

--- End Message ---
--- Begin Message ---
This info cruised by my screen from G+ today, thought I’d at least pass it 
along:

http://www.exploit-db.com/exploits/29290/



--- End Message ---
--- Begin Message ---
Summary for those on phones?

Best,

-Josh
___________________________
http://byjakt.com
Currently mobile

> On Oct 30, 2013, at 8:37 PM, Tamara Temple <tamouse.li...@gmail.com> wrote:
> 
> This info cruised by my screen from G+ today, thought I’d at least pass it 
> along:
> 
> http://www.exploit-db.com/exploits/29290/
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---

On 31 okt. 2013, at 01:55, Joshua Kehn <j...@kehn.us> wrote:

> Summary for those on phones?
> 
> Best,
> 
> -Josh
> ___________________________
> http://byjakt.com
> Currently mobile
> 
>> On Oct 30, 2013, at 8:37 PM, Tamara Temple <tamouse.li...@gmail.com> wrote:
>> 
>> This info cruised by my screen from G+ today, thought I’d at least pass it 
>> along:
>> 
>> http://www.exploit-db.com/exploits/29290/
>> 
>> 
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

It opens a shell on default ubuntu/debian lamp's, compromising several versions 
of php, including the 5.5 branch. 

Sent from my iPhone 6 Beta [Confidential use only]

--- End Message ---

Reply via email to