[PHP] Stupid question of the day (Editing text file in $HOME via web)

2006-10-30 Thread Google Kreme
I have a text file on a server that I want someone to be able to edit via the web. I need it to have some modicum of security, but it's nothing particularly important and security is not the main concern. I am perfectly willing to simply http-auth it, if need be. But it need to be easily

Re: [PHP] Imagecopyresampled creates black pictures

2006-10-30 Thread Martin Hochreiter
tedd schrieb: At 9:52 AM +0100 10/30/06, Martin Hochreiter wrote: What is wrong here? Martin: Damn, that's a lot of code to do something pretty simple. I had no problems uploading and resampling your image with a lot less. Try using ob_start() and ob_end() to grab your image.: ob_start();

Re: [PHP] Decide witch table within a union

2006-10-30 Thread Børge Holen
On Tuesday 31 October 2006 02:27, Ed Lazor wrote: > > Someone asked what it was to be used for. > > It's for combining 4 forums into one witch shows the latest > > movement among > > them. More like an introduction sort of... > > Sounds cool. Are you using a pre-made forum package? No Maby it'd

Re: [PHP] help confirming a PDO_SQLITE bug

2006-10-30 Thread Rick Fletcher
Thanks to anyone who entertained my previous email, but I've solved my own problem. It looks like the bug is in PDO_SQLITE 1.0.1. I've just compiled from that extension from CVS, changing nothing else, and the bug is gone. --rick Rick Fletcher wrote: I've just upgraded to Fedora Core 6 and

[PHP] help confirming a PDO_SQLITE bug

2006-10-30 Thread Rick Fletcher
I've just upgraded to Fedora Core 6 and my personal site broke. Along with the upgrade came PHP 5.1.6 and SQLite 3.3.6. After the upgrade any SELECT returns all its values with the last character missing. I've filed a bug at pecl.php.net (http://pecl.php.net/bugs/bug.php?id=9191), but it doe

Re: [PHP] How do I get ini_set('output_handler', '') to work?!

2006-10-30 Thread Ed Lazor
I suppose I could re-compile my command line version with a different php.ini file, but that's kind of lame that I have to have two php.ini files for what ini_set() SHOULD handle. Would modifications via .htaccess work for you? -Ed -- PHP General Mailing List (http://www.php.net/) To unsubs

Re: [PHP] str_replace on words with an array

2006-10-30 Thread Ed Lazor
On Oct 30, 2006, at 1:10 PM, Dotan Cohen wrote: On 30/10/06, Stut <[EMAIL PROTECTED]> wrote: Ed Lazor wrote: > It looks like you guys are coming up with some cool solutions, but I > have a question. Wasn't the original purpose of this thread to > prevent sql injection attacks in input from

Re: [PHP] Run script every 30 seconds

2006-10-30 Thread Ed Lazor
On Oct 30, 2006, at 10:26 AM, Ahmad Al-Twaijiry wrote: is it possible to link the script to my php interface (the one that the users is using it) and if the php interface page will run the script (IN background) if it didn't run for the last 30 seconds ? I see this is very hard and almost impos

Re: [PHP] only one at atime

2006-10-30 Thread Ed Lazor
On Oct 30, 2006, at 10:14 AM, Ahmad Al-Twaijiry wrote: Hi everyone, I create a php script that will run every minute (by cronjob) and update some database tables (php 5, database mysql 5, tables type innodb) the problem is that I want this script to run only one at atime (only one process fro

Re: [PHP] Decide witch table within a union

2006-10-30 Thread Ed Lazor
Someone asked what it was to be used for. It's for combining 4 forums into one witch shows the latest movement among them. More like an introduction sort of... Sounds cool. Are you using a pre-made forum package? -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: h

RE: [PHP] How do I get ini_set('output_handler', '') to work?!

2006-10-30 Thread Daevid Vincent
Thank you for the reply Richard (and Tom). That news sucks however. Seems that the PHP pre-parser should handle this better. It's not like it's a one-pass parser (like Ruby). " . ini_get('output_handler') . "\n"; ?> I suppose I could re-compile my command line version with a different php.ini

Re: [PHP] str_replace on words with an array

2006-10-30 Thread Larry Garfield
On Monday 30 October 2006 15:10, Dotan Cohen wrote: > Er, so how would it be done? I've been trying for two days now with no > success. From your original message, it sounds like you want to strip selected complete words, not substrings, from a string for indexing or searching or such. Right?

Re: [PHP] Re: A general UL script

2006-10-30 Thread Børge Holen
Thanks alot Richard. As you mention it I've had some encounters with the _ filenames... I did get it to work after a fasion, but yes I took quite some headache to make it work. For the JS part of the script I could just getElementById witch leave me open for the name to use on my problems as you

Re: [PHP] Re: A general UL script

2006-10-30 Thread Richard Lynch
On Mon, October 30, 2006 5:13 am, Børge Holen wrote: > * First it insert an empty file field (hidden). This seems silly, but whatever. > * Second, I rename all files to an md5 hash. > * Third, The md5 hash makes legal filenames witch enables my toolset > to modify > modify/validate my jpg. And

Re: [PHP] str_replace on words with an array

2006-10-30 Thread Ed Lazor
On Oct 30, 2006, at 9:19 AM, Stut wrote: Ed Lazor wrote: It looks like you guys are coming up with some cool solutions, but I have a question. Wasn't the original purpose of this thread to prevent sql injection attacks in input from user forms? If so, wouldn't mysql_real_escape_string b

Re: [PHP] Run script every 30 seconds

2006-10-30 Thread Richard Lynch
On Mon, October 30, 2006 11:29 am, Ahmad Al-Twaijiry wrote: > I have a script that I want it to run every 30 seconds, the problem is > that cronjob can run every 1 minute only, do you have any solution ? Run a script that never quits with: http://php.net/usleep while (true){ //your script here

Re: [PHP] only one at atime

2006-10-30 Thread Richard Lynch
On Mon, October 30, 2006 12:14 pm, Ahmad Al-Twaijiry wrote: > I create a php script that will run every minute (by cronjob) and > update some database tables (php 5, database mysql 5, tables type > innodb) > > the problem is that I want this script to run only one at atime (only > one process from

Re: [PHP] str_replace on words with an array

2006-10-30 Thread Stut
Dotan Cohen wrote: > Er, so how would it be done? I've been trying for two days now with no > success. Ok, I guess my original reply didn't get through, or you ignored it. Here it is again for your convenience. Dotan Cohen wrote: > > $searchQuery=str_replace( "^".$noiseArray."$", " ", $searchQuer

Re: [PHP] str_replace on words with an array

2006-10-30 Thread Dotan Cohen
On 30/10/06, Stut <[EMAIL PROTECTED]> wrote: Ed Lazor wrote: > It looks like you guys are coming up with some cool solutions, but I > have a question. Wasn't the original purpose of this thread to > prevent sql injection attacks in input from user forms? If so, > wouldn't mysql_real_escape_stri

Re: [PHP] Run script every 30 seconds

2006-10-30 Thread David Otton
On Mon, 30 Oct 2006 21:26:29 +0300, Ahmad Al-Twaijiry wrote: The "right" way to do this, as others have mentioned, is with a daemon. Having said that... >is it possible to link the script to my php interface (the one that >the users is using it) and if the php interface page will run the >script

Re: [PHP] Run script every 30 seconds

2006-10-30 Thread Mitch Miller
Or, you could run two scripts every minute ... one that starts immediately, and one that sleeps for 30s before starting. -- Mitch Dave Hamber wrote: You could run the script as a daemon. man daemon. The sloppy way of running the script every 30 seconds would be to use sleep(30), but that w

Re: [PHP] Run script every 30 seconds

2006-10-30 Thread John Nichel
Ahmad Al-Twaijiry wrote: Hi everyone, I have a script that I want it to run every 30 seconds, the problem is that cronjob can run every 1 minute only, do you have any solution ? Use atd. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL P

Re: [PHP] counting records in db

2006-10-30 Thread Robert Cummings
On Mon, 2006-10-30 at 12:28 +0100, Robin Vickery wrote: > On 30/10/06, Ivo F.A.C. Fokkema <[EMAIL PROTECTED]> wrote: > > On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote: > > > > > On Fri, October 27, 2006 4:53 pm, Børge Holen wrote: > > >> On Friday 27 October 2006 19:34, Richard Lynch wrot

Re: [PHP] only one at atime

2006-10-30 Thread Brad Bonkoski
Ahmad Al-Twaijiry wrote: Hi everyone, I create a php script that will run every minute (by cronjob) and update some database tables (php 5, database mysql 5, tables type innodb) the problem is that I want this script to run only one at atime (only one process from this script can run ) for exa

Re: [PHP] Run script every 30 seconds

2006-10-30 Thread Dave Hamber
You could run the script as a daemon. man daemon. The sloppy way of running the script every 30 seconds would be to use sleep(30), but that would cause the script to run at 30 seconds + execution time. If you make a loop like this you could get around that: $t=time()+31; while(true){

Re: [PHP] Run script every 30 seconds

2006-10-30 Thread Dr. Suhas Pharkute
You can still use Cronjob with 1 min setting and in use 2 processes 1. Run script immediately 2. Sleep for 30 sec and then run the script you can use exec/shell_exec functions with output redirected to soem file so that It will run in background. That way you have one process running at 0 sec a

Re: [PHP] Run script every 30 seconds

2006-10-30 Thread Ahmad Al-Twaijiry
Thank you all but the problem is that I don't have root access to the server to create daemon :) so if I just run the script in background with 30 seconds sleep and someone reboot the server (or the script dies for any reason ) I will lose my process :) any other ideas ? is it possible to li

[PHP] only one at atime

2006-10-30 Thread Ahmad Al-Twaijiry
Hi everyone, I create a php script that will run every minute (by cronjob) and update some database tables (php 5, database mysql 5, tables type innodb) the problem is that I want this script to run only one at atime (only one process from this script can run ) for example, if the cronjob start

Re: [PHP] Run script every 30 seconds

2006-10-30 Thread Dave Hamber
Sorry, slight adjustment, make that $t=time()-31; in the first line so that the script runs immediately. > You could run the script as a daemon. man daemon. > > The sloppy way of running the script every 30 seconds would be to use sleep(30), but that would cause the script to run at 30 seconds

Re: [PHP] PHP Search Engine - Synonyms

2006-10-30 Thread Ed Lazor
On Oct 30, 2006, at 6:26 AM, Kevin wrote: Hi, Is it possible to automatically search for synonyms related to a word in a search engine for example if I create a search engine and search for the word 'Horse', it would automatically search for other words such as 'Pony' etc? It is possib

Re: [PHP] Run script every 30 seconds

2006-10-30 Thread James Tu
I've never tried this myself, but how about having the cron job kick off a script which will run script A and script B Script A runs right away, and script B runs after a delay of 30 seconds ( usleep(30* 100) )? -James On Oct 30, 2006, at 12:29 PM, Ahmad Al-Twaijiry wrote: Hi everyone,

RE: [PHP] Run script every 30 seconds

2006-10-30 Thread zoticaicpassion
I'd create a PHP service that stays on the background :), ensuring that such service never goes off from time to time will be the job of the cron job, a little dirty, but works for me. HTH -Original Message- From: Ahmad Al-Twaijiry [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 31, 200

Re: [PHP] Run script every 30 seconds

2006-10-30 Thread Chris Boget
I have a script that I want it to run every 30 seconds, the problem is that cronjob can run every 1 minute only, do you have any solution ? Set the script up as a 2 iteration loop with sleep( 30 ) at the end of the first iteration. Or something like that... thnx, Chris -- PHP General Mail

Re: [PHP] Decide witch table within a union

2006-10-30 Thread Børge Holen
On Monday 30 October 2006 05:46, Richard Lynch wrote: > On Sun, October 29, 2006 3:34 pm, Børge Holen wrote: > > Hi. > > I got this working (almost) > > How do I decide (inside?) the whileloop the table_nr, 1 to 4 witch the > > link is > > echo'ed from. > > > > I could add another field in each tab

[PHP] Run script every 30 seconds

2006-10-30 Thread Ahmad Al-Twaijiry
Hi everyone, I have a script that I want it to run every 30 seconds, the problem is that cronjob can run every 1 minute only, do you have any solution ? -- Ahmad http://www.v-tadawul.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Is there such a thing?

2006-10-30 Thread Ed Lazor
On Oct 29, 2006, at 9:22 PM, Richard Lynch wrote: On Fri, October 27, 2006 5:46 pm, Integz wrote: http://www.evilbitz.com/2006/10/27/local-php-standalone-binaries-2/ I responded in that forum. Short Version: No. Check out: http://gtk.php.net/ Do these qualify? http://www.roadsend.com/h

Re: [PHP] str_replace on words with an array

2006-10-30 Thread Stut
Ed Lazor wrote: It looks like you guys are coming up with some cool solutions, but I have a question. Wasn't the original purpose of this thread to prevent sql injection attacks in input from user forms? If so, wouldn't mysql_real_escape_string be an easier solution? Me thinkie nottie. From

Re: [PHP] str_replace on words with an array

2006-10-30 Thread Ed Lazor
It looks like you guys are coming up with some cool solutions, but I have a question. Wasn't the original purpose of this thread to prevent sql injection attacks in input from user forms? If so, wouldn't mysql_real_escape_string be an easier solution? On Oct 30, 2006, at 8:17 AM, Jochem

Re: [PHP] str_replace on words with an array

2006-10-30 Thread Jochem Maas
Dotan Cohen wrote: > I need to remove the noise words from a search string. I can't seem to > get str_replace to go through the array and remove the words, and I'd > rather avoid a redundant foreach it I can. According to TFM > str_replace should automatically go through the whole array, no? Does >

Re: [PHP] str_replace on words with an array

2006-10-30 Thread Jochem Maas
Dotan Cohen wrote: > I need to remove the noise words from a search string. I can't seem to > get str_replace to go through the array and remove the words, and I'd > rather avoid a redundant foreach it I can. According to TFM > str_replace should automatically go through the whole array, no? Does >

Re: [PHP] strange problem with count()

2006-10-30 Thread tedd
At 1:27 PM +0100 10/29/06, Gunnar Beushausen wrote: Hi! I've a strange problem with count. I wrote a routine to jump to the last position of an array. The code ist this: -snip- Gunnar: I find it wise to check out all the built-in array functions before starting to write something myself -

Re: [PHP] Imagecopyresampled creates black pictures

2006-10-30 Thread tedd
At 9:52 AM +0100 10/30/06, Martin Hochreiter wrote: What is wrong here? Martin: Damn, that's a lot of code to do something pretty simple. I had no problems uploading and resampling your image with a lot less. Try using ob_start() and ob_end() to grab your image.: ob_start(); imagejpeg($n

Re: [PHP] Encoding PC-850

2006-10-30 Thread Dotan Cohen
On 30/10/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi! I need to be able to encode text to PC-850 but I have big trouble finding out info about this encoding. Does it even exist? I get a few google hits, but nothing useful. Any idea of how I can convert for example an UTF-8 string or an

Re: [PHP] Encoding PC-850

2006-10-30 Thread Ed Lazor
Would this help? http://us3.php.net/manual/en/function.mb-convert-encoding.php On Oct 30, 2006, at 7:21 AM, [EMAIL PROTECTED] wrote: Hi! I need to be able to encode text to PC-850 but I have big trouble finding out info about this encoding. Does it even exist? I get a few google hits, but

Re: [PHP] Imagecopyresampled creates black pictures

2006-10-30 Thread Martin Hochreiter
Ed Lazor schrieb: On Oct 30, 2006, at 12:52 AM, Martin Hochreiter wrote: Hi! I'm using imagecopyresampled to create thumbnails of various pictures. That works well except some pictures that imagecopyresampled converts to small black thumbnails (although it converts it correctly to a bigger s

[PHP] Encoding PC-850

2006-10-30 Thread emil
Hi! I need to be able to encode text to PC-850 but I have big trouble finding out info about this encoding. Does it even exist? I get a few google hits, but nothing useful. Any idea of how I can convert for example an UTF-8 string or an ISO-8859-1 to this PC-850 format? Thanks for any input.

RE: [PHP] Is there such a thing?

2006-10-30 Thread Jay Blanchard
[snip] http://www.evilbitz.com/2006/10/27/local-php-standalone-binaries-2/ http://gtk.php.net/ [/snip] http://www.priadoblender.com/index.php?layout=main&cslot_1=2 is another 'option' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP Search Engine - Synonyms

2006-10-30 Thread Ed Lazor
Another idea from what I just sent: try googling "synonym database". It looks like there are a few leads in there as well. On Oct 30, 2006, at 6:26 AM, Kevin wrote: Hi, Is it possible to automatically search for synonyms related to a word in a search engine for example if I create a sear

[PHP] PHP Search Engine - Synonyms

2006-10-30 Thread Kevin
Hi, Is it possible to automatically search for synonyms related to a word in a search engine for example if I create a search engine and search for the word 'Horse', it would automatically search for other words such as 'Pony' etc? Has anyone had any experience on how this would be implement

Re: [PHP] Imagecopyresampled creates black pictures

2006-10-30 Thread Ed Lazor
On Oct 30, 2006, at 12:52 AM, Martin Hochreiter wrote: Hi! I'm using imagecopyresampled to create thumbnails of various pictures. That works well except some pictures that imagecopyresampled converts to small black thumbnails (although it converts it correctly to a bigger size) What is wrong

Re: [PHP] Re: A general UL script

2006-10-30 Thread Børge Holen
On Monday 30 October 2006 06:08, Richard Lynch wrote: > On Sat, October 28, 2006 4:06 pm, Børge Holen wrote: > > I'm trying to validate wether or not to run the image check script. > > however empty the file field(s) are This script is started... how do I > > tell it > > there is nothing here, go d

Re: [PHP] counting records in db

2006-10-30 Thread Robin Vickery
On 30/10/06, Ivo F.A.C. Fokkema <[EMAIL PROTECTED]> wrote: On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote: > On Fri, October 27, 2006 4:53 pm, Børge Holen wrote: >> On Friday 27 October 2006 19:34, Richard Lynch wrote: >>> And the header("Location: ...") requires a full URL. >> >> No it

[PHP] Imagecopyresampled creates black pictures

2006-10-30 Thread Martin Hochreiter
Hi! I'm using imagecopyresampled to create thumbnails of various pictures. That works well except some pictures that imagecopyresampled converts to small black thumbnails (although it converts it correctly to a bigger size) What is wrong here? lg Martin (Suse Linux 10.1, Apache 2.2, gd 2.0.32

RE: [PHP] Query question

2006-10-30 Thread Ivo F.A.C. Fokkema
On Sun, 29 Oct 2006 23:04:27 -0600, Richard Lynch wrote: > On Sun, October 29, 2006 2:06 am, Beauford wrote: >> LOL, I don't know either. The format is - 01/01/2006. When I first did >> it I >> used 7, which should be right, but I ended up getting /2002 /2003, >> etc. So I >> went to 8 and all was

Re: [PHP] counting records in db

2006-10-30 Thread Ivo F.A.C. Fokkema
On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote: > On Fri, October 27, 2006 4:53 pm, Børge Holen wrote: >> On Friday 27 October 2006 19:34, Richard Lynch wrote: >>> And the header("Location: ...") requires a full URL. >> >> No it doesn't. but he's missing an ' at first glance > > Yes, it