Re: [PHP] Military - Standard times

2009-01-22 Thread Richard Heyes
PS - I think the best ever name for a Exception class is 'Tantrum': throw new Tantrum('Ra Ra Ra Aaaargh'); Lol. -- Richard Heyes HTML5 Graphing for Firefox, Chrome, Opera and Safari: http://www.rgraph.org (Updated January 17th) -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Redirecting from unreachable page on website

2009-01-22 Thread Richard Heyes
... Really, for URLs that don't exist you should be showing a 404, This way the user doesn't falsely believe that the URL is a valid one and keep using it. By using the ErrorDocument directive like Per suggested, you can customise it to be distinct helpful, like this:

Re: [PHP] About printing functions

2009-01-22 Thread Jan G.B.
2009/1/21 Thodoris t...@kinetix.gr: ?php ob_start(); badFunctionThatSpitsInsteadOfReturning(); $sReturned = ob_get_contents(); ob_end_clean(); ? That's a good though thanks. Although I was aware of output buffering I used to ignore that ob_end_clean actually exists... You can

Re: [PHP] Redirecting from unreachable page on website

2009-01-22 Thread Per Jessen
Richard Heyes wrote: ... Really, for URLs that don't exist you should be showing a 404, This way the user doesn't falsely believe that the URL is a valid one and keep using it. By using the ErrorDocument directive like Per suggested, you can customise it to be distinct helpful Apache also

Re: [PHP] Re: How to use SVN + PHP

2009-01-22 Thread derby
Another tidbit... I am fairly new to SVN or any Version Control System. Whether its CVS, SVN, or GIT a VCS is essential even for solo projects. My setup is as follows, [and it seems to work pretty well]: 1. svn repo lives on dev server. 2. everything is in the trunk. I haven't touched

Re: [PHP] developers life

2009-01-22 Thread derby
Like many others, you also described exactly how I work. with one exception... php is my only choice for server side scripting / programming. Sure there are others, perhaps better for some things, languages, but I am sticking with PHP through snow, mud, earthquakes, tsunamis, and solar

Re: [PHP] Re: How to use SVN + PHP

2009-01-22 Thread Nathan Rixham
derby wrote: Our dev team is using eclipse-pdt and subclipse plugin which integrates eclipse and subversion. Subversion or any VCS is essential. After 15 years of using FTP/SFTP/SCP, SVN has replaced it for all my web projects. you can get the RSE plugin for eclipse-pdt as well; I'd really

[PHP] Create $var with some function

2009-01-22 Thread Jônatas Zechim
Hi there, Someone know if can (if possible, how) i create a $var on my script like this: function createvar($var) { $var = 'foo'; global $var; //or global $$var, i don't know it yet. } so i'd call, createvar('myvar');

Re: [PHP] Create $var with some function

2009-01-22 Thread Robert Stankiewicz
function createvar($var) { ${$var} = 'foo'; global ${$var}; //or global $$var, i don't know it yet. } This should work. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RES: [PHP] Create $var with some function

2009-01-22 Thread Jônatas Zechim
No, that's not the point yet. -Mensagem original- De: Robert Stankiewicz [mailto:robe...@belfabriek.nl] Enviada em: quinta-feira, 22 de janeiro de 2009 10:49 Para: Jônatas Zechim; php-general@lists.php.net Assunto: Re: [PHP] Create $var with some function function

[PHP] importing from XML-files

2009-01-22 Thread Merlin Morgenstern
Hi everybody, I am creating an import script which is getting data out of an xml file. Now I do have a problem with a file where 2 images are included. I need to access the second image name, but can not find out how. I do: $xml = simplexml_load_file($files[$i]); $data[pic1_base64] =

Re: [PHP] Create $var with some function

2009-01-22 Thread Richard Heyes
Hi, function createvar($name, $value) { $GLOBALS[$name] = $value; } Or do it without a function: $GLOBALS['name'] = $value; -- Richard Heyes HTML5 Graphing for Firefox, Chrome, Opera and Safari: http://www.rgraph.org (Updated January 17th) -- PHP General Mailing List

Re: [PHP] About printing functions

2009-01-22 Thread Török Alpár
2009/1/22 Jan G.B. ro0ot.w...@googlemail.com 2009/1/21 Thodoris t...@kinetix.gr: ?php ob_start(); badFunctionThatSpitsInsteadOfReturning(); $sReturned = ob_get_contents(); ob_end_clean(); ? That's a good though thanks. Although I was aware of output buffering I used

RE: [PHP] importing from XML-files.

2009-01-22 Thread Maren Löchner
Maybe you can itterate over the childnodes from the parent element ? -Original Message- From: Merlin Morgenstern [mailto:merli...@fastmail.fm] Sent: Thursday, January 22, 2009 1:53 PM To: php-general@lists.php.net Subject: [SPAM] - [PHP] importing from XML-files - Der Bayes'sche Filter

Re: [PHP] About printing functions

2009-01-22 Thread Jan G.B.
2009/1/22 Török Alpár torokal...@gmail.com: 2009/1/22 Jan G.B. ro0ot.w...@googlemail.com 2009/1/21 Thodoris t...@kinetix.gr: $sReturned = ob_get_contents(); ob_end_clean(); That's a good though thanks. Although I was aware of output buffering I used to ignore that ob_end_clean

Re: [PHP] Military - Standard times

2009-01-22 Thread tedd
At 12:35 AM +0100 1/22/09, Jochem Maas wrote: tedd schreef: Hey, you called me schreef and that means an end of a stroke (Arrggg, that has all sorts of meanings). :-) which translation service came up with that?? it is funny though :-) http://nl.wikipedia.org/wiki/Schreef --

[PHP] Re: importing from XML-files

2009-01-22 Thread Carlos Medina
Merlin Morgenstern schrieb: Hi everybody, I am creating an import script which is getting data out of an xml file. Now I do have a problem with a file where 2 images are included. I need to access the second image name, but can not find out how. I do: $xml = simplexml_load_file($files[$i]);

Re: [PHP] MySQL class. Thoughts?

2009-01-22 Thread clive
Chris wrote: That won't tell you where a query comes from ;) Add a debug_backtrace into the class to also pinpoint where the query was called from. Complicated queries built on variables (or even just long queries built over multiple lines) will be hard to find just by looking at the mysql

[PHP] Re: importing from XML-files

2009-01-22 Thread Merlin Morgenstern
Carlos Medina wrote: Merlin Morgenstern schrieb: Hi everybody, I am creating an import script which is getting data out of an xml file. Now I do have a problem with a file where 2 images are included. I need to access the second image name, but can not find out how. I do: $xml =

Re: [PHP] Redirecting from unreachable page on website

2009-01-22 Thread Morris
What if the file exists, but it's kinda file to update database, like // get request $_REQUEST // execute sql statement to update database // redirect to the other page, showing results? in this case 404 approach does not mean to do correctly, so what else is suggested? 2009/1/22 Per Jessen

[PHP] can I do this without eval?

2009-01-22 Thread Frank Stanovcak
I'm trying to build a prepared statment and dynamically bind the variables to it since I use this on severaly different pages I didn't want to build a huge bind statement hard coded on each page and then have to maintain it every time there was a change. I despise having to use eval() and was

Re: [PHP] Military - Standard times

2009-01-22 Thread Frank Stanovcak
Richard Heyes rich...@php.net wrote in message news:af8726440901220050i71d99bf7m5425620f67350...@mail.gmail.com... PS - I think the best ever name for a Exception class is 'Tantrum': throw new Tantrum('Ra Ra Ra Aaaargh'); Lol. -- Richard Heyes HTML5 Graphing for Firefox,

[PHP] killing a child process from pcntl_exec

2009-01-22 Thread bruce
Hi.. I fork a child process, using pcntl_exec. I see the process from the cmdline (using pgrep 123), but I can't seem to kill the pid from the cmdline, using kill -9 123.. Is there something that I need to implement within the php test in order for the kill signal to be effective? If I wait,

[PHP] Re: importing from XML-files

2009-01-22 Thread Carlos Medina
Merlin Morgenstern schrieb: Carlos Medina wrote: Merlin Morgenstern schrieb: Hi everybody, I am creating an import script which is getting data out of an xml file. Now I do have a problem with a file where 2 images are included. I need to access the second image name, but can not find out

[PHP] Re: killing a child process from pcntl_exec

2009-01-22 Thread Carlos Medina
bruce schrieb: Hi.. I fork a child process, using pcntl_exec. I see the process from the cmdline (using pgrep 123), but I can't seem to kill the pid from the cmdline, using kill -9 123.. Is there something that I need to implement within the php test in order for the kill signal to be

Re: [PHP] Redirecting from unreachable page on website

2009-01-22 Thread Richard Heyes
What if the file exists, but it's kinda file to update database, like GET requests shouldn't really modify data. -- Richard Heyes HTML5 Graphing for Firefox, Chrome, Opera and Safari: http://www.rgraph.org (Updated January 17th) -- PHP General Mailing List (http://www.php.net/) To

RE: [PHP] Re: killing a child process from pcntl_exec

2009-01-22 Thread bruce
hi carlos.. yeah.. the pid is correct. it appears that spawning/creating a child process using pcntl_exec(foo) results in a child process that you can see running from the cmdline, but that you can't kill using kill -9. php might allow some other function within the parent app to allow the kill

[PHP] PHP 5.2.8 fails to find libiconv

2009-01-22 Thread Ro Achterberg
Hi, I'm attempting to install PHP 5.2.8 on CentOS 5.2 x86_64. The glibc iconv doesn't seem to function very well, leading to a bunch of failed tests when running 'make test' (see below). After a bit of Googling I stumbled upon http://nl2.php.net/manual/en/intro.iconv.php which suggests to

Re: [PHP] developers life

2009-01-22 Thread Daniel Brown
On Thu, Jan 22, 2009 at 06:46, derby derby...@gmail.com wrote: http://www.talkderby2me.com Heh. I like the domain name, Derby. Welcome to the list. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Unadvertised

Re: [PHP] Redirecting from unreachable page on website

2009-01-22 Thread Per Jessen
Morris wrote: What if the file exists, but it's kinda file to update database, like // get request $_REQUEST // execute sql statement to update database // redirect to the other page, showing results? in this case 404 approach does not mean to do correctly, so what else is suggested? I

Re: [PHP] killing a child process from pcntl_exec

2009-01-22 Thread ceo
There are functions/settings in pcntl docs about how to listen for specific signals. If you don't listen for -9, maybe you don't get it. http://php.net/manual/en/function.pcntl-signal.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] PHP IRC Bot - Listening on a Socket

2009-01-22 Thread APseudoUtopia
Hey, I'm writing an IRC bot from scratch in PHP. I'd like to be able to announce events, such as SVN commit notifications, through the bot. The only way to do this that I can think of is to have the bot listen on a socket and have the program (in this example, the SVN post-commit hook script)

RE: [PHP] killing a child process from pcntl_exec

2009-01-22 Thread bruce
i'm pretty sure that's not the issue... i should be able to spawn/fork any kind of external app/process... kill -9 pid, especially if done as root, should terminate the process... i suspect that the issue has to do with zombie processes, and how php/pnctl_exec/etc.. operates. -Original

Re: [PHP] can I do this without eval?

2009-01-22 Thread Nathan Nobbe
On Thu, Jan 22, 2009 at 8:35 AM, Frank Stanovcak blindspot...@comcast.netwrote: I'm trying to build a prepared statment and dynamically bind the variables to it since I use this on severaly different pages I didn't want to build a huge bind statement hard coded on each page and then have to

Re: [PHP] can I do this without eval?

2009-01-22 Thread Frank Stanovcak
Nathan Nobbe quickshif...@gmail.com wrote in message news:7dd2dc0b0901221048g2f089cf9s36ecb9a5b35ab...@mail.gmail.com... On Thu, Jan 22, 2009 at 8:35 AM, Frank Stanovcak blindspot...@comcast.netwrote: I'm trying to build a prepared statment and dynamically bind the variables to it since I

[PHP] Re: killing a child process from pcntl_exec

2009-01-22 Thread Nathan Rixham
bruce wrote: Hi.. I fork a child process If I wait, the child eventually dies.. but I'd like to be able to kill it thoughts/pointers/comments... thanks yeah - stop killing children -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] php spawing/forking issues

2009-01-22 Thread bruce
Hi... Playing around with a test app to spawn external child processes. I'd like to be able to spawn/fork/run am external child process, that: -allows the child processes to run as separate independent processes (pid) -allows the child process(es) to be terminated via cmdline (kill -9 pid)

Re: [PHP] can I do this without eval?[RESOLVED]

2009-01-22 Thread Frank Stanovcak
Nathan Nobbe quickshif...@gmail.com wrote in message news:7dd2dc0b0901221048g2f089cf9s36ecb9a5b35ab...@mail.gmail.com... yeah, id try call_user_func_array(), omit the line to create a string out of the $params, then merge the later arguments into an array w/ the first 2 args #$params =

Re: [PHP] distinguish between null variable and unset variable

2009-01-22 Thread Shawn McKenzie
Daniel Brown wrote: On Wed, Jan 21, 2009 at 20:27, Jack Bates ms...@freezone.co.uk wrote: How can I tell the difference between a variable whose value is null and a variable which is not set? Unfortunately, in PHP - like other languages - you can't. A variable is considered to be

Re: [PHP] distinguish between null variable and unset variable

2009-01-22 Thread Shawn McKenzie
Shawn McKenzie wrote: Daniel Brown wrote: On Wed, Jan 21, 2009 at 20:27, Jack Bates ms...@freezone.co.uk wrote: How can I tell the difference between a variable whose value is null and a variable which is not set? Unfortunately, in PHP - like other languages - you can't. A variable

Re: [PHP] distinguish between null variable and unset variable

2009-01-22 Thread Daniel Brown
On Thu, Jan 22, 2009 at 15:11, Shawn McKenzie nos...@mckenzies.net wrote: Or something like this (dunno, just brainstorming): function setornull($var) { if (!isset($var)) { return false; } elseif (is_null($var)) { return null; }

Re: [PHP] distinguish between null variable and unset variable

2009-01-22 Thread Daniel Brown
On Thu, Jan 22, 2009 at 15:12, Daniel Brown danbr...@php.net wrote: Unfortunately, neither solution would work. isset() will return FALSE even for an instantiated and explicitly-defined NULL variable. Forgot to mention that, in addition, is_null() will return TRUE for both

Re: [PHP] distinguish between null variable and unset variable

2009-01-22 Thread Shawn McKenzie
Daniel Brown wrote: On Thu, Jan 22, 2009 at 15:11, Shawn McKenzie nos...@mckenzies.net wrote: Or something like this (dunno, just brainstorming): function setornull($var) { if (!isset($var)) { return false; } elseif (is_null($var)) {

Re: [PHP] distinguish between null variable and unset variable

2009-01-22 Thread Shawn McKenzie
Daniel Brown wrote: On Thu, Jan 22, 2009 at 15:12, Daniel Brown danbr...@php.net wrote: Unfortunately, neither solution would work. isset() will return FALSE even for an instantiated and explicitly-defined NULL variable. Forgot to mention that, in addition, is_null() will return TRUE

Re: [PHP] can I do this without eval?

2009-01-22 Thread Nathan Nobbe
On Thu, Jan 22, 2009 at 12:06 PM, Frank Stanovcak blindspot...@comcast.netwrote: Nathan Nobbe quickshif...@gmail.com wrote in message news:7dd2dc0b0901221048g2f089cf9s36ecb9a5b35ab...@mail.gmail.com... On Thu, Jan 22, 2009 at 8:35 AM, Frank Stanovcak blindspot...@comcast.netwrote: I'm

Re: [PHP] distinguish between null variable and unset variable

2009-01-22 Thread Carlos Medina
Shawn McKenzie schrieb: Daniel Brown wrote: On Thu, Jan 22, 2009 at 15:12, Daniel Brown danbr...@php.net wrote: Unfortunately, neither solution would work. isset() will return FALSE even for an instantiated and explicitly-defined NULL variable. Forgot to mention that, in addition,

[PHP] Re: php spawing/forking issues

2009-01-22 Thread Nathan Rixham
bruce wrote: Hi... Playing around with a test app to spawn external child processes. I'd like to be able to spawn/fork/run am external child process, that: -allows the child processes to run as separate independent processes (pid) -allows the child process(es) to be terminated via cmdline

Re: [PHP] Redirecting from unreachable page on website

2009-01-22 Thread Jochem Maas
Richard Heyes schreef: ... Really, for URLs that don't exist you should be showing a 404, This way the user doesn't falsely believe that the URL is a valid one and keep using it. if the invalid URL (which outputs a 404 header) then automatically redirects to another URL then I think it's

Re: [PHP] To check for existing user in database

2009-01-22 Thread Lars Torben Wilson
2009/1/16 Shawn McKenzie nos...@mckenzies.net: Lars Torben Wilson wrote: 2009/1/15 tedd tedd.sperl...@gmail.com: At 9:46 AM -0800 1/15/09, Chris Carter wrote: Chris: That's not the way I would do it. After establishing a connection with the database, I would use the query: $query SELECT