[nyphp-talk] Array Reference Strangeness

2007-05-27 Thread Michael B Allen
Hey, I'm having trouble with array references. Consider the following code: #!/usr/bin/php -q I want to be able to update elements in $arr after it has been added to $top. However, the assignment appears to make a copy (adding elements to $arr are not in the $arr added to $top). So I thought p

Re: [nyphp-talk] Modifying an XML tag name OR cloning an entire node including childnodes

2007-05-27 Thread Jon Baer
Is it something you can do client side? http://docs.jquery.com/DOM/Manipulation#remove.28_expr_.29 SimpleXML will remove HTML but I think if you wrap w/ CDATA and use that instead of text might work? - Jon On May 27, 2007, at 9:56 PM, Dynamic Ink wrote: I need to modify an XML tag name and

Re: [nyphp-talk] $_SERVER

2007-05-27 Thread Jon Baer
Well I remembered it from a PHP internals talk I saw once and the same question was asked about how $_* variables are pushed up from the server layer. Although Nate's solution is definitely what you want. It makes sense though as you work up the stack to have common variables to depend on

Re: [nyphp-talk] Modifying an XML tag name OR cloning an entire node including childnodes

2007-05-27 Thread David Krings
Dynamic Ink wrote: Basically I am trying to turn something like this: Hello Joe, nice to meet you into this: Hello Joe, nice to meet you In my naivity I'd propose doing a simple find and replace. After all, XML is nothing else than a string or a text file, so replacing the with and the wit

[nyphp-talk] Modifying an XML tag name OR cloning an entire node including childnodes

2007-05-27 Thread Dynamic Ink
I need to modify an XML tag name and am having quite a few setbacks trying to do it with DOM. Basically I am trying to turn something like this: Hello Joe, nice to meet you into this: Hello Joe, nice to meet you I could not figure out any way to change the readonly nodeName property, but I w

Re: [nyphp-talk] How not to save HTML entities to the DB when using htmlentities()?

2007-05-27 Thread Michael B Allen
On Sun, 27 May 2007 18:14:15 -0400 Chris Shiflett <[EMAIL PROTECTED]> wrote: > Michael B Allen wrote: > > I am using htmlentities($text, ENT_COMPAT, 'UTF-8'); to escape text > > from the db to be displayed in form fields. This works fine but when > > the text is saved in the database the entities

[nyphp-talk] .htaccess redirect with $_GET

2007-05-27 Thread Michael Southwell
I have been unable to confirm in the Apache docs or elsewhere what experience shows, that something in .htaccess like this: RedirectMatch permanent somefile.htm http://example.com/anotherfile.php?variable=something will not work. There is of course a certain logic to its not working. Can somebod

Re: [nyphp-talk] How not to save HTML entities to the DB when using htmlentities()?

2007-05-27 Thread Chris Shiflett
Michael B Allen wrote: > I am using htmlentities($text, ENT_COMPAT, 'UTF-8'); to escape text > from the db to be displayed in form fields. This works fine but when > the text is saved in the database the entities are saved with it. > > For example, if the text in the db is 'Mike & Ike', the form f

Re: [nyphp-talk] How not to save HTML entities to the DB when using htmlentities()?

2007-05-27 Thread Rolan Yang
Maybe you're looking for something like: mysql_query("insert into mytable (`tablekey`,`rowvalue`) values (NULL,'".mysql_real_escape_string(html_entity_decode($datafrompage))."'"); You shouldn't have to do the html_entity_decode though. I think you're double converting it somewhere. ~Rolan

[nyphp-talk] How not to save HTML entities to the DB when using htmlentities()?

2007-05-27 Thread Michael B Allen
Hi List, I don't do a lot of websites so pardon me if this is a stupid question. I am using htmlentities($text, ENT_COMPAT, 'UTF-8'); to escape text from the db to be displayed in form fields. This works fine but when the text is saved in the database the entities are saved with it. For example,

Re: [nyphp-talk] $_SERVER

2007-05-27 Thread David Krings
Nate Abele wrote: Hi David, This may or may not be helpful for your specific situation, but I wrote a $_SERVER compatibility layer into Cake in the form of an env() function, which you can check out here: https://trac.cakephp.org/browser/branches/1.2.x.x/cake/basics.php#L978 It's not super-

Re: [nyphp-talk] $_SERVER

2007-05-27 Thread David Krings
Jon Baer wrote: From what I recall this depends on what's thrown into it @ the SAPI handler level which you can view via source ... http://lxr.php.net/source/php-src/sapi/ http://lxr.php.net/source/php-src/sapi/apache2handler/sapi_apache2.c http://lxr.php.net/source/php-src/sapi/isapi/php5isap

Re: [nyphp-talk] $_SERVER

2007-05-27 Thread Nate Abele
Date: Sat, 26 May 2007 20:23:27 -0400 From: David Krings <[EMAIL PROTECTED]> Subject: [nyphp-talk] $_SERVER To: NYPHP Talk Hi! Every web server generates a different $_SERVER array in PHP. I got burnt by it once. I used several keys/values that are present in the Luckasoft EnginServer, but not

Re: [nyphp-talk] $_SERVER

2007-05-27 Thread Jon Baer
From what I recall this depends on what's thrown into it @ the SAPI handler level which you can view via source ... http://lxr.php.net/source/php-src/sapi/ http://lxr.php.net/source/php-src/sapi/apache2handler/sapi_apache2.c http://lxr.php.net/source/php-src/sapi/isapi/php5isapi.c - Jon On Ma