Re: [PHP] daemon without pcntl_fork

2009-08-17 Thread Lars Torben Wilson
2009/8/17 Jim Lucas : > I want this to be a system that works out of the box.  For the most part. > > I am expecting to have phone system vendors and low-level IT personal trying > to install this thing. > > I don't want to have to field tons of questions on "How do I compile this > p&#*(_fork thin

Re: [PHP] daemon without pcntl_fork

2009-08-17 Thread Jim Lucas
Lars Torben Wilson wrote: 2009/8/17 Jim Lucas : Does anybody know how to use PHP as a daemon without the use of pcntl_fork. http://php.net/pcntl_fork Hi Jim, AFAIK you can't. Read on. . . I don't want to have to have a person have a special/custom compilation of PHP just to run a simple da

Re: [PHP] SMDR/CDR daemon/processor

2009-08-17 Thread Jim Lucas
Per Jessen wrote: Jim Lucas wrote: I was asked the other day to build a Station Message Detail Recording (SMDR) or Call Detail Record (CDR) processor for a client. I started searching for examples of such a thing. I mostly found commercial apps to handle the job. What sort of processing do y

Re: [PHP] daemon without pcntl_fork

2009-08-17 Thread Lars Torben Wilson
2009/8/17 Jim Lucas : > Does anybody know how to use PHP as a daemon without the use of pcntl_fork. > > http://php.net/pcntl_fork Hi Jim, AFAIK you can't. Read on. . . > I don't want to have to have a person have a special/custom compilation > of PHP just to run a simple daemon. > > My system:  

Re: [PHP] SMDR/CDR daemon/processor

2009-08-17 Thread Per Jessen
Jim Lucas wrote: > I was asked the other day to build a Station Message Detail Recording > (SMDR) or Call Detail Record (CDR) processor for a client. I started > searching for examples of such a thing. I mostly found commercial apps > to handle the job. What sort of processing do you need? I ju

[PHP] daemon without pcntl_fork

2009-08-17 Thread Jim Lucas
Does anybody know how to use PHP as a daemon without the use of pcntl_fork. http://php.net/pcntl_fork I don't want to have to have a person have a special/custom compilation of PHP just to run a simple daemon. My system: OpenBSD 4.5 w/PHP v5.2.8 I want to launch a daemon out of the /etc/rc.loc

Re: [PHP] is there a better way to know from which php file the request comes from ??

2009-08-17 Thread Ralph Deffke
I was reviewing ur post, and thinking u might talk about a pretty common application like in a sequence of order form u want first the billing data then the shipping data. for both u need just the same form u then process on script3. in such a case it doesn't matter if u use hidden fields or url p

Re: [PHP] is there a better way to know from which php file the requestcomes from ??

2009-08-17 Thread Shawn McKenzie
Eddie Drapkin wrote: > On Mon, Aug 17, 2009 at 5:31 PM, Shawn McKenzie wrote: >> nashrul wrote: >>> This is a newbie question... >>> Let's say there are 3 php files, page1.php, page2.php and page3.php. Form >>> submission from page1.php or page2.php will take user to page3.php. >>> I know that we c

Re: [PHP] is there a better way to know from which php file the requestcomes from ??

2009-08-17 Thread Eddie Drapkin
On Mon, Aug 17, 2009 at 5:31 PM, Shawn McKenzie wrote: > nashrul wrote: >> This is a newbie question... >> Let's say there are 3 php files, page1.php, page2.php and page3.php. Form >> submission from page1.php or page2.php will take user to page3.php. >> I know that we can use parameter that is app

[PHP] SMDR/CDR daemon/processor

2009-08-17 Thread Jim Lucas
I was asked the other day to build a Station Message Detail Recording (SMDR) or Call Detail Record (CDR) processor for a client. I started searching for examples of such a thing. I mostly found commercial apps to handle the job. I could not find anything on Hotscripts, phpGround.com, and a few ot

Re: [PHP] is there a better way to know from which php file the requestcomes from ??

2009-08-17 Thread Shawn McKenzie
nashrul wrote: > This is a newbie question... > Let's say there are 3 php files, page1.php, page2.php and page3.php. Form > submission from page1.php or page2.php will take user to page3.php. > I know that we can use parameter that is appended in the action attribute of > the form (e.g ) > But I th

Re: [PHP] is there a better way to know from which php file the request comes from ??

2009-08-17 Thread Tom Worster
On 8/17/09 5:17 AM, "nashrul" wrote: > This is a newbie question... > Let's say there are 3 php files, page1.php, page2.php and page3.php. Form > submission from page1.php or page2.php will take user to page3.php. > I know that we can use parameter that is appended in the action attribute of > th

Re: [PHP] is there a better way to know from which php file the request comes from ??

2009-08-17 Thread Tom Worster
On 8/17/09 5:24 AM, "Ashley Sheridan" wrote: > On Mon, 2009-08-17 at 02:17 -0700, nashrul wrote: >> This is a newbie question... >> Let's say there are 3 php files, page1.php, page2.php and page3.php. Form >> submission from page1.php or page2.php will take user to page3.php. >> I know that we ca

Re: [PHP] Sanitizing mysql inserts of user data

2009-08-17 Thread Ben Dunlap
>> $stmt = $db->prepare("SELECT priv FROM testUsers WHERE >> username=:username AND password=:password"); >> $stmt->bindParam(':username', $user); >> $stmt->bindParam(':password', $pass); >> $stmt->execute(); [8<] > I haven't followed this thread, so I don't know what you mean by, "I > do not see h

Re: [PHP] Sanitizing mysql inserts of user data

2009-08-17 Thread Paul M Foster
On Mon, Aug 17, 2009 at 10:10:47PM +0300, Dotan Cohen wrote: > >> Logically, it does _not_ mean the same thing. > > > > Definitely not -- it would be a bit presumptuous to claim "If you do > > X, the query is not vulnerable to SQL injection attacks" for just > > about any value of X. > > > > That

Re: [PHP] is there a better way to know from which php file the request comes from ??

2009-08-17 Thread Ben Dunlap
> This is a newbie question... > Let's say there are 3 php files, page1.php, page2.php and page3.php. Form > submission from page1.php or page2.php will take user to page3.php. > I know that we can use parameter that is appended in the action attribute of > the form (e.g ) > But I think, appending

Re: [PHP] Sanitizing mysql inserts of user data

2009-08-17 Thread Dotan Cohen
>> Logically, it does _not_ mean the same thing. > > Definitely not -- it would be a bit presumptuous to claim "If you do > X, the query is not vulnerable to SQL injection attacks" for just > about any value of X. > That is what I though: no magic bullet. > That said, I would recommend binding p

Re: [PHP] is there a better way to know from which php file the request comes from ??

2009-08-17 Thread Ashley Sheridan
On Mon, 2009-08-17 at 19:04 +0200, Ralph Deffke wrote: > If u need a solution to know where the request comes from on a certain > secure level u can use cookies. > > u might also have run into pages on the web giving u hard readable images u > have to put into a form field. toghether with cookies

Re: [PHP] Sanitizing mysql inserts of user data

2009-08-17 Thread Ben Dunlap
> "Note: If this function is not used to escape data, the query is > vulnerable to SQL Injection Attacks." > > Does that necessarily imply this: > "If this function is used to escape data, the query is not vulnerable > to SQL Injection Attacks."? > > Logically, it does _not_ mean the same thing. D

Re: [PHP] Another date exercise

2009-08-17 Thread Shawn McKenzie
tedd wrote: > At 3:40 PM +0530 8/17/09, kranthi wrote: >> dont you think http://in3.php.net/strtotime is a solution to your >> problem ? > > No, it's not a solution to my problem -- I have he problem solved. > > I was just asking if anyone wanted to submit their php solution. It was > only an exe

Re: [PHP] is there a better way to know from which php file the request comes from ??

2009-08-17 Thread Ralph Deffke
If u need a solution to know where the request comes from on a certain secure level u can use cookies. u might also have run into pages on the web giving u hard readable images u have to put into a form field. toghether with cookies these design gives u 1000% from where the form data come. depend

Re: [PHP] Another date exercise

2009-08-17 Thread Luke
2009/8/17 Luke > > > 2009/8/17 tedd > >> At 4:10 PM +0100 8/17/09, Luke wrote: >> >> What would be really cool is if someone wrote a PHP script that generates >>> some Javascript code that could do this. >>> >>> I mean while we're on the subject of complicating things ;) >>> >>> -- >>> Luke Sla

Re: [PHP] Another date exercise

2009-08-17 Thread Luke
2009/8/17 tedd > At 4:10 PM +0100 8/17/09, Luke wrote: > >> What would be really cool is if someone wrote a PHP script that generates >> some Javascript code that could do this. >> >> I mean while we're on the subject of complicating things ;) >> >> -- >> Luke Slater >> :O) >> > > While writing/c

Re: [PHP] Another date exercise

2009-08-17 Thread tedd
At 4:10 PM +0100 8/17/09, Luke wrote: What would be really cool is if someone wrote a PHP script that generates some Javascript code that could do this. I mean while we're on the subject of complicating things ;) -- Luke Slater :O) While writing/creating javascript from php can be done, that

Re: [PHP] Another date exercise

2009-08-17 Thread Luke
2009/8/17 tedd > At 4:22 PM -0400 8/16/09, Paul M Foster wrote: > >> On Sun, Aug 16, 2009 at 08:36:17AM +0100, Lester Caine wrote: >> -snip- >> > But as has been said, the real solution is a date picker. >> >> I *hate* date pickers. They slow down input. I can type 082309 >> faster than I can ev

Re: [PHP] Another date exercise

2009-08-17 Thread tedd
At 4:22 PM -0400 8/16/09, Paul M Foster wrote: On Sun, Aug 16, 2009 at 08:36:17AM +0100, Lester Caine wrote: -snip- > But as has been said, the real solution is a date picker. I *hate* date pickers. They slow down input. I can type 082309 faster than I can ever do it with a date picker. The dat

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread Ashley Sheridan
On Mon, 2009-08-17 at 20:16 +0530, kranthi wrote: > >> That's a potential security flaw waiting to happen. A script like this > >> shouldn't be kept in a web-accessible directory. > /var/www is not the document root. document root is /var/www/html so I > dont think there's a problem. > > >> /var/w

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread kranthi
>> That's a potential security flaw waiting to happen. A script like this >> shouldn't be kept in a web-accessible directory. /var/www is not the document root. document root is /var/www/html so I dont think there's a problem. >> /var/www (usually your server root) I am mistaken regarding this. f

Re: [PHP] Another date exercise

2009-08-17 Thread tedd
At 3:40 PM +0530 8/17/09, kranthi wrote: dont you think http://in3.php.net/strtotime is a solution to your problem ? No, it's not a solution to my problem -- I have he problem solved. I was just asking if anyone wanted to submit their php solution. It was only an exercise. I know there are

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread Dotan Cohen
> Just out of curiosity, have you been able to run even the most basic of > scripts from PHP, like a plain old BASH 'echo' statement or something? I > only ask, because sometimes within the shell scripts themselves are > calls to other command line programs (even something as simple as 'ls') > whic

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread Ashley Sheridan
On Mon, 2009-08-17 at 17:01 +0300, Dotan Cohen wrote: > > Did you check SELinux options ?? > > > > I do not have root access to that server. > > > I have a similar problem. For some unknown reason scan_dir() is not > > able to read /home/user when run as Apache module. but the CLI is > > giving e

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread Dotan Cohen
> That's a potential security flaw waiting to happen. A script like this > shouldn't be kept in a web-accessible directory. > Thanks, Ash. That directory is HTTP-password protected. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread Dotan Cohen
> Did you check SELinux options ?? > I do not have root access to that server. > I have a similar problem. For some unknown reason scan_dir() is not > able to read /home/user when run as Apache module. but the CLI is > giving expected results. I did not find any work around, but had to > read /va

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread Ashley Sheridan
On Mon, 2009-08-17 at 19:23 +0530, kranthi wrote: > Did you check SELinux options ?? > > I have a similar problem. For some unknown reason scan_dir() is not > able to read /home/user when run as Apache module. but the CLI is > giving expected results. I did not find any work around, but had to > r

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread kranthi
Did you check SELinux options ?? I have a similar problem. For some unknown reason scan_dir() is not able to read /home/user when run as Apache module. but the CLI is giving expected results. I did not find any work around, but had to read /var/www which is the home directory of 'apache' (this is

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread Dotan Cohen
> see if can run the same php file via CLI. does script.sh run without > any problems ? then, probably something linke SELinux is preventing > httpd from running scripts. you have to contact your system > administrator to get this fixed. > You are right. Running the php script from the CLI in an S

Re: [PHP] Cannot exec in my own directory

2009-08-17 Thread kranthi
see if can run the same php file via CLI. does script.sh run without any problems ? then, probably something linke SELinux is preventing httpd from running scripts. you have to contact your system administrator to get this fixed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, v

Re: [PHP] Another date exercise

2009-08-17 Thread kranthi
dont you think http://in3.php.net/strtotime is a solution to your problem ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] to a css file requires .css ???

2009-08-17 Thread kranthi
A browser will always parse tag regard less of the extension. the only condition is that the file should provide a mine type 'text/css' for css files. https://developer.mozilla.org/en/Incorrect_MIME_Type_for_CSS_Files -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http

Re: [PHP] is there a better way to know from which php file the request comes from ??

2009-08-17 Thread kranthi
HTTP_REFERRER is transparent, but if can be messed with very easily. I prefer use of $_SESSION vars if security is needed in my application (epically when a page is shown after a POST request) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] running str_replace, it misbehaves!

2009-08-17 Thread Ford, Mike
> -Original Message- > From: Allen McCabe [mailto:allenmcc...@gmail.com] > Sent: 16 August 2009 22:07 [...] > Here is an example of my code: > > [code] > > //ENCRYPT FUNCTIONS > function format_string($string,$functions) > { $funcs = explode(",",$functions); > foreach ($funcs as $

Re: [PHP] is there a better way to know from which php file the request comes from ??

2009-08-17 Thread Ashley Sheridan
On Mon, 2009-08-17 at 02:17 -0700, nashrul wrote: > This is a newbie question... > Let's say there are 3 php files, page1.php, page2.php and page3.php. Form > submission from page1.php or page2.php will take user to page3.php. > I know that we can use parameter that is appended in the action attrib

[PHP] is there a better way to know from which php file the request comes from ??

2009-08-17 Thread nashrul
This is a newbie question... Let's say there are 3 php files, page1.php, page2.php and page3.php. Form submission from page1.php or page2.php will take user to page3.php. I know that we can use parameter that is appended in the action attribute of the form (e.g ) But I think, appending this parame

Re: [PHP] to a css file requires .css ???

2009-08-17 Thread Devendra Jadhav
Just use following .htaccess rewrite rule RewriteRule ^some.css$ some.php and this is the perfect solution. On Mon, Aug 17, 2009 at 3:14 AM, Adam Shannon wrote: > On Sun, Aug 16, 2009 at 4:37 PM, Daniel Kolbo wrote: > > > Hello, > > > > I realize this is more of an html question than a php, bu