[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

[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 car

Re: [PHP] Event Handling

2010-03-15 Thread David Hutto
--- On *Mon, 3/15/10, David Hutto dwightdhu...@yahoo.com* wrote: From: David Hutto dwightdhu...@yahoo.com Subject: Re: [PHP] Event Handling To: php-general@lists.php.net, Alex Major p...@allydm.co.uk Date: Monday, March 15, 2010, 3:34 AM --- On Mon, 3/15/10, Alex Major

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 from a

[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

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 ash...@pcraft.com wrote: Thanks to Jochem Mass for helping earlier to the

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,

Re: [PHP] Event Handling

2010-03-15 Thread David Hutto
On Mon, Mar 15, 2010 at 5:17 AM, Lester Caine les...@lsces.co.uk 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

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

[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

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 p...@computer.org 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

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 =

[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

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

2010-03-15 Thread Daniel Egeberg
On Fri, Mar 12, 2010 at 08:49, Per Jessen p...@computer.org 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.

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

2010-03-15 Thread Daniel Brown
On Fri, Mar 12, 2010 at 06:48, Daniel Egeberg degeb...@php.net 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

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,

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 (?php ... ?) 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

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 checking I

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
time zone - Regards 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 __ Information from

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

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

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 can

[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:

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 right:

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

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:

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: