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

2013-11-01 Thread php-general-digest-help

php-general Digest 31 Oct 2013 07:14:27 - 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


--
---BeginMessage---
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---
---BeginMessage---
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---
---BeginMessage---
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---
---BeginMessage---


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---


Re: [PHP] preg_replace

2013-11-01 Thread Adam Szewczyk
Hi,

On Fri, Nov 01, 2013 at 11:06:29AM -0400, leam hall wrote:
 Despite my best efforts to ignore preg_replace...
Why? :)

 PHP Warning:  preg_replace(): Delimiter must not be alphanumeric or
 backslash
 
 Thoughts?
You are just using it wrong.
http://us2.php.net/manual/en/regexp.reference.delimiters.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php