[PHP] Event Handling

2010-03-15 Thread Alex Major
Greetings all, I'm currently looking at building a web application, however I've run into an area of development I've not come across before. The web site in its basic form allows users to send cars from a point and then the car will arrive at another point. When the car is set on its way, the sta

[PHP] Re: Event Handling

2010-03-15 Thread David Robley
Alex Major wrote: > Greetings all, > > I'm currently looking at building a web application, however I've run into > an area of development I've not come across before. The web site in its > basic form allows users to send cars from a point and then the car will > arrive at another point. When the

Re: [PHP] Event Handling

2010-03-15 Thread David Hutto
--- On *Mon, 3/15/10, David Hutto * wrote: From: David Hutto Subject: Re: [PHP] Event Handling To: php-general@lists.php.net, "Alex Major" Date: Monday, March 15, 2010, 3:34 AM --- On Mon, 3/15/10, Alex Major http://us.mc453.mail.yahoo.com/mc/compose?to=...@allydm.co.uk>> wrote: > From: Alex

Re: [PHP] Event Handling

2010-03-15 Thread Midhun Girish
Hi , Just as David Hutto has said,What you need is the cronjob... Make a script say "check.php" which checks the db to see if any new entries are made... and if yes send the mail ... now using the cronjob feature in linux os(which will be provided as a service in your linux hosting cpanel), set a

Re: [PHP] Re: Event Handling

2010-03-15 Thread Ashley Sheridan
On Mon, 2010-03-15 at 18:07 +1030, David Robley wrote: > Alex Major wrote: > > > Greetings all, > > > > I'm currently looking at building a web application, however I've run into > > an area of development I've not come across before. The web site in its > > basic form allows users to send cars

[PHP] ldap_bind() connectivity

2010-03-15 Thread Ashley M. Kirchner
Thanks to Jochem Mass for helping earlier to the string splitting. Works great (so far). Now on to my next problem, which has to do with ldap_bind(). I have the following code: $ldapconn = @ldap_connect($adServer); $ldapbind = ldap_bind($ldapconn, $ldapuser, $ldappass);

Re: [PHP] Re: Event Handling

2010-03-15 Thread Midhun Girish
hey ash, do we need both of those checks ? ie the time and the flag? i think they both do the same thing ie prevent duplicates.. am i right? and i think flag would be a more reliable method coz it will ensure that the email will be send even if the cron fails to execute for some time, Midhun

Re: [PHP] Re: Event Handling

2010-03-15 Thread Ashley Sheridan
On Mon, 2010-03-15 at 14:28 +0530, Midhun Girish wrote: > hey ash, > > do we need both of those checks ? ie the time and the flag? i think they > both do the same thing ie prevent duplicates.. am i right? and i think flag > would be a more reliable method coz it will ensure that the email will be

Re: [PHP] Re: Event Handling

2010-03-15 Thread Midhun Girish
ok so we have a script which checks if any cars have arrived within last 10 minutes... if yes, a mail will be send. suppose the server fails for 30 minutes so when the cron comes next time, we will have to check for cars which arrived within last 40 minutes and not 10.. right... so how wil

Re: [PHP] ldap_bind() connectivity

2010-03-15 Thread Peter Lind
You might want to check what the function outputs with: var_dump($ldapbind); after the call to ldap_bing(). That way you'll know what actually got returned from the function. On 15 March 2010 09:54, Ashley M. Kirchner wrote: > Thanks to Jochem Mass for helping earlier to the string splitting.  

Re: [PHP] Re: Event Handling

2010-03-15 Thread Ashley Sheridan
On Mon, 2010-03-15 at 14:40 +0530, Midhun Girish wrote: > ok so we have a script which checks if any cars have arrived within > last 10 minutes... if yes, a mail will be send. suppose the server > fails for 30 minutes so when the cron comes next time, we will > have to check for cars which

Re: [PHP] Event Handling

2010-03-15 Thread Lester Caine
Alex Major wrote: I'm currently looking at building a web application, however I've run into an area of development I've not come across before. The web site in its basic form allows users to send cars from a point and then the car will arrive at another point. When the car is set on its way, the

Re: [PHP] Event Handling

2010-03-15 Thread David Hutto
On Mon, Mar 15, 2010 at 5:17 AM, Lester Caine wrote: > Alex Major wrote: > >> I'm currently looking at building a web application, however I've run into >> an area of development I've not come across before. The web site in its >> basic form allows users to send cars from a point and then the car

Re: [PHP] ldap_bind() connectivity

2010-03-15 Thread chamila gayan
if you sure you have valid credentials check your account and sure it hasn't locked, perhaps it may locked. On Mon, Mar 15, 2010 at 2:42 PM, Peter Lind wrote: > You might want to check what the function outputs with: > > var_dump($ldapbind); > > after the call to ldap_bing(). That way you'll kn

Re: [PHP] Event Handling

2010-03-15 Thread Jochem Maas
Op 3/15/10 8:24 AM, Midhun Girish schreef: > Hi , > Just as David Hutto has said,What you need is the cronjob... Make a script > say "check.php" which checks the db to see if any new entries are made... > and if yes send the mail ... > > now using the cronjob feature in linux os(which will be prov

Re: [PHP] Event Handling

2010-03-15 Thread David Hutto
On Mon, Mar 15, 2010 at 7:31 AM, Jochem Maas wrote: > Op 3/15/10 8:24 AM, Midhun Girish schreef: > > Hi , > > Just as David Hutto has said,What you need is the cronjob... Make a > script > > say "check.php" which checks the db to see if any new entries are made... > > and if yes send the mail ...

Re: [PHP] Event Handling

2010-03-15 Thread Rene Veerman
+1.. Assuming you have had a 100% success rate of getting cars to their destination on time for years; If for some reason you can't set up a cron job, you _could_ have a browser do the cron-ing for you; a page with an ajax script that kicks off the check-for-recent-events script on the server. gr

Re: [PHP] Event Handling

2010-03-15 Thread Jochem Maas
Op 3/15/10 12:00 PM, David Hutto schreef: > On Mon, Mar 15, 2010 at 7:31 AM, Jochem Maas wrote: > >> Op 3/15/10 8:24 AM, Midhun Girish schreef: >>> Hi , >>> Just as David Hutto has said,What you need is the cronjob... Make a >> script >>> say "check.php" which checks the db to see if any new entr

[PHP] Re: I need a fresh look at storing variables in MySQL

2010-03-15 Thread Colin Guthrie
'Twas brillig, and Jochem Maas at 14/03/10 23:56 did gyre and gimble: > Op 3/14/10 11:45 AM, Ashley Sheridan schreef: >> On Sun, 2010-03-14 at 12:25 +0100, Rene Veerman wrote: >> >>> On Sun, Mar 14, 2010 at 12:24 PM, Rene Veerman wrote: I'd love to have a copy of whatever function you us

Re: [PHP] Re: I need a fresh look at storing variables in MySQL

2010-03-15 Thread Ashley Sheridan
On Mon, 2010-03-15 at 12:48 +, Colin Guthrie wrote: > 'Twas brillig, and Jochem Maas at 14/03/10 23:56 did gyre and gimble: > > Op 3/14/10 11:45 AM, Ashley Sheridan schreef: > >> On Sun, 2010-03-14 at 12:25 +0100, Rene Veerman wrote: > >> > >>> On Sun, Mar 14, 2010 at 12:24 PM, Rene Veerman w

Re: [PHP] Event Handling

2010-03-15 Thread Midhun Girish
rene "a page with an ajax script that kicks off the check-for-recent-events script on the server".. but that method is highly non reliable i dont think anyone will take that risk especially for an important web app cron or any equivalent which runs on the server must be used instead of that

[PHP] Re: Splitting a string ...

2010-03-15 Thread Al
On 3/14/2010 9:54 PM, Ashley M. Kirchner wrote: I'm not a regexp person (wish I was though), and I'm hoping someone can give me a hand here. Consider the following strings: - domain\usern...@example.org - domain\username - the same as above but with / instead of

Re: [PHP] Event Handling

2010-03-15 Thread Ashley Sheridan
On Mon, 2010-03-15 at 18:28 +0530, Midhun Girish wrote: > rene "a page with an ajax script that kicks off the check-for-recent-events > script on the server".. but that method is highly non reliable i dont > think anyone will take that risk especially for an important web app > cron or any

Re: [PHP] Doing dynamic routing for an office

2010-03-15 Thread Andrew Ballard
On Fri, Mar 12, 2010 at 3:30 AM, Per Jessen wrote: > Ian wrote: > >> Hi, >> >> I have had a weird request as a project and that is to build a system >> where the clients can put down their office plans into a system and >> based on where you are in the buliding (either via defined kiosks or >> mob

Re: [PHP] Splitting a string ...

2010-03-15 Thread shiplu
Here is the regex for you. $company_domain = '\w+'; // replace with your own company domain pattern. $user_name = '\w+'; // replace with your own username pattern $email_domain = '\w+\.\w{2,4}'; // google for standard domain name regex pattern and replace it. $regexp = "~({$company_domain}[

[PHP] Using Mono library from PHP

2010-03-15 Thread Fernando
Is there a way to use a Mono library from PHP running on Apache 2.2 on a Debian server? I have seen samples of using COM and DOTNET, but it seems to work only on Windows not on Linux. Your help is really appreciated. Thank you, Fernando.

[PHP] long polling solution for LAMP with limited privilege

2010-03-15 Thread Ryan Sun
I wonder if you guys have a long-polling(http://meteorserver.org/interaction-modes/) solution for a shared hosting(eg. hostmonster) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] long polling solution for LAMP with limited privilege

2010-03-15 Thread Rene Veerman
On shared hosting, you usually can't change the 30 sec max timeout on the server.. So long polling >30s is not possible. Short polling could be the answer, which can be done with ajax (see jquery.com) from javascript, especially if you keep the cost of "are there any new events for this client" d

Re: [PHP] mysqli procedural calls and manual entries ?

2010-03-15 Thread Daniel Egeberg
On Fri, Mar 12, 2010 at 08:49, Per Jessen wrote: > I run a local mirror of the PHP manual, and I most often go straight to > the "Search for" box to look up the format of a function.  With the > mysqli functions, I've found than many of them simply > aren't "available" that way.  E.g. mysqli_conne

Re: [PHP] mysqli procedural calls and manual entries ?

2010-03-15 Thread Daniel Brown
On Fri, Mar 12, 2010 at 06:48, Daniel Egeberg wrote: > > Hi Per, > > The manual already supports that. If you install the sqlite extension > on your webserver, it should work. Dan; The question wasn't whether or not it supports that kind of lookup, but rather why it's not working. We've

RE: [PHP] Event Handling

2010-03-15 Thread Alex Major
Thanks to all for your help on this, it's been very interesting for me to read. The system needs to check arrivals in real time (give or take a second or two), using a cron job every minute doesn't provide the real time checking I would like. However, when I then got to thinking about it, wouldn'

Re: [PHP] Re: PHP in HTML code

2010-03-15 Thread Jochem Maas
Op 3/13/10 3:49 PM, Jorge Gomes schreef: > First of all, i recommend the use of normal php tags () because > the short tags are atm marked as* **DEPRECATED*. that's a documentation error. > > You should also echo your values to the page, instead using the shortcut (stop being a lazy ass! :P):

Re: [PHP] Event Handling

2010-03-15 Thread Paul M Foster
On Mon, Mar 15, 2010 at 05:38:04PM -, Alex Major wrote: > Thanks to all for your help on this, it's been very interesting for me to > read. > > The system needs to check arrivals in real time (give or take a second or > two), using a cron job every minute doesn't provide the real time checkin

RE: [PHP] Re: PHP in HTML code

2010-03-15 Thread Bob McConnell
From: Jochem Maas > Op 3/13/10 3:49 PM, Jorge Gomes schreef: >> First of all, i recommend the use of normal php tags () because >> the short tags are atm marked as* **DEPRECATED*. > > that's a documentation error. No it's not. The short tags conflict with both XML and XHTML and therefore are bei

RE: [PHP] ldap_bind() connectivity

2010-03-15 Thread Ashley M. Kirchner
> -Original Message- > From: Peter Lind [mailto:peter.e.l...@gmail.com] > Sent: Monday, March 15, 2010 3:13 AM > To: Ashley M. Kirchner > Cc: php-general@lists.php.net > Subject: Re: [PHP] ldap_bind() connectivity > > You might want to check what the function outputs with: > > var_dump($l

RE: [PHP] Re: PHP in HTML code

2010-03-15 Thread Ashley Sheridan
On Mon, 2010-03-15 at 14:12 -0400, Bob McConnell wrote: > From: Jochem Maas > > > Op 3/13/10 3:49 PM, Jorge Gomes schreef: > >> First of all, i recommend the use of normal php tags () > because > >> the short tags are atm marked as* **DEPRECATED*. > > > > that's a documentation error. > > No it

[PHP] Deleting multiple backslashes; regex?

2010-03-15 Thread Al
Anyone have a regex pattern for deleting multiple backslashes e.g., \\\ I pretty good with regex; but, be damned if I can delete them with preg_replace() I've tried "" as the manual says preg_replace("//", '', $str); preg_replace("/()+/", '', $str); preg_replace("/\x5C/", '',

Re: [PHP] Deleting multiple backslashes; regex?

2010-03-15 Thread Ashley Sheridan
On Mon, 2010-03-15 at 15:03 -0400, Al wrote: > Anyone have a regex pattern for deleting multiple backslashes e.g., \\\ > > I pretty good with regex; but, be damned if I can delete them with > preg_replace() > > I've tried "" as the manual says > > preg_replace("//", '', $str); > >

Re: [PHP] Deleting multiple backslashes; regex?

2010-03-15 Thread Ashley Sheridan
On Mon, 2010-03-15 at 15:35 -0400, Al Rider wrote: > > > On 3/15/2010 3:11 PM, Ashley Sheridan wrote: > > > On Mon, 2010-03-15 at 15:03 -0400, Al wrote: > > > > > Anyone have a regex pattern for deleting multiple backslashes e.g., > > > \\\ > > > > > > I pretty good with regex; but, be

Re: [PHP] Deleting multiple backslashes; regex?

2010-03-15 Thread james stojan
Double check your code I came up with the same solution as Ash did and it worked fine in Wamp. On Mon, Mar 15, 2010 at 3:30 PM, Ashley Sheridan wrote: > On Mon, 2010-03-15 at 15:35 -0400, Al Rider wrote: > > > > > > > On 3/15/2010 3:11 PM, Ashley Sheridan wrote: > > > > > On Mon, 2010-03-15 at 15

[PHP] how to get the local time

2010-03-15 Thread saeed ahmed
hi friends, I'm trying to set local time in my php script. I was trying date and time function but its always show the server time not local time. i need help on this problem. how can i set the local time. i need sweden time zone - Regards Saeed Ahmed http://saeed05.wordpress.com -

Re: [PHP] how to get the local time

2010-03-15 Thread Ashley Sheridan
On Tue, 2010-03-16 at 02:10 +0600, saeed ahmed wrote: > hi friends, > > I'm trying to set local time in my php script. I was trying date and time > function but its always show the server time not local time. i need help on > this problem. how can i set the local time. i need sweden time zone > -

Re: [PHP] Deleting multiple backslashes; regex?

2010-03-15 Thread Al
On 3/15/2010 3:30 PM, Ashley Sheridan wrote: On Mon, 2010-03-15 at 15:35 -0400, Al Rider wrote: On 3/15/2010 3:11 PM, Ashley Sheridan wrote: On Mon, 2010-03-15 at 15:03 -0400, Al wrote: Anyone have a regex pattern for deleting multiple backslashes e.g., \\\ I pretty good with regex

Re: [PHP] Deleting multiple backslashes; regex?

2010-03-15 Thread Jim Lucas
Al wrote: > Anyone have a regex pattern for deleting multiple backslashes e.g., \\\ > > I pretty good with regex; but, be damned if I can delete them with > preg_replace() > > I've tried "" as the manual says > > preg_replace("//", '', $str); > > preg_replace("/()+/", '', $str);

[PHP] Re: how to get the local time

2010-03-15 Thread Gary
Saeed Ahmed > http://saeed05.wordpress.com > - > > > > __ Information from ESET Smart Security, version of virus > signature database 4946 (20100315) __ > > The message was checked by ESET Smart Security. > > http://www.eset.com > > __ Informat

RE: [PHP] how to get the local time

2010-03-15 Thread Daevid Vincent
You either have to use JS on the client side. Or you store the user's timezone as a preference in their profile and compute using that by setting a TZ variable. Normally you would store all data in mySQL in UTC and then convert on the fly as mentioned above for each user. > -Original Messa

Re: [PHP] Event Handling

2010-03-15 Thread Gabriel Sosa
Indeed. This is kinda offtopic but if you put a cron running with a loop you will kill your server. I would recomend use libevent + ALARM signal to process on a time basis. On the other hand using C would be a nice aproach since you can put your script on an sleep mode until the next alarm signal i

Re: [PHP] Event Handling

2010-03-15 Thread Ashley Sheridan
On Mon, 2010-03-15 at 20:02 -0300, Gabriel Sosa wrote: > Indeed. This is kinda offtopic but if you put a cron running with a > loop you will kill your server. I would recomend use libevent + ALARM > signal to process on a time basis. On the other hand using C would be > a nice aproach since you ca

[PHP] Need routine to tell me number of dimensions in array.

2010-03-15 Thread Daevid Vincent
Anyone have a function that will return an integer of the number of dimensions an array has? I did some quick searches and came up with nothing. The closest was here of someone asking the same thing, but his solution isn't right: http://www.bigresource.com/PHP-count-array-dimensions-VrIahx1b.html

Re: [PHP] Need routine to tell me number of dimensions in array.

2010-03-15 Thread Ashley Sheridan
On Mon, 2010-03-15 at 16:45 -0700, Daevid Vincent wrote: > Anyone have a function that will return an integer of the number of > dimensions an array has? > > I did some quick searches and came up with nothing. > The closest was here of someone asking the same thing, but his solution > isn't righ

RE: [PHP] Need routine to tell me number of dimensions in array.

2010-03-15 Thread Daevid Vincent
Oh. I know it's not a simple solution to do right Ashley. And exacerbated by the fact that each array dimension can have different dimensions as well. This is why I wanted someone else's solution first before I spend hours or days on one that works reliably. :) _ From: Ashley Sheridan [m

RE: [PHP] Need routine to tell me number of dimensions in array.

2010-03-15 Thread Ashley Sheridan
On Mon, 2010-03-15 at 17:23 -0700, Daevid Vincent wrote: > Oh. I know it's not a simple solution to do right Ashley. And exacerbated > by the fact that each array dimension can have different dimensions as > well. This is why I wanted someone else's solution first before I spend > hours or days on

Re: [PHP] Need routine to tell me number of dimensions in array.

2010-03-15 Thread Jim Lucas
Daevid Vincent wrote: > Anyone have a function that will return an integer of the number of > dimensions an array has? > > I did some quick searches and came up with nothing. > The closest was here of someone asking the same thing, but his solution > isn't right: > http://www.bigresource.com/PHP-

Re: [PHP] Need routine to tell me number of dimensions in array.

2010-03-15 Thread Robert Cummings
Jim Lucas wrote: Daevid Vincent wrote: Anyone have a function that will return an integer of the number of dimensions an array has? I did some quick searches and came up with nothing. The closest was here of someone asking the same thing, but his solution isn't right: http://www.bigresource.c