[PHP] parsin XML with DOM

2007-06-26 Thread [EMAIL PROTECTED]
hello, could somebody give me some direction here. i am trying to build a RSS 2.0 parser using DOM. what puzzles me is the following - i get the XML - $RSS_XML = file_get_contents($params['uri']); then i instantiate a DOM object - $RSS_DOM = new DomDocument(); then i load the XML -

[PHP] Handling animated GIFs with GD?

2007-06-26 Thread Tijnema
Hello all again, Is it possible to parse animated GIFs with GD, just frame by frame? Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] generate letter combination..

2007-06-26 Thread jeffry s
i made a mistake when i say i can solve this problem to a friend. finally i realize it is not as simple as i appear to be. what he ask me to do is write a simple script that, given a word.. the script will generate a list of words combinaton from the each character in in that word. i am tired

[PHP] PHP5 TUTORIAL

2007-06-26 Thread Preethi
BlankHi, Need to have a kick start on PHP5. Kindly suggest me the good online tutorial for PHP5. Am already working on php4. Need to migrate from php4 to php5. Regards, Preethi. Extn No: 4099 Some of the greatest science comes from those unaware of established rules and theories.

Re: [PHP] PHP5 TUTORIAL

2007-06-26 Thread php-ml
Hi Preethi Kindly suggest me the good online tutorial for PHP5. Am already working on php4. Need to migrate from php4 to php5. i think this is very important for OOP: http://www.php.net/manual/en/language.oop5.php and this one: http://www.php.net/manual/en/language.exceptions.php

Re: [PHP] Database administration framework

2007-06-26 Thread Chris Boget
I just need a framework for administrating tables in a database. These are simple add/edit/remove operations from tables. Can you suggest a framework for this kind of job? Cause there are a lot of tables and I hope I can find a nice tool to work with. What database are you working with?

[PHP] Disadvantages of output buffering

2007-06-26 Thread Emil Edeholt
Hi! My php project would get a much cleaner code if I could set cookies anywhere in the code. So I thought of output buffering. But I can't find any articles on the cons of output buffering. I mean it most be a reason for it being off by default? Kind Regards Emil Edeholt -- PHP General

RE: [PHP] Database administration framework

2007-06-26 Thread Edward Kay
Hi, I just need a framework for administrating tables in a database. These are simple add/edit/remove operations from tables. Can you suggest a framework for this kind of job? Cause there are a lot of tables and I hope I can find a nice tool to work with. Look at Qcodo

RE: [PHP] Database administration framework

2007-06-26 Thread Andy
The DB ist mysql. No, you didn't understand me clearly. I need a framework, toolkit, class call it how you want, with wich I develop an application that administrates the data's in the database. Something like Smarty but more specific for what I need. The ideea is the following: I have 20

Re: [PHP] Database administration framework

2007-06-26 Thread Richard Heyes
The DB ist mysql. No, you didn't understand me clearly. I need a framework, toolkit, class call it how you want, with wich I develop an application that administrates the data's in the database. Something like Smarty but more specific for what I need. The ideea is the following: I have 20

[PHP] Database administration framework

2007-06-26 Thread Andy
Hi, I just need a framework for administrating tables in a database. These are simple add/edit/remove operations from tables. Can you suggest a framework for this kind of job? Cause there are a lot of tables and I hope I can find a nice tool to work with. Thank you.

Re: [PHP] Disadvantages of output buffering

2007-06-26 Thread Robert Cummings
On Tue, 2007-06-26 at 14:33 +0200, Emil Edeholt wrote: Hi! My php project would get a much cleaner code if I could set cookies anywhere in the code. So I thought of output buffering. But I can't find any articles on the cons of output buffering. I mean it most be a reason for it being

Re: [PHP] Disadvantages of output buffering

2007-06-26 Thread Emil Edeholt
Thanks for your help Dave and Rob. I will start using output buffering a lot more now. Regards Emil Robert Cummings wrote: Cons of output buffering: - tncy weency time overhead - memory overhead since buffered content remains in memory until flushed. Cheers, Rob.

Re: [PHP] Disadvantages of output buffering

2007-06-26 Thread Stut
Robert Cummings wrote: On Tue, 2007-06-26 at 14:33 +0200, Emil Edeholt wrote: Hi! My php project would get a much cleaner code if I could set cookies anywhere in the code. So I thought of output buffering. But I can't find any articles on the cons of output buffering. I mean it most be a

Re: [PHP] Disadvantages of output buffering

2007-06-26 Thread Robert Cummings
On Tue, 2007-06-26 at 14:09 +0100, Stut wrote: Robert Cummings wrote: On Tue, 2007-06-26 at 14:33 +0200, Emil Edeholt wrote: Hi! My php project would get a much cleaner code if I could set cookies anywhere in the code. So I thought of output buffering. But I can't find any articles

Re: [PHP] PHP5 TUTORIAL

2007-06-26 Thread Nathan Nobbe
if you want to spend a little i would recommend this book from php|arch http://www.phparch.com/shop_product.php?itemid=135 -nathan On 6/26/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Preethi Kindly suggest me the good online tutorial for PHP5. Am already working on php4. Need to

Re: [PHP] Disadvantages of output buffering

2007-06-26 Thread Robin Vickery
On 26/06/07, Robert Cummings [EMAIL PROTECTED] wrote: On Tue, 2007-06-26 at 14:09 +0100, Stut wrote: Robert Cummings wrote: On Tue, 2007-06-26 at 14:33 +0200, Emil Edeholt wrote: Hi! My php project would get a much cleaner code if I could set cookies anywhere in the code. So I thought

Re: [PHP] Disadvantages of output buffering

2007-06-26 Thread William Lovaton
These two reasons are in fact of little impact. The real problem I have with output buffering in my web app is that it doesn't handle .xls and .pdf files generated on the fly with PHP. Every time the browser is going to download those kind of files it will get corrupted. The only solution I

[PHP] DOM support

2007-06-26 Thread Mikey
Hey! I have been looking through the docs writing test code and am going a little bit mad trying to work this out. Does anyone know where I can find a definitive list of DOM XML functions that are supported in specific versions of PHP? I write my code in Zend and it has 5.2.0, so

[PHP] Re: parsin XML with DOM

2007-06-26 Thread Mikey
[EMAIL PROTECTED] wrote: [snip] its type is not DomNode, but DomText. Only the 2nd child - $NODE = $NODE-nextSibling; has $NODE-tagName channel. My question is - why is the first child after rss DomText? Thank you, Iv My guess is the whitespace between the nodes :o) HTH, Mikey -- PHP

[PHP] Re: parsin XML with DOM

2007-06-26 Thread M. Sokolewicz
Mikey wrote: [EMAIL PROTECTED] wrote: [snip] its type is not DomNode, but DomText. Only the 2nd child - $NODE = $NODE-nextSibling; has $NODE-tagName channel. My question is - why is the first child after rss DomText? Thank you, Iv My guess is the whitespace between the nodes :o) HTH,

Re: [PHP] Create .php file with php

2007-06-26 Thread Marius Toma
I can not believe how stupid I can be sometime. I was trying to create a file, but a file with the same name already existed on the server - and I did not have the write permission to it, so from here I got the error message saying that I can not create the file :( Thank for your time,

Re: [PHP] Create .php file with php

2007-06-26 Thread Tijnema
On 6/26/07, Marius Toma [EMAIL PROTECTED] wrote: I can not believe how stupid I can be sometime. I was trying to create a file, but a file with the same name already existed on the server - and I did not have the write permission to it, so from here I got the error message saying that I can not

Re: [PHP] Create .php file with php

2007-06-26 Thread Daniel Brown
On 6/26/07, Marius Toma [EMAIL PROTECTED] wrote: I can not believe how stupid I can be sometime. I was trying to create a file, but a file with the same name already existed on the server - and I did not have the write permission to it, so from here I got the error message saying that I can not

Re: [PHP] Create .php file with php

2007-06-26 Thread Daniel Brown
On 6/26/07, Daniel Brown [EMAIL PROTECTED] wrote: On 6/26/07, Marius Toma [EMAIL PROTECTED] wrote: I can not believe how stupid I can be sometime. I was trying to create a file, but a file with the same name already existed on the server - and I did not have the write permission to it, so

Re: [PHP] Create .php file with php

2007-06-26 Thread Daniel Brown
On 6/26/07, Marius Toma [EMAIL PROTECTED] wrote: I can not believe how stupid I can be sometime. I was trying to create a file, but a file with the same name already existed on the server - and I did not have the write permission to it, so from here I got the error message saying that I can not

[PHP] Re: DOM support

2007-06-26 Thread Mikey
Mikey wrote: Hey! I have been looking through the docs writing test code and am going a little bit mad trying to work this out. Does anyone know where I can find a definitive list of DOM XML functions that are supported in specific versions of PHP? I write my code in Zend and it has

Re: [PHP] Create .php file with php

2007-06-26 Thread Adam Schroeder
You might also consider looking at variable variables and dynamic PHP (writing and evaluating php expressions on the fly). http://us.php.net/variables.variable http://us.php.net/eval Writing the PHP to a file could be a potential security vulnerability. Especially if this was going to go

Re: [PHP] Create .php file with php

2007-06-26 Thread Al
Would it not be better to create the file with tmpfile() and to put it in the system /tmp dir; which, I believe, is generally not in the webspace? Daniel Brown wrote: On 6/26/07, Marius Toma [EMAIL PROTECTED] wrote: I can not believe how stupid I can be sometime. I was trying to create a

Re: [PHP] Create .php file with php

2007-06-26 Thread Daniel Brown
On 6/26/07, Al [EMAIL PROTECTED] wrote: Would it not be better to create the file with tmpfile() and to put it in the system /tmp dir; which, I believe, is generally not in the webspace? The problem here, though, Al, is that it relies on the server admin not to be lazy, and to have the box

[PHP] PHP Brain Teasers

2007-06-26 Thread Daniel Brown
What the hell? Why not start a thread that can be fun and challenging for all of us. It's something I haven't seen done anywhere else yet, but I wouldn't be surprised if it has been. Let's put together some names, phrases, and other stuff expressed as PHP code and see who can come up with a

Re: [PHP] Create .php file with php

2007-06-26 Thread Daniel Brown
On 6/26/07, Al Rider [EMAIL PROTECTED] wrote: I thought that the php engine took care of deleting tmp files when the script ended. Thus, if his script is terminated before his code deletes the file, the engine will insure it's deleted. Otherwise, he should use an ignore_user_abort().

Re: [PHP] PHP Brain Teasers

2007-06-26 Thread Tijnema
On 6/26/07, Daniel Brown [EMAIL PROTECTED] wrote: What the hell? Why not start a thread that can be fun and challenging for all of us. It's something I haven't seen done anywhere else yet, but I wouldn't be surprised if it has been. Let's put together some names, phrases, and other stuff

RE: [PHP] PHP Brain Teasers

2007-06-26 Thread Jim Moseby
So here's the first one (it's simple): ? function at($level) { $level == 10 ? $ret = winner : ''; $level == 15 ? $ret = try : ''; $level == 20 ? $ret = first : ''; $level == 25 ? $ret = user : ''; $level == 30 ? $ret = place : '';

Re: [PHP] PHP Brain Teasers

2007-06-26 Thread Daniel Brown
On 6/26/07, Tijnema [EMAIL PROTECTED] wrote: On 6/26/07, Daniel Brown [EMAIL PROTECTED] wrote: What the hell? Why not start a thread that can be fun and challenging for all of us. It's something I haven't seen done anywhere else yet, but I wouldn't be surprised if it has been. Let's

Re: [PHP] Create .php file with php [POC CODE INCLUDED]

2007-06-26 Thread Daniel Brown
On 6/26/07, Al Rider [EMAIL PROTECTED] wrote: I think most systems have a /tmp directory above the web dir, so outsiders can't watch it anyhow. True, but on an unsecured box, this becomes possible, as Apache will most likely be running universally as `nobody`, `httpd`, `apache`, or `daemon`

RE: [PHP] PHP Brain Teasers

2007-06-26 Thread Jim Moseby
Jim, I didn't get any parse errors when I tested it, it just output the stuff. You're right though that is what they say Bah - thwarted (again) by PHP4. :( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP Brain Teasers

2007-06-26 Thread Daniel Brown
On 6/26/07, Jim Moseby [EMAIL PROTECTED] wrote: Jim, I didn't get any parse errors when I tested it, it just output the stuff. You're right though that is what they say Bah - thwarted (again) by PHP4. :( How so? I didn't use any 5th Generation-specific code --

Re: [PHP] PHP Brain Teasers

2007-06-26 Thread Jochem Maas
Daniel Brown wrote: On 6/26/07, Jim Moseby [EMAIL PROTECTED] wrote: Jim, I didn't get any parse errors when I tested it, it just output the stuff. You're right though that is what they say Bah - thwarted (again) by PHP4. :( How so? I didn't use any 5th

Re: [PHP] Create .php file with php [POC CODE INCLUDED]

2007-06-26 Thread Crayon Shin Chan
On Wednesday 27 June 2007 03:53, Daniel Brown wrote: On 6/26/07, Al Rider [EMAIL PROTECTED] wrote: I think most systems have a /tmp directory above the web dir, so outsiders can't watch it anyhow. True, but on an unsecured box, this becomes possible, as Apache will most likely be

RE: [PHP] PHP Brain Teasers

2007-06-26 Thread Jim Moseby
On 6/26/07, Jim Moseby [EMAIL PROTECTED] wrote: Jim, I didn't get any parse errors when I tested it, it just output the stuff. You're right though that is what they say Bah - thwarted (again) by PHP4. :( How so? I didn't use any 5th Generation-specific

Re: [PHP] PHP Brain Teasers

2007-06-26 Thread Tijnema
On 6/26/07, Jim Moseby [EMAIL PROTECTED] wrote: On 6/26/07, Jim Moseby [EMAIL PROTECTED] wrote: Jim, I didn't get any parse errors when I tested it, it just output the stuff. You're right though that is what they say Bah - thwarted (again) by PHP4. :(

[PHP] Re: PHP Brain Teasers

2007-06-26 Thread Colin Guthrie
Daniel Brown wrote: What the hell? Why not start a thread that can be fun and challenging for all of us. How about this: ?php define('MONY', 20); $mickle = 0 while(++$mickle) { if (MONY == $mickle) { echo Muckle; exit; } } ? It's a bit more obscure ;) -- PHP General

[PHP] Re: PHP Brain Teasers

2007-06-26 Thread Dan
How are we going to respond to these? Should we answer or just kepe them to ourselves. SPOILER** Answer: Many a mickle makes a muckle? Colin Guthrie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Daniel Brown wrote: What the hell? Why not start a thread that

Re: [PHP] Create .php file with php [POC CODE INCLUDED]

2007-06-26 Thread Daniel Brown
On 6/26/07, Crayon Shin Chan [EMAIL PROTECTED] wrote: On Wednesday 27 June 2007 03:53, Daniel Brown wrote: On 6/26/07, Al Rider [EMAIL PROTECTED] wrote: I think most systems have a /tmp directory above the web dir, so outsiders can't watch it anyhow. True, but on an unsecured box,

Re: [PHP] Re: PHP Brain Teasers

2007-06-26 Thread Daniel Brown
On 6/26/07, Dan [EMAIL PROTECTED] wrote: How are we going to respond to these? Should we answer or just kepe them to ourselves. SPOILER** Answer: Many a mickle makes a muckle? Colin Guthrie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Daniel Brown wrote: What

Re: [PHP] Create .php file with php [POC CODE INCLUDED]

2007-06-26 Thread Edward Vermillion
On Jun 26, 2007, at 3:31 PM, Crayon Shin Chan wrote: On Wednesday 27 June 2007 03:53, Daniel Brown wrote: On 6/26/07, Al Rider [EMAIL PROTECTED] wrote: I think most systems have a /tmp directory above the web dir, so outsiders can't watch it anyhow. True, but on an unsecured box, this

[PHP] Re: PHP Brain Teasers (SPOILER)

2007-06-26 Thread Colin Guthrie
Dan wrote: How are we going to respond to these? Should we answer or just kepe them to ourselves. SPOILER** Answer: Many a mickle makes a muckle? SPOILER in the title is a good idea! I was going for Mony a mickle maks a muckle hence the name of my constant, but I'll give

[PHP] Re: PHP Brain Teasers

2007-06-26 Thread Colin Guthrie
Daniel Brown wrote: What the hell? Why not start a thread that can be fun and challenging for all of us. It's something I haven't seen done Here's another quickie: Dead simple one! ?php function x($x) { switch ($x) { case 1: return 'bitten'; case 2: return 'shy'; } } --

Re: [PHP] Create .php file with php [POC CODE INCLUDED]

2007-06-26 Thread Adam Schroeder
... if you really couldn't write it as dynamic PHP -- you could also save it in a database. Edward Vermillion wrote: On Jun 26, 2007, at 3:31 PM, Crayon Shin Chan wrote: On Wednesday 27 June 2007 03:53, Daniel Brown wrote: On 6/26/07, Al Rider [EMAIL PROTECTED] wrote: I think most

Re: [PHP] Re: PHP Brain Teasers

2007-06-26 Thread Robert Cummings
On Wed, 2007-06-27 at 00:24 +0100, Colin Guthrie wrote: Daniel Brown wrote: What the hell? Why not start a thread that can be fun and challenging for all of us. It's something I haven't seen done Here's another quickie: Dead simple one! ?php function x($x) { switch ($x) {

[PHP] Re: PHP Brain Teasers

2007-06-26 Thread Colin Guthrie
Daniel Brown wrote: What the hell? Why not start a thread that can be fun and challenging for all of us. One more before bed: class pin { private $mVisible; private $mInstantiateTime; public function __construct() { $this-mInstantiateTime = floor(time() / 86400) * 86400;

[PHP] Re: PHP Brain Teasers

2007-06-26 Thread Colin Guthrie
Colin Guthrie wrote: Daniel Brown wrote: What the hell? Why not start a thread that can be fun and challenging for all of us. One more before bed: class pin { private $mVisible; private $mInstantiateTime; public function __construct() { $this-mInstantiateTime =

[PHP] Re: PHP Brain Teasers

2007-06-26 Thread Colin Guthrie
Robert Cummings wrote: On Wed, 2007-06-27 at 00:24 +0100, Colin Guthrie wrote: Daniel Brown wrote: What the hell? Why not start a thread that can be fun and challenging for all of us. It's something I haven't seen done Here's another quickie: Dead simple one! ?php function x($x) {

Re: [PHP] PHP Brain Teasers

2007-06-26 Thread Eric Newberry
I think I have to answer to this one: 'If at first you don't succeed try, try again'. Eric ? function at($level) { $level == 10 ? $ret = winner : ''; $level == 15 ? $ret = try : ''; $level == 20 ? $ret = first : ''; $level == 25 ? $ret = user : ''; $level

Re: [PHP] PHP Brain Teasers

2007-06-26 Thread Robert Cummings
On Tue, 2007-06-26 at 17:00 -0700, Eric Newberry wrote: I think I have to answer to this one: 'If at first you don't succeed try, try again'. Here's another one... ?php $x = rand( 1, 20 ); for( $i = 0; $i $x; $i++ ); while( --$i 0 ); ? Cheers, Rob. --

[PHP] Problems with mirror site script

2007-06-26 Thread Wikus Möller
Hi. I am currently writing a script to put on my site so people can browse other sites by using my site as a mirror therefore the contents of a webpage would be retrieved and echoed on my site. I am having some problems with placing my ad at the top of the page that is echoed when a user

Re: [PHP] PHP Brain Teasers

2007-06-26 Thread Eric Newberry
- Original Message - From: Robert Cummings [EMAIL PROTECTED] To: Eric Newberry [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Tuesday, June 26, 2007 5:14 PM Subject: Re: [PHP] PHP Brain Teasers On Tue, 2007-06-26 at 17:00 -0700, Eric Newberry wrote: I think I have to answer

Re: [PHP] Aggressive PHP Smart Caching

2007-06-26 Thread Alexander Romanovich
Thank you for your reply Nathan. You are right that this method of caching is different than the two types you have outlined below. I would not say that it is a new method though, in fact, pushing static files to the server is very common. If it weren't for the fact that this method, as I