Re: [PHP] How do I remove a string from another string in a fuzzy way?

2013-05-21 Thread Tedd Sperling
On May 20, 2013, at 10:17 PM, Daevid Vincent wrote: Initially I was thinking that somehow I could use a simple regex on the > needle and haystacks to strip out all white space and str_ireplace() them > that way, but then I don't have a way to put the whitespace back that I can > see. Daevid: Go

RE: [PHP] How do I remove a string from another string in a fuzzy way?

2013-05-20 Thread Daevid Vincent
> -Original Message- > From: muquad...@gmail.com [mailto:muquad...@gmail.com] On Behalf Of shiplu > Sent: Monday, May 20, 2013 9:03 PM > To: Daevid Vincent > Cc: php-general General List > Subject: Re: [PHP] How do I remove a string from another string in a fuzzy &

Re: [PHP] How do I remove a string from another string in a fuzzy way?

2013-05-20 Thread shiplu
Is your ticketing system written from scratch? Because such type of logic is already implemented in existing help desk softwares. I think you can also use a specific string in your email to define which part goes in ticket and which part not. For example, you can include "PLEASE REPLY ABOVE THIS L

RE: [PHP] How do I do count the occurrence of each word?

2012-08-20 Thread Ford, Mike
> -Original Message- > From: Marco Behnke [mailto:ma...@behnke.biz] > Sent: 19 August 2012 06:39 > To: php-general@lists.php.net > Subject: Re: [PHP] How do I do count the occurrence of each word? > > Am 19.08.12 06:59, schrieb tamouse mailing lists: > > On S

Re: [PHP] How do I do count the occurrence of each word?

2012-08-18 Thread tamouse mailing lists
On Sun, Aug 19, 2012 at 12:38 AM, Marco Behnke wrote: > Am 19.08.12 06:59, schrieb tamouse mailing lists: >> On Sat, Aug 18, 2012 at 6:44 PM, John Taylor-Johnston >> wrote: >>> I want to parse this text and count the occurrence of each word: >>> >>> $text = http://www.cegepsherbrooke.qc.ca/~langu

Re: [PHP] How do I do count the occurrence of each word?

2012-08-18 Thread Marco Behnke
Am 19.08.12 06:59, schrieb tamouse mailing lists: > On Sat, Aug 18, 2012 at 6:44 PM, John Taylor-Johnston > wrote: >> I want to parse this text and count the occurrence of each word: >> >> $text = http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.html; >> #Can I do this? >> $stripping =

Re: [PHP] How do I do count the occurrence of each word?

2012-08-18 Thread tamouse mailing lists
On Sat, Aug 18, 2012 at 6:44 PM, John Taylor-Johnston wrote: > I want to parse this text and count the occurrence of each word: > > $text = http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.html; > #Can I do this? > $stripping = strip_tags($text); #get rid of html > $stripping = strtolow

Re: [PHP] How do I enable more useful PHP error logging?

2012-02-29 Thread Stuart Dallas
On 29 Feb 2012, at 01:13, Daevid Vincent wrote: >> -Original Message- >> From: Stuart Dallas [mailto:stu...@3ft9.com] >> >> Seriously? Errors like this should not be getting anywhere near your >> production servers. This is especially true if you're really getting 30k >> hits/s. > > Don'

Re: [PHP] How do I enable more useful PHP error logging?

2012-02-29 Thread Simon Schick
Hi, Daevid What you could do to have it quick is to install the plugin xdebug. Here you can (as described in the documentation linked here) enable to get some extra information for a E_* message from php. http://xdebug.org/docs/stack_trace I would not do that on a live-system where you have 30k

Re: [PHP] How do I enable more useful PHP error logging?

2012-02-28 Thread Tommy Pham
On Tue, Feb 28, 2012 at 3:14 PM, Daevid Vincent wrote: > My question is, is there a way to enable some PHP configuration that would > output more verbose information, such as a backtrace or the URL attempted? > Have you looked at log4php? [1] It's a log4j (Java based) logging facility port to PHP

RE: [PHP] How do I enable more useful PHP error logging?

2012-02-28 Thread Daevid Vincent
> -Original Message- > From: Stuart Dallas [mailto:stu...@3ft9.com] > > Seriously? Errors like this should not be getting anywhere near your > production servers. This is especially true if you're really getting 30k > hits/s. Don't get me started. I joined here almost a year ago. They did

Re: [PHP] How do I enable more useful PHP error logging?

2012-02-28 Thread Stuart Dallas
On 28 Feb 2012, at 23:14, Daevid Vincent wrote: > My question is, is there a way to enable some PHP configuration that would > output more verbose information, such as a backtrace or the URL attempted? > > In our PHP error log, we have the usual semi-useful information. However > this is only a p

Re: [PHP] How do I enable more useful PHP error logging?

2012-02-28 Thread Adam Richardson
On Tue, Feb 28, 2012 at 6:14 PM, Daevid Vincent wrote: > My question is, is there a way to enable some PHP configuration that would > output more verbose information, such as a backtrace or the URL attempted? > > In our PHP error log, we have the usual semi-useful information. However > this is o

Re: [PHP] How do I enable $_SERVER['HTTP_X_WAP_PROFILE'] or $_SERVER['HTTP_PROFILE']

2011-08-04 Thread Stuart Dallas
On 3 Aug 2011, at 21:07, Daevid Vincent wrote: > I'm working on a mobile site and from the various searches and reading (and > even code fragments I've inherited for the project), they make reference to: > > $_SERVER['HTTP_X_WAP_PROFILE'] and a fallback $_SERVER['HTTP_PROFILE'] > > However, when

RE: [PHP] How do I convert the string "E_ALL & ~E_NOTICE" to the decimal equivalent 6135?

2010-11-12 Thread Ford, Mike
2010 12:58 AM > > To: php-general@lists.php.net > > Subject: RE: [PHP] How do I convert the string "E_ALL & > > ~E_NOTICE" to the decimal equivalent 6135? > > > > > -Original Message- > > > From: Daevid Vincent [mailto:dae...@daevid.com]

RE: [PHP] How do I convert the string "E_ALL & ~E_NOTICE" to the decimal equivalent 6135?

2010-11-11 Thread Daevid Vincent
> -Original Message- > From: Ford, Mike [mailto:m.f...@leedsmet.ac.uk] > Sent: Thursday, November 11, 2010 12:58 AM > To: php-general@lists.php.net > Subject: RE: [PHP] How do I convert the string "E_ALL & > ~E_NOTICE" to the decimal equivalent 61

RE: [PHP] How do I convert the string "E_ALL & ~E_NOTICE" to the decimal equivalent 6135?

2010-11-11 Thread Ford, Mike
> -Original Message- > From: Daevid Vincent [mailto:dae...@daevid.com] > Sent: 11 November 2010 04:06 > To: php-general@lists.php.net > > We're trying to move all of our configuration files for our > DEV/TEST/PROD > and various python scripts and such that all need the same DB > connection

Re: [PHP] How do I upgrade GD?

2010-03-20 Thread Per Jessen
PmI wrote: > Hi, > > how do I upgrade GD? PHP still comes bundled with the three year old > version 2.0.34, even though there have been lots of bugfixes in 2.0.35 > and 2.0.36 (most importantly, 2.0.36 now actually supports unicode > text, rather than "any unicode text as long as it's only UCS-2"

Re: [PHP] how do I use php://memory?

2010-01-29 Thread Mari Masuda
On Jan 29, 2010, at 10:57 PM, Mari Masuda wrote: > > On Jan 29, 2010, at 4:38 PM, Nathan Nobbe wrote: > >> On Fri, Jan 29, 2010 at 5:35 PM, Mari Masuda >> wrote: >> Hello, >> >> I have a function that uses tidy to attempt to clean up a bunch of crappy >> HTML that I inherited. In order to

Re: [PHP] how do I use php://memory?

2010-01-29 Thread Mari Masuda
On Jan 29, 2010, at 4:38 PM, Nathan Nobbe wrote: > On Fri, Jan 29, 2010 at 5:35 PM, Mari Masuda wrote: > Hello, > > I have a function that uses tidy to attempt to clean up a bunch of crappy > HTML that I inherited. In order to use tidy, I write the crappy HTML to a > temporary file on disk,

Re: [PHP] how do I use php://memory?

2010-01-29 Thread Jochem Maas
Op 1/30/10 1:35 AM, Mari Masuda schreef: > Hello, > > I have a function that uses tidy to attempt to clean up a bunch of crappy > HTML that I inherited. In order to use tidy, I write the crappy HTML to a > temporary file on disk, run tidy, and extract and return the clean(er) HTML. > The prog

Re: [PHP] how do I use php://memory?

2010-01-29 Thread Nathan Nobbe
On Fri, Jan 29, 2010 at 5:35 PM, Mari Masuda wrote: > Hello, > > I have a function that uses tidy to attempt to clean up a bunch of crappy > HTML that I inherited. In order to use tidy, I write the crappy HTML to a > temporary file on disk, run tidy, and extract and return the clean(er) HTML. >

RE: [PHP] How do I remove unused GET parameters from the URL?

2010-01-20 Thread Ashley Sheridan
On Wed, 2010-01-20 at 13:06 -0800, Daevid Vincent wrote: > Comments inline below... > > > -Original Message- > > From: Ashley Sheridan > > > > GET has a limit on the amount of data it may carry, which is > > reduced the longer the base URL is. > > True, but for search parameters, it's

RE: [PHP] How do I remove unused GET parameters from the URL?

2010-01-20 Thread Daevid Vincent
Comments inline below... > -Original Message- > From: Ashley Sheridan > > GET has a limit on the amount of data it may carry, which is > reduced the longer the base URL is. True, but for search parameters, it's IMHO best to use GET rather than POST so the page can be bookmarked. This

Re: [PHP] How do I remove unused GET parameters from the URL?

2010-01-20 Thread Ashley Sheridan
On Wed, 2010-01-20 at 10:30 -0800, Michael A. Peters wrote: > Rene Veerman wrote: > > Michael, while i respect your choices, i think you should know that > > jquery.com is pretty good at minimizing browser-incompatibility > > headaches (and keeping js apps small), and the quircks that are left > >

Re: [PHP] How do I remove unused GET parameters from the URL?

2010-01-20 Thread Michael A. Peters
Rene Veerman wrote: Michael, while i respect your choices, i think you should know that jquery.com is pretty good at minimizing browser-incompatibility headaches (and keeping js apps small), and the quircks that are left are easy enough to learn about. for things whereby - the server needs to ge

Re: [PHP] How do I remove unused GET parameters from the URL?

2010-01-20 Thread Ashley Sheridan
On Tue, 2010-01-19 at 20:55 -0800, Daevid Vincent wrote: > I have an HTML form with a hundred or so elements on it, used for searching > a database. > > When the user submits the form (via GET) the URL is loaded with ALL of > these fields, and many of them are not even actually used in the searc

Re: [PHP] How do I remove unused GET parameters from the URL?

2010-01-20 Thread Rene Veerman
Michael, while i respect your choices, i think you should know that jquery.com is pretty good at minimizing browser-incompatibility headaches (and keeping js apps small), and the quircks that are left are easy enough to learn about. for things whereby - the server needs to generate tons of HTML fo

Re: [PHP] How do I remove unused GET parameters from the URL?

2010-01-19 Thread Michael A. Peters
Daevid Vincent wrote: I guess I could always redirect to some 'scrubber' page that strips them out and redirects on to the refering page again, but that seems klunky. BTW, I want to use GET so that the page can be bookmarked for future searches of the same data (or modified easily with diff

Re: [PHP] How do I remove unused GET parameters from the URL?

2010-01-19 Thread Michael A. Peters
Daevid Vincent wrote: *snip* The problem as I see it, is that this "magic" happens when the user hits "Submit", so not sure PHP has any way to intercept at that point. Javascript might be able to do something on the "onClick" event or "onSubmit" I suspect. But this seems like something that som

Re: [PHP] How do I get reliable COMPUTERNAME?

2009-11-05 Thread Andrew Ballard
On Thu, Nov 5, 2009 at 2:03 PM, Jim Lucas wrote: > Andrew Ballard wrote: >> I want to store the name of the computer that is executing a script in >> some log tables. (Our servers are load balanced, and I'd like to be >> able to determine which physical machine is serving each request.) >> >> On m

Re: [PHP] How do I get reliable COMPUTERNAME?

2009-11-05 Thread Jim Lucas
Andrew Ballard wrote: > I want to store the name of the computer that is executing a script in > some log tables. (Our servers are load balanced, and I'd like to be > able to determine which physical machine is serving each request.) > > On my development machine (Windows PC running the debugger i

Re: [PHP] How do I access a local variable?

2009-04-19 Thread Ashley Sheridan
On Sun, 2009-04-19 at 21:55 -0400, Paul M Foster wrote: > On Mon, Apr 20, 2009 at 12:54:27AM +0100, abdulazeez alugo wrote: > > > > > Hi guys, > > > > I have a function inside which I set alocal variable to store a result. Can > > I access this variable in another function? if yes then how? > >

Re: [PHP] How do I access a local variable?

2009-04-19 Thread Paul M Foster
On Mon, Apr 20, 2009 at 12:54:27AM +0100, abdulazeez alugo wrote: > > Hi guys, > > I have a function inside which I set alocal variable to store a result. Can I > access this variable in another function? if yes then how? > > function tbl1($entrytitle, $entrytext) > > { > > global $conn; >

Re: [PHP] How do I access a local variable?

2009-04-19 Thread Chris
abdulazeez alugo wrote: Hi guys, I have a function inside which I set alocal variable to store a result. Can I access this variable in another function? if yes then how? No, you can't. You either need to pass it back (recommended) or make it global (not recommended). function tbl1($entryt

Re: [PHP] how do i allow more than 2 threads of php to run?

2008-12-09 Thread Ashley Sheridan
On Tue, 2008-12-09 at 12:19 -0800, Daevid Vincent wrote: > Assuming this is in-fact your issue, I ALWAYS do this registry hack on > my Windows computers: > http://support.microsoft.com/kb/282402 > > > On Tue, 2008-12-09 at 22:10 +0200, Krister Karlström wrote: > > > Hi! > > > > Please note that

Re: [PHP] how do i allow more than 2 threads of php to run?

2008-12-09 Thread Daevid Vincent
Assuming this is in-fact your issue, I ALWAYS do this registry hack on my Windows computers: http://support.microsoft.com/kb/282402 On Tue, 2008-12-09 at 22:10 +0200, Krister Karlström wrote: > Hi! > > Please note that most browser follows the RFC:s and does not allow more > than two connectio

Re: [PHP] how do i allow more than 2 threads of php to run?

2008-12-09 Thread Krister Karlström
Hi! Please note that most browser follows the RFC:s and does not allow more than two connections to each domain simultaneously. You can do work-arounds to solve this problem, like using subdomains for some requests. In Firefox you might also be able to disable this feature... Regards, Kriste

Re: [PHP] how do i allow more than 2 threads of php to run?

2008-12-09 Thread Rene Veerman
Jochem Maas wrote: Rene Veerman schreef: Jochem Maas wrote: Rene Veerman schreef: i'm getting freezes for the 3rd to Nth concurrent request on my homeserver (got root, on debian4 + apache2). how can i allow more threads? like 50 or so? probably need to fix the a

Re: [PHP] how do i allow more than 2 threads of php to run?

2008-12-09 Thread Jochem Maas
Rene Veerman schreef: > Jochem Maas wrote: >> Rene Veerman schreef: >> >>> i'm getting freezes for the 3rd to Nth concurrent request on my >>> homeserver (got root, on debian4 + apache2). >>> how can i allow more threads? like 50 or so? >>> >> >> probably need to fix the apache.conf to allow

Re: [PHP] how do i allow more than 2 threads of php to run?

2008-12-09 Thread Rene Veerman
Jochem Maas wrote: Rene Veerman schreef: i'm getting freezes for the 3rd to Nth concurrent request on my homeserver (got root, on debian4 + apache2). how can i allow more threads? like 50 or so? probably need to fix the apache.conf to allow more concurrent child processes. K, how

Re: [PHP] how do i allow more than 2 threads of php to run?

2008-12-09 Thread Jochem Maas
Rene Veerman schreef: > i'm getting freezes for the 3rd to Nth concurrent request on my > homeserver (got root, on debian4 + apache2). > how can i allow more threads? like 50 or so? probably need to fix the apache.conf to allow more concurrent child processes. also note I said 'processes' - php i

Re: [PHP] how do I stop Firefox doing a conditional get?

2008-05-15 Thread Per Jessen
Al wrote: > Per Jessen wrote: >> Al wrote: >> >>> Make certain your steam is compressed >>> http://www.whatsmyip.org/mod_gzip_test/ >>> >> >> The files I was having the problem with are GIFs, so already LZW >> compressed. >> > Try by not LZW compressing and the use ob_start() and flush() so you

Re: [PHP] how do I stop Firefox doing a conditional get?

2008-05-15 Thread Al
Try by not LZW compressing and the use ob_start() and flush() so your files are gzip compressed. I don't know if Firefox knows how to readily handle LZW on the fly. It does know how to handle gzip. Per Jessen wrote: Al wrote: Make certain your steam is compressed http://www.whatsmyip.org/mod_

Re: [PHP] how do I stop Firefox doing a conditional get?

2008-05-15 Thread Per Jessen
Al wrote: > Make certain your steam is compressed > http://www.whatsmyip.org/mod_gzip_test/ > The files I was having the problem with are GIFs, so already LZW compressed. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.ph

Re: [PHP] how do I stop Firefox doing a conditional get?

2008-05-15 Thread Robin Vickery
On 15/05/2008, Al <[EMAIL PROTECTED]> wrote: > Make certain your steam is compressed > http://www.whatsmyip.org/mod_gzip_test/ Compressed steam can be dangerous: http://en.wikipedia.org/wiki/2007_New_York_City_steam_explosion -robin -- PHP General Mailing List (http://www.php.net/) To unsubscr

Re: [PHP] how do I stop Firefox doing a conditional get?

2008-05-15 Thread Al
Make certain your steam is compressed http://www.whatsmyip.org/mod_gzip_test/ Per Jessen wrote: Robin Vickery wrote: 2008/5/14 Per Jessen <[EMAIL PROTECTED]>: The issue is - I'd like this page to appear to be as "real time" as possible, and the occasional delay caused by the conditional g

Re: [PHP] how do I stop Firefox doing a conditional get?

2008-05-14 Thread Per Jessen
Robin Vickery wrote: > 2008/5/14 Per Jessen <[EMAIL PROTECTED]>: >> >> The issue is - I'd like this page to appear to be as "real time" as >> possible, and the occasional delay caused by the conditional get is >> a nuisance. My images are clearly cached, so how do I prevent >> Firefox from do

Re: [PHP] how do I stop Firefox doing a conditional get?

2008-05-14 Thread Robin Vickery
2008/5/14 Per Jessen <[EMAIL PROTECTED]>: > All, > > not really PHP related, but I figured someone here would already > have solved this problem. > I've got a page with a single . I change the src attribute > dynamically using javascript. Although the images being served all > have long expi

Re: [PHP] How do I search the archives?

2008-03-11 Thread Daniel Brown
On Tue, Mar 11, 2008 at 12:11 PM, Stut <[EMAIL PROTECTED]> wrote: > > On 11 Mar 2008, at 16:02, Lamonte H wrote: > > I went to the page, but I didn't find a search box and what not. Is > > there a > > way to search the archives? Else when I get home I'll just create a > > script > > to DL al

Re: [PHP] How do I search the archives?

2008-03-11 Thread Stut
On 11 Mar 2008, at 16:02, Lamonte H wrote: I went to the page, but I didn't find a search box and what not. Is there a way to search the archives? Else when I get home I'll just create a script to DL all the links to a page then create a simple search box. You might want to think about wh

Re: [PHP] how do i get a printout of original multipart post data

2007-11-28 Thread Olav Mørkrid
what is the thought behind php not providing access to original post data? this removes any chance of analyzing corrupt upload data, which is often the case with mobile browsers. can future versions of php please include a way of viewing raw server requests in full? On 26/11/2007, [EMAIL PROTECTED

Re: [PHP] how do i get a printout of original multipart post data

2007-11-26 Thread Robert . Degen
If you're with linux try netcat (nc) at listening mode. Something like (not exactly) nc -vtlp 80 and then submut against any localhost url. greetings - Ursprüngliche Nachricht - Von: Olav Mørkrid <[EMAIL PROTECTED]> Datum: Montag, November 26, 2007 1:52 pm Betreff: [PHP] how do i

Re: [PHP] How do I specify a local file for fopen()?

2007-11-04 Thread Cristian Vrabie
Server can't access files on clients computers as they wish or it would be madness. Nothing would be secure. However you can get to the file if you make it public in some way and with some restrictions. Therea are several methods: 1. (wich i think is best) install a ftp server and "share" the fi

Re: [PHP] How do I get PHP to save a backslash in a Mysql table?

2007-10-10 Thread James Ausmus
On 10/10/07, Don Proshetsky <[EMAIL PROTECTED]> wrote: > Hi, > > I have a field in which a user inputs a Windows style directory path, hence > using backslashes and not forward slashes. > > Example: c:\qb\data\mydatadile.qbw > > However, when the use clicks update, what gets saved is: > c:qbdatamyd

RE: [PHP] How do I get PHP to save a backslash in a Mysql table?

2007-10-10 Thread Bastien Koert
use mysql_real_escape_string bastien> From: [EMAIL PROTECTED]> To: php-general@lists.php.net> Date: Wed, 10 Oct 2007 13:48:03 -0400> Subject: [PHP] How do I get PHP to save a backslash in a Mysql table?> > Hi,> > I have a field in which a user inputs a Windows style directory path, hence > us

Re: [PHP] How do I get PHP to save a backslash in a Mysql table?

2007-10-10 Thread TG
ho statement itself. Some of these things are rare issues, but all things to check for if your output isn't what you expect it to be or want it to be. -TG - Original Message - From: "Nathan Nobbe" <[EMAIL PROTECTED]> To: "Don Proshetsky" <[EMAIL PROTECTE

Re: [PHP] How do I get PHP to save a backslash in a Mysql table?

2007-10-10 Thread Nathan Nobbe
On 10/10/07, Don Proshetsky <[EMAIL PROTECTED]> wrote: > > Hi, > > I have a field in which a user inputs a Windows style directory path, > hence > using backslashes and not forward slashes. > > Example: c:\qb\data\mydatadile.qbw > > However, when the use clicks update, what gets saved is: > c:qbdat

Re: [PHP] How do I get Apache 1.3.36 to use PHP 5

2007-08-26 Thread Richard Lynch
On Sun, August 26, 2007 3:03 pm, Beauford wrote: > I tried putting LoadModule php5_module /usr/local/apache/libphp5.so in > my > http.conf, but it doesn't exist. >Example 2-2. Installation Instructions (Static Module Installation > for >Apache) for PHP I think "static module installation

Re: [PHP] How do I delete a composite key?

2007-08-26 Thread Richard Lynch
On Sun, August 26, 2007 2:05 pm, Stut wrote: > nitrox . wrote: >> Im trying to delete a composite key but cannot figure out the proper >> format. Would somebody tell me where im messing up? I have an url >> that >> is supposed to send the member id and game id to a delete query. And >> the >> del

Re: [PHP] How do I delete a composite key?

2007-08-26 Thread Stut
nitrox . wrote: Im trying to delete a composite key but cannot figure out the proper format. Would somebody tell me where im messing up? I have an url that is supposed to send the member id and game id to a delete query. And the delete query is supposed to grab the id's based on type. This is

Re: [PHP] how do I pass a variable with header?

2007-04-21 Thread Richard Lynch
On Sat, April 21, 2007 8:54 am, Ross wrote: > header('Location: edit_property.php?property_id=.'$property_id'.'); "Location: edit_property.php?property_id=$property_id" However, you should be using a complete URI in Location: to be within HTTP spec. -- Some people have a "gift" link here. Know

Re: [PHP] how do I pass a variable with header?

2007-04-21 Thread Stut
Ross wrote: header('Location: edit_property.php?property_id=.'$property_id'.'); You read the manual to learn basic PHP syntax. header('Location: edit_property.php?property_id='. urlencode($property_id)); Also, technically the URL given in a location header should be absolute

Re: [PHP] How do I force my script to exit after 5 seconds?

2007-02-23 Thread Richard Lynch
On Thu, February 22, 2007 9:06 am, Aaron Gould wrote: > So, my question is: how can I force this script to stop after 5 > seconds > has elapsed? > > Here's the script: Inlined code might work... > > $fp = fsockopen('192.168.3.25', 1000

Re: [PHP] How do I force my script to exit after 5 seconds?

2007-02-22 Thread Aaron Gould
Thanks very much, I've added stream_set_timeout functionality, and it seems to work very well! For reference, here's the modified script: $fp = fsockopen('192.168.3.25', 10001, $errno, $errstr, 5); if (!$fp) { echo 'Error...'; } e

Re: [PHP] How do I force my script to exit after 5 seconds?

2007-02-22 Thread Robin Vickery
On 22/02/07, Aaron Gould <[EMAIL PROTECTED]> wrote: I tried this earlier, but it does not seem to work... It appears to just hang when no data is returned from the networked device. It seems as if the loop stops, and is waiting for something. http://www.php.net/manual/en/function.pcntl-alar

Re: [PHP] How do I force my script to exit after 5 seconds?

2007-02-22 Thread Brad Bonkoski
Aaron Gould wrote: I tried this earlier, but it does not seem to work... It appears to just hang when no data is returned from the networked device. It seems as if the loop stops, and is waiting for something. probably blocking on the socket have you tried: www.php.net/stream_set_timeo

Re: [PHP] How do I force my script to exit after 5 seconds?

2007-02-22 Thread Aaron Gould
I tried this earlier, but it does not seem to work... It appears to just hang when no data is returned from the networked device. It seems as if the loop stops, and is waiting for something. Brad Bonkoski wrote: I think something like this will work for you.. $start_time = time(); ...loop.

Re: [PHP] How do I force my script to exit after 5 seconds?

2007-02-22 Thread Brad Bonkoski
I think something like this will work for you.. $start_time = time(); ...loop.. if( time() - $start_time > 5 ) exit; -B Aaron Gould wrote: I have a script that connects to a networked device via PHP's socket functions. This device accepts proprietary commands (e.g.: "KPRINT", as seen below

Re: [PHP] how do I just escape double quotes within a string?

2007-02-13 Thread tg-php
You could use addslashes(): http://us3.php.net/manual/en/function.addslashes.php Or, the code you mentioned below, could be rewritten like: str_replace("\"","\\"",$code); or str_replace('"','\"',$code); And if you're doing it for a MySQL query call, then you want to use mysql-real-escape-string(

Re: [PHP] how do I just escape double quotes within a string?

2007-02-13 Thread Eric Butera
On 2/13/07, blackwater dev <[EMAIL PROTECTED]> wrote: If I use add slashes, it strips everything, I just want to replace all the double quotes with slash double quote but this, of course, throws errors: str_replace(""","\"",$code); Thanks! Try this $string = 'Hello "person." How are you?';

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

2006-11-02 Thread Richard Lynch
On Wed, November 1, 2006 3:42 pm, Ed Lazor wrote: >> Unless you want to pre-parse set_ini() for constants differently >> than >> set_ini() for variables. [shudder] > > It sounds like we just need support for pre-parser commands. You end > up with one set of variables, but now you have the opportun

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

2006-11-01 Thread Ed Lazor
Unless you want to pre-parse set_ini() for constants differently than set_ini() for variables. [shudder] It sounds like we just need support for pre-parser commands. You end up with one set of variables, but now you have the opportunity to change attributes of the environment before script

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

2006-11-01 Thread Richard Lynch
On Tue, October 31, 2006 6:22 pm, Daevid Vincent wrote: >> There is nothing to "re-compile" here. >> The command line has an existing flag for you to specify the php.ini >> file, or to override any setting[s] within the php.ini file. > > Mebbe so, but that's equally obnoxious to pass this command l

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

2006-10-31 Thread Daevid Vincent
> There is nothing to "re-compile" here. > The command line has an existing flag for you to specify the php.ini > file, or to override any setting[s] within the php.ini file. Mebbe so, but that's equally obnoxious to pass this command line parameter to a lot of existing scripts. It's just easier t

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

2006-10-31 Thread Richard Lynch
On Mon, October 30, 2006 7:19 pm, Daevid Vincent wrote: > 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_set('output_handler', 'mb_output_handler'); > ech

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] How do I get ini_set('output_handler', '') to work?!

2006-10-30 Thread Daevid Vincent
ailto:[EMAIL PROTECTED] > Sent: Sunday, October 29, 2006 9:25 PM > To: Daevid Vincent > Cc: php-general@lists.php.net > Subject: Re: [PHP] How do I get ini_set('output_handler', '') > to work?! > > On Fri, October 27, 2006 3:46 pm, Daevid Vincent w

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

2006-10-29 Thread Richard Lynch
On Fri, October 27, 2006 3:46 pm, Daevid Vincent wrote: > What am I doing wrong... > > In my php.ini I have this for my web pages (and I want it): > > output_handler = ob_gzhandler > > But this causes my command line script to not show output until the > very > end. > > I thought I could disable

Re: [PHP] how do I get this line to work inside double quotes

2006-10-02 Thread Google Kreme
On 02 Oct 2006, at 17:13 , tedd wrote: At 4:59 PM -0600 10/2/06, Google Kreme wrote: On 02 Oct 2006, at 14:56 , Richard Lynch wrote: $mail_body .= "" . stripslashes($mail_text) . ""; Can we also comment on the horror that is the tag? I saw that as well, and had a similar response -- but I'

Re: [PHP] how do I get this line to work inside double quotes

2006-10-02 Thread tedd
At 4:59 PM -0600 10/2/06, Google Kreme wrote: On 02 Oct 2006, at 14:56 , Richard Lynch wrote: $mail_body .= "" . stripslashes($mail_text) . ""; Can we also comment on the horror that is the tag? I thought I was gonna puke... No? OK, moving along, nothing to see. I saw that as well, and h

Re: [PHP] how do I get this line to work inside double quotes

2006-10-02 Thread Google Kreme
On 02 Oct 2006, at 14:56 , Richard Lynch wrote: $mail_body .= "" . stripslashes($mail_text) . ""; Can we also comment on the horror that is the tag? I thought I was gonna puke... No? OK, moving along, nothing to see. -- The Piper's calling you to join him -- PHP General Mailing List (http

Re: [PHP] how do I get this line to work inside double quotes

2006-10-02 Thread Richard Lynch
On Mon, October 2, 2006 8:09 am, Ross wrote: $mail_body .= "" . stripslashes($mail_text) . ""; HOWEVER: The fact that you are calling "stripslashes" at all tells me that either: You've screwed up with Magic Quotes being on and calling addslashes (or mysql_[real_]escape_string) so you've essen

Re: [PHP] how do I get this line to work inside double quotes

2006-10-02 Thread Brad Bonkoski
Ross wrote: $mail_body .= "sans-serif\"> stripslashes($mail_text) "; this just returns {stripslashes(it\'s a testss} $mail_body .=" ".stripslashes($mail_text)." "; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How do i check if a variable is a reference or a copy?

2006-09-28 Thread Mathijs
Martin Alterisio wrote: 2006/9/28, Mathijs <[EMAIL PROTECTED]>: Hello there, Is there a way to check if a variable is passed by reference or if it is just a copy. With something like is_copy or is_reference? Thx in advance. Is this part of the "I don't know if two vars reference the same o

Re: [PHP] How do i check if a variable is a reference or a copy?

2006-09-28 Thread Martin Alterisio
2006/9/28, Mathijs <[EMAIL PROTECTED]>: Hello there, Is there a way to check if a variable is passed by reference or if it is just a copy. With something like is_copy or is_reference? Thx in advance. Is this part of the "I don't know if two vars reference the same object in PHP4" dilemma?

Re: [PHP] How do i check if a variable is a reference or a copy?

2006-09-28 Thread Richard Lynch
On Thu, September 28, 2006 5:03 am, Mathijs wrote: > Is there a way to check if a variable is passed by reference or if it > is > just a copy. With something like is_copy or is_reference? If your code doesn't already "know" which it is, you've screwed up somewhere. -- Like Music? http://l-i-e.co

Re: [PHP] How do i check if a variable is a reference or a copy?

2006-09-28 Thread Dave Goodchild
Why do you want to do that? To check whether a variable is passed by reference or value look at the function prototype. If you clarify the reasons why you want to do that it would help. -- http://www.web-buddha.co.uk http://www.projectkarma.co.uk

Re: [PHP] How do I call an class?

2006-09-08 Thread Satyam
I find that politeness is always good, nevertheless using 'o senhor' to refer to Class1 is a little too much. Now, I am not sure what your question actually is. Are you wondering about naming conventions? Your example seems to indicate so. The most frequent is to have class names with the fi

Re: [PHP] How do I call an class?

2006-09-08 Thread Rafael Mora
Hi! I think u are confused, the variable name doesnt have anything to do with the Class name... So you can have something like this: $myvar = new shuttle(); $jjj = new ISS(); u just need to be sure that u are using the exact name of the class, it doesnt matter the variable name, hope u get c

RE: [PHP] How do I prevent a session from rebuilding itself?

2006-07-13 Thread Richard Lynch
On Wed, July 12, 2006 6:20 pm, Daevid Vincent wrote: >> Sequence of events: >> script starts >> you rm -rf /tmp/sess_* >> script writes out data >> script ends >> >> Exactly WHAT do you think "should" happen in this case?... > > I expect this to work like it USED TO WORK! Bug or not. > > I expect:

Re: [PHP] How do I prevent a session from rebuilding itself?

2006-07-13 Thread tedd
At 11:58 AM +0100 7/13/06, Andrew Brampton wrote: >If anyone reads DailyWTF, then you might remember this post: >http://thedailywtf.com/forums/thread/78892.aspx >Explaining the dangers of "rm -rf /tmp" > >I'm sure you won't fall victim to this, but it is a fun read :) > >Andrew Fun read. But the t

Re: [PHP] How do I prevent a session from rebuilding itself?

2006-07-13 Thread Andrew Brampton
If anyone reads DailyWTF, then you might remember this post: http://thedailywtf.com/forums/thread/78892.aspx Explaining the dangers of "rm -rf /tmp" I'm sure you won't fall victim to this, but it is a fun read :) Andrew - Original Message - From: "Daevid Vincent" <[EMAIL PROTECTED]> T

RE: [PHP] How do I prevent a session from rebuilding itself?

2006-07-13 Thread Ford, Mike
On 13 July 2006 00:20, Daevid Vincent wrote: > > Sequence of events: > > script starts > > you rm -rf /tmp/sess_* > > script writes out data > > script ends > > > > Exactly WHAT do you think "should" happen in this case?... > > I expect this to work like it USED TO WORK! Bug or not. > > I expec

RE: [PHP] How do I prevent a session from rebuilding itself?

2006-07-12 Thread Daevid Vincent
> Sequence of events: > script starts > you rm -rf /tmp/sess_* > script writes out data > script ends > > Exactly WHAT do you think "should" happen in this case?... I expect this to work like it USED TO WORK! Bug or not. I expect: Script starts Calls session_start(1234) No existing sess_1234 fil

Re: [PHP] How do I prevent a session from rebuilding itself?

2006-07-12 Thread Richard Lynch
On Tue, July 11, 2006 4:27 pm, Daevid Vincent wrote: > I've noticed a 'feature' that seems to be causing me some pain. > > When a user logs in, we store various pieces of info and their user > class in > a $_SESSION variables. > > This includes a flag saying that they've ben authenticated. > > I wo

RE: [PHP] How do I prevent a session from rebuilding itself?

2006-07-12 Thread Daevid Vincent
> > I would expect that if I 'rm -rf /tmp/sess_*' that the user > would get > > prompted to re-login (since the flag is not set). > > Does it say someplace in the manual that you should be able > to do that? > Or is this a case of what you expect is not what the rest of the world > expects? Th

Re: [PHP] How do I prevent a session from rebuilding itself?

2006-07-11 Thread Robert Cummings
On Tue, 2006-07-11 at 17:27, Daevid Vincent wrote: > I've noticed a 'feature' that seems to be causing me some pain. > > When a user logs in, we store various pieces of info and their user class in > a $_SESSION variables. > > This includes a flag saying that they've ben authenticated. > > I wou

Re: [PHP] How do I make a HTML tree for a set of nodes?

2006-06-07 Thread Niels
Hi, On Tuesday 06 June 2006 21:05, Jochem Maas wrote: [snip] > I might be late to the party but have you thought of trying the YAHOO UI > lib (treeview widget) it even allows you to dynamically load subbranches > as they are expanded (AJAX lovelyness): > > http://developer.yahoo.com/yui/treeview

Re: [PHP] How do I make a HTML tree for a set of nodes?

2006-06-06 Thread Jochem Maas
Niels wrote: > Hi, > > > I have a set of nodes. Each node has a parent and so the set can be thought > of as a tree. I want to show that tree somehow on a webpage, served by PHP. > I cannot use Dot/Graphwiz for various reasons. What I'm looking for is an > output of DIVs or tablecells, showing th

  1   2   3   4   5   6   7   >