php-general Digest 26 Jul 2011 17:21:09 -0000 Issue 7416
Topics (messages 314196 through 314203):
SimpleXMLElement, adding nodes that are SimpleXMLElement.
314196 by: Richard Quadling
314197 by: Richard Quadling
Re: How to install pecl_http into a web hosting service
314198 by: Jamie Krasnoo
314199 by: Richard Quadling
314200 by: Andrew Ballard
314201 by: Jamie Krasnoo
314202 by: gato chalar
Tree menu list in php
314203 by: alekto
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Hello all.
I've got 2 XML documents (one from a URL and another via MS SQL Server).
The structure of these documents is the same, with just a difference
in attribute to identify things (the 'data' is different but the
variable's name attribute is the key here).
<data>
<variable name="var_name_x">
<row>
<column>data</column>
...
</row.
...
</variable>
</data>
I need to merge both documents so that the variable node of each
document exists in a new document ...
<data>
<variable name="var_name_x">
...
</variable>
<variable name="var_name_y">
...
</variable>
</data>
I know I can do this with string manipulation (and that's what I've
done), but I'd like to use a more appropriate mechanism (part learning
and part keeping the code tidy).
I suspect SimpleXMLElement may not be the right tool.
Richard.
--
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea
--- End Message ---
--- Begin Message ---
On 25 July 2011 13:47, Richard Quadling <[email protected]> wrote:
> Hello all.
>
> I've got 2 XML documents (one from a URL and another via MS SQL Server).
>
> The structure of these documents is the same, with just a difference
> in attribute to identify things (the 'data' is different but the
> variable's name attribute is the key here).
>
> <data>
> <variable name="var_name_x">
> <row>
> <column>data</column>
> ...
> </row.
> ...
> </variable>
> </data>
>
> I need to merge both documents so that the variable node of each
> document exists in a new document ...
>
> <data>
> <variable name="var_name_x">
> ...
> </variable>
> <variable name="var_name_y">
> ...
> </variable>
> </data>
>
> I know I can do this with string manipulation (and that's what I've
> done), but I'd like to use a more appropriate mechanism (part learning
> and part keeping the code tidy).
>
> I suspect SimpleXMLElement may not be the right tool.
>
> Richard.
Got it working when I finally discovered DOMDocument->importNode().
Allows the copying of a node from one DOM to another.
Easy.
--
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea
--- End Message ---
--- Begin Message ---
You should be using cURL for making requests.
No, you won't be able to install any pecl packages on your host. It's
a free account and I doubt they will be bending over backwards for you
anytime soon. If you want custom hosting, pay for a VPS account or a
dedicated server.
On Thu, Jul 21, 2011 at 8:52 PM, gato chalar <[email protected]> wrote:
> Hi list,
>
> I need to perform http requests (GET,POST) , I have readed about pecl_http
> package, so it seem to be what I need. Reading further I sow some ways to
> install this package to a server where you have all rights and privilegies,
> and that's the problem; I don't know if I will be able to install pecl_http
> in a php hosting service. Currently I have a free php hosting account. Is
> that posible?
>
> Thanks for the help.
>
--- End Message ---
--- Begin Message ---
On 25 July 2011 17:26, Jamie Krasnoo <[email protected]> wrote:
> You should be using cURL for making requests.
>
> No, you won't be able to install any pecl packages on your host. It's
> a free account and I doubt they will be bending over backwards for you
> anytime soon. If you want custom hosting, pay for a VPS account or a
> dedicated server.
>
> On Thu, Jul 21, 2011 at 8:52 PM, gato chalar <[email protected]> wrote:
>> Hi list,
>>
>> I need to perform http requests (GET,POST) , I have readed about pecl_http
>> package, so it seem to be what I need. Reading further I sow some ways to
>> install this package to a server where you have all rights and privilegies,
>> and that's the problem; I don't know if I will be able to install pecl_http
>> in a php hosting service. Currently I have a free php hosting account. Is
>> that posible?
>>
>> Thanks for the help.
Depending upon your complexity, you could possible use the builtin
streams mechanisms.
I've used them to force all PHP requests through a NTLM authentication
proxy server (network required NTLM authentication which was not
handled by PHP).
http://uk.php.net/manual/en/book.stream.php
--
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea
--- End Message ---
--- Begin Message ---
On Mon, Jul 25, 2011 at 12:26 PM, Jamie Krasnoo <[email protected]> wrote:
[reordered and snipped]
>
> On Thu, Jul 21, 2011 at 8:52 PM, gato chalar <[email protected]> wrote:
>> Hi list,
>>
>> I need to perform http requests (GET,POST) , I have readed about pecl_http
>> package, so it seem to be what I need. Reading further I sow some ways to
>> install this package to a server where you have all rights and privilegies,
>> and that's the problem; I don't know if I will be able to install pecl_http
>> in a php hosting service. Currently I have a free php hosting account. Is
>> that posible?
>>
> You should be using cURL for making requests.
If the pecl HTTP extension is unavailable, cURL is the next simplest
choice, but I've used HTTP when it was available and it worked just
fine. I'm curious as to your reason (other than general availability)
for stating that one *should* use cURL (as opposed to something else
like HTTP).
Andrew
--- End Message ---
--- Begin Message ---
Most hosting companies have cURL already installed and available
rather than pecl_http. I probably should have said "try using cURL"
instead of "you should be using cURL". However most FREE hosting
companies probably won't even have that installed due to security
concerns.
Jamie
On Mon, Jul 25, 2011 at 11:16 AM, Andrew Ballard <[email protected]> wrote:
> On Mon, Jul 25, 2011 at 12:26 PM, Jamie Krasnoo <[email protected]> wrote:
> [reordered and snipped]
>>
>> On Thu, Jul 21, 2011 at 8:52 PM, gato chalar <[email protected]> wrote:
>>> Hi list,
>>>
>>> I need to perform http requests (GET,POST) , I have readed about pecl_http
>>> package, so it seem to be what I need. Reading further I sow some ways to
>>> install this package to a server where you have all rights and privilegies,
>>> and that's the problem; I don't know if I will be able to install pecl_http
>>> in a php hosting service. Currently I have a free php hosting account. Is
>>> that posible?
>>>
>> You should be using cURL for making requests.
>
> If the pecl HTTP extension is unavailable, cURL is the next simplest
> choice, but I've used HTTP when it was available and it worked just
> fine. I'm curious as to your reason (other than general availability)
> for stating that one *should* use cURL (as opposed to something else
> like HTTP).
>
> Andrew
>
--- End Message ---
--- Begin Message ---
Hi to everybody,
Currently I'm using curl, it is installed in my free hosting account.
On 25 July 2011 16:29, Jamie Krasnoo <[email protected]> wrote:
> Most hosting companies have cURL already installed and available
> rather than pecl_http. I probably should have said "try using cURL"
> instead of "you should be using cURL". However most FREE hosting
> companies probably won't even have that installed due to security
> concerns.
>
> Jamie
>
> On Mon, Jul 25, 2011 at 11:16 AM, Andrew Ballard <[email protected]>
> wrote:
> > On Mon, Jul 25, 2011 at 12:26 PM, Jamie Krasnoo <[email protected]>
> wrote:
> > [reordered and snipped]
> >>
> >> On Thu, Jul 21, 2011 at 8:52 PM, gato chalar <[email protected]> wrote:
> >>> Hi list,
> >>>
> >>> I need to perform http requests (GET,POST) , I have readed about
> pecl_http
> >>> package, so it seem to be what I need. Reading further I sow some ways
> to
> >>> install this package to a server where you have all rights and
> privilegies,
> >>> and that's the problem; I don't know if I will be able to install
> pecl_http
> >>> in a php hosting service. Currently I have a free php hosting account.
> Is
> >>> that posible?
> >>>
> >> You should be using cURL for making requests.
> >
> > If the pecl HTTP extension is unavailable, cURL is the next simplest
> > choice, but I've used HTTP when it was available and it worked just
> > fine. I'm curious as to your reason (other than general availability)
> > for stating that one *should* use cURL (as opposed to something else
> > like HTTP).
> >
> > Andrew
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Daniel Echalar Fernandez
Truesoft Developer
AIESEC Alumni
--- End Message ---
--- Begin Message ---
Hi,
is there a way to create a tree menu list only by using php/html/css?
I found some, but they are all in JavaScript, do I have to make them by using
JavaScript or is there a way in php as well?
This is how I imagine the tree menu should look like:
v First level
> Second level
> Second level
v Second level
> Third level
> Third level
> Third level
> Second level
> Second level
( > = menu is closed, v = menu is open )
Cheers!
--- End Message ---