[PHP] login check

2005-08-04 Thread sub
I think this is the way I need to write my if statement. if ( $min && $user[ "min" ] == $min && $user[ "pin" ] == $pin || $pin == 'allow') $min login name entered by the customer at the form. $user[min] is the login name from my sql db that matches $min $user[pin] is the password from mysql

[PHP] Re: WAMP Performance Tuning

2005-08-04 Thread Matthew Weier O'Phinney
* JM <[EMAIL PROTECTED]>: > I'm quoting out a system for a Windows/Apache/PHP/MySQL > database-driven web application I've written. I've never gotten too > deep into determining what is the actual performance bottleneck in > this scenario. Is it the disk or the RAM? > > I expect about 75-100 users

[PHP] Re: strip out too many newlines

2005-08-04 Thread Al
Sebastian wrote: im working on a comment/forum app and when a user enters too many carriage returns i want to remove them before insert to db. example, user input: -snip- [quote=user] foo [/quote] more text... -snip- I to change to: [quote=user]foo[/quote] more text...

Re: [PHP] Interesting Referer behaviour- how to copy it?

2005-08-04 Thread Jochem Maas
Dotan Cohen wrote: On 8/5/05, Jochem Maas <[EMAIL PROTECTED]> wrote: he runs php5, you run php4 - is the following set on his server perchance?: echo $_SERVER['HTTP_REFERER']; //or echo getenv("HTTP_REFERER"); note that $HTTP_REFERER is depreciated in php5. also the freeBSD box may have a fir

Re: [PHP] Interesting Referer behaviour- how to copy it?

2005-08-04 Thread Dotan Cohen
On 8/5/05, Jochem Maas <[EMAIL PROTECTED]> wrote: > he runs php5, you run php4 - is the following set on his server perchance?: > > echo $_SERVER['HTTP_REFERER']; > //or > echo getenv("HTTP_REFERER"); > > note that $HTTP_REFERER is depreciated in php5. > also the freeBSD box may have a firewall t

Re: [PHP] Interesting Referer behaviour- how to copy it?

2005-08-04 Thread Jochem Maas
Dotan Cohen wrote: I creating a out.php file that will record clicks, and the redirect the user to the site that he wanted. I am currently using header("Location: $url"); which works as expected. The only problem is, that the browser does not send $HTTP_REFERER info to the recieving site. Howeve

[PHP] Re: WAMP Performance Tuning

2005-08-04 Thread JM
I'm quoting out a system for a Windows/Apache/PHP/MySQL database-driven web application I've written. I've never gotten too deep into determining what is the actual performance bottleneck in this scenario. Is it the disk or the RAM? I expect about 75-100 users during business hours. 90% will be in

Re: [PHP] Sessions again....

2005-08-04 Thread Jochem Maas
Suhas wrote: Hello, I am trying to understand how sessions work. I have this code. My understanding is after 1 sec of script completion, (may be little after that), the session should destroy. I understand that it is huge overhead for server, not planning to do this but want to understand h

Re: [PHP] Timing out a remote call

2005-08-04 Thread Torgny Bjers
Brian Dunning wrote: > For one project, I'm required to access a web service for every page. > Basically it returns a little bit of random text. I have no control > over the web service, and there is no possibility of cacheing or > bringing it locally: the requirements are that it be accessed l

[PHP] Timing out a remote call

2005-08-04 Thread Brian Dunning
For one project, I'm required to access a web service for every page. Basically it returns a little bit of random text. I have no control over the web service, and there is no possibility of cacheing or bringing it locally: the requirements are that it be accessed live across the Internet e

Re: [PHP] very simple, yet can't think how.

2005-08-04 Thread Esteamedpw
Thanks! tried googling - only found "using ruby to automatically generate php sites"... the SW-Soft "Site Builder" program is a great program - looking all through it now. Thanks!

Re: [PHP] Sessions again....

2005-08-04 Thread Suhas
Well script is not working as it is supposed to be. Even after 2 hrs I visit the page the count variable increases by 1 than prevois value. Any reason why is that so? If my understanding is not correct please correct me. Thanks SP On 8/4/05, James <[EMAIL PROTECTED]> wrote: > So what is your qu

Re: [PHP] Sessions again....

2005-08-04 Thread James
session.cookie_lifetime integer session.cookie_lifetime specifies the lifetime of the cookie in seconds which is sent to the browser. The value 0 means "until the browser is closed." Defaults to 0. See also session_get_cookie_params() and session_set_cookie_params(). - Original Message -

[PHP] Sessions again....

2005-08-04 Thread Suhas
Hello, I am trying to understand how sessions work. I have this code. My understanding is after 1 sec of script completion, (may be little after that), the session should destroy. I understand that it is huge overhead for server, not planning to do this but want to understand how it really wor

Re: [PHP] Sessions again....

2005-08-04 Thread James
So what is your question...? - Original Message - From: "Suhas" <[EMAIL PROTECTED]> To: "php-general" Sent: Thursday, August 04, 2005 4:13 PM Subject: [PHP] Sessions again Hello, I am trying to understand how sessions work. I have this code. My understanding is after 1 sec of

[PHP] Sessions again....

2005-08-04 Thread Suhas
Hello, I am trying to understand how sessions work. I have this code. My understanding is after 1 sec of script completion, (may be little after that), the session should destroy. I understand that it is huge overhead for server, not planning to do this but want to understand how it really wo

[PHP] Re: Class constants

2005-08-04 Thread Matthew Weier O'Phinney
* Marcus Bointon <[EMAIL PROTECTED]>: > I'm not sure if this is a bug or a feature, but it seems you can't > use class constants to set default values for class properties. You > can, however, use them for default values for method params, e.g.: > > class foo {} >const BAR = 100; >priva

[PHP] Re: overwrite private class members in php5?

2005-08-04 Thread Matthew Weier O'Phinney
* Norbert Wenzel <[EMAIL PROTECTED]>: > Hi, I've done something like this: > > class MyClass { > >private $var; > >function __construct($value) { > $this->var = $value; >} > >public function printVar() { > echo($this->var); >} > > } > > $object = new MyClass('1'); > $o

Re: [PHP] Do I need to use --with-pic with configure?

2005-08-04 Thread Rasmus Lerdorf
Denis Solovyov wrote: > I have a question I can't answer by myself. :) > > Do I need to use "--with-pic" option when configuring php 4? > > I'm going to build it as an Apache 1.3 DSO module and going to > run multiple instances of Apache (under different users). I > use Linux (kernel 2.4.30). >

[PHP] Re: Performace and segfault errors with Php5 + Apache 1.3.x + linux-2.6.x

2005-08-04 Thread Matthew Weier O'Phinney
* Edwin Barrios <[EMAIL PROTECTED]>: > i'am developing a web framework SifEngine (Secure Web Inteface > framework) that implement MVC applaying the security ideas from > http://phpsec.org. I'am using DomXML, Sqlite, Mcrypt and PostgreSql. > > After of post my development on the internet ( i have

Re: [PHP] How to determine if a script instance is already running?

2005-08-04 Thread Matthew Weier O'Phinney
* Matt <[EMAIL PROTECTED]> : > Perhaps "svscan" and its associated "daemontools" programs could be > used to monitor the script instead of relying on cron. Just a note: The above suggestion would assume you control the box, and that you're running on a *nix system (i.e., you've got root on a linux

RE: [PHP] Re: The Naming of Directories

2005-08-04 Thread Shaw, Chris - Accenture
I believe %20 and + are used to replace spaces. See RFC 1738 - Uniform Resource Locators (URL) http://www.faqs.org/rfcs/rfc1738.html C. -Original Message- From: Satyam [mailto:[EMAIL PROTECTED] Sent: 04 August 2005 18:07 To: php-general@lists.php.net Subject: [PHP] Re: The Naming of Di

[PHP] Re: The Naming of Directories

2005-08-04 Thread Satyam
""Mark Rees"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Tom Chubb" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > This may be slightly OT, but I've modified a gallery script that I had > written for me which reads directories and echos the dir name as a > gal

Re: [PHP] Re: Using File to count number of lines

2005-08-04 Thread Al
Brandon Ryan wrote: Are you running this php code in windows, where a line break is made up of a carriage return and a line feed? The file was probably created on unix/linux where the line break is just a line feed. If you try to read this file in windows, it will think everything is on one li

Re: [PHP] To count number of vists of one particular Website

2005-08-04 Thread Dotan Cohen
On 8/4/05, suma parakala <[EMAIL PROTECTED]> wrote: > Hi > Can anyone tell me how can I count how many times my website has been viewed > using php > Thanks > Suma Suma, I am working on that now. I will soon have a script ready under GPL. There are two versions, one with mysql and one with flat fi

[PHP] Re: Is gethostbyaddr() slow?

2005-08-04 Thread kalinga
On 8/4/05, Kristen G. Thorson <[EMAIL PROTECTED]> wrote: > kalinga wrote: > > > if you are quering a external host, the bad network conditions may > > > >cause delay in results. > > > >if your server is connected to a heavily loaded hub/ cheap switch, or > >the target hosts DNS servers are poorly

[PHP] Re: syntax highlighting your php code on a web page

2005-08-04 Thread Matthew Weier O'Phinney
* Steve Turnbull <[EMAIL PROTECTED]>: > Is there a class or some code out there which enables you to print your > PHP code to a web page and make it appear with syntax highlighting? > > As an example of what I am after, have a look here; > > http://www.phpfreaks.com/phpmanual/page/function.ldap-add

[PHP] Re: shell_exec("zip.. ?

2005-08-04 Thread Matthew Weier O'Phinney
* Sam Smith <[EMAIL PROTECTED]>: > > shell_exec("zip -r ddd ddd"); // don't work Many version of zip won't append the .zip extension. In such a case, what you have above will try to name the zip file the same as the existing directory, which obviously won't work. Try: shell_exec("zip -r ddd.z

Re: [PHP] Re: Is gethostbyaddr() slow?

2005-08-04 Thread Kristen G. Thorson
kalinga wrote: if you are quering a external host, the bad network conditions may cause delay in results. if your server is connected to a heavily loaded hub/ cheap switch, or the target hosts DNS servers are poorly configured/ slow in responce it adds further delay to your result. try dig/ n

[PHP] Re: Using File to count number of lines

2005-08-04 Thread Brandon Ryan
Are you running this php code in windows, where a line break is made up of a carriage return and a line feed? The file was probably created on unix/linux where the line break is just a line feed. If you try to read this file in windows, it will think everything is on one line. You either have t

[PHP] Interesting Referer behaviour- how to copy it?

2005-08-04 Thread Dotan Cohen
I creating a out.php file that will record clicks, and the redirect the user to the site that he wanted. I am currently using header("Location: $url"); which works as expected. The only problem is, that the browser does not send $HTTP_REFERER info to the recieving site. However, that particular si

[PHP] Re: Is gethostbyaddr() slow?

2005-08-04 Thread kalinga
i missed another keypoint.. if you are running unix/linux server, you need to have a properly setup resolv.conf or if you experience a slowness while you quering your own domains, check whether you DNS servers are providing "authoritative" answers to your domains. ~viraj. On 8/4/05, kalinga <[

Re: [PHP] strip out too many newlines

2005-08-04 Thread Marco Tabini
On 8/4/05 10:56 AM, "Sebastian" <[EMAIL PROTECTED]> wrote: > that works for my orginal request, but i found something else: > > $string = '[quote=xx]foo[/quote]\nmore text\r\n\r\n\r\n\r\nmore text'; > Try removing double-instances of \r\n (or \n) before running the regex. Marco > now if they

[PHP] Re: Is gethostbyaddr() slow?

2005-08-04 Thread kalinga
On 8/4/05, kalinga <[EMAIL PROTECTED]> wrote: > On 8/4/05, Kristen G. Thorson <[EMAIL PROTECTED]> wrote: > > I can say from personal experience that gethostbyaddr() and > > gethostbyname() can seem almost randomly slow, depending on machine, OS, > > software, who knows. I'm not smart enough to f

[PHP] Re: Is gethostbyaddr() slow?

2005-08-04 Thread kalinga
On 8/4/05, Kristen G. Thorson <[EMAIL PROTECTED]> wrote: > I can say from personal experience that gethostbyaddr() and > gethostbyname() can seem almost randomly slow, depending on machine, OS, > software, who knows. I'm not smart enough to figure out the reason why > it can vary so much on mac

[PHP] ICMP Checksum, calculation

2005-08-04 Thread Philip Birk
I've wanted to make a ping 'program' in PHP, so after reading up on this, it occured to me that the only difficult thing was to calculate the ICMP checksum. So after some heavy reading I could calculate this by pen and paper. And after some hours trying to make my calculations into PHP code, I

Re: [PHP] Is gethostbyaddr() slow?

2005-08-04 Thread Kristen G. Thorson
I can say from personal experience that gethostbyaddr() and gethostbyname() can seem almost randomly slow, depending on machine, OS, software, who knows. I'm not smart enough to figure out the reason why it can vary so much on machines with nearly the same configuration, but I can tell you tha

Re: [PHP] strip out too many newlines

2005-08-04 Thread Sebastian
that works for my orginal request, but i found something else: $string = '[quote=xx]foo[/quote]\nmore text\r\n\r\n\r\n\r\nmore text'; now if they enter more carriage returns i get the results from above. its no big deal, but you always have someone trying to 'break' the system. thanks, i real

Re: [PHP] Is gethostbyaddr() slow?

2005-08-04 Thread Jochem Maas
Dotan Cohen wrote: Hi all, I just discovered the gethostbyaddr() function. By reading the user contributed notes, I get the impression that either this function may cause performance problems, or a user-contributed function based upon it may be slow. So, is gethostbyaddr() slow? Is it dangerous?

[PHP] Is gethostbyaddr() slow?

2005-08-04 Thread Dotan Cohen
Hi all, I just discovered the gethostbyaddr() function. By reading the user contributed notes, I get the impression that either this function may cause performance problems, or a user-contributed function based upon it may be slow. So, is gethostbyaddr() slow? Is it dangerous? Thanks! Dotan Cohen

Re: [PHP] strip out too many newlines

2005-08-04 Thread Marco Tabini
Try changing the \n* patterns to (?:\r?\n)* Cheers, Marco -- BeebleX - The PHP Search Engine http://beeblex.com On 8/4/05 10:39 AM, "Sebastian" <[EMAIL PROTECTED]> wrote: >>> [quote=user] >>> foo >>> [/quote] >>> >>> >>> >>> more text... -- PHP General Mailing List (http://www.php.n

Re: [PHP] strip out too many newlines

2005-08-04 Thread Sebastian
thanx for the reply, but 1 problem. there is not only \n there are \r in the POST too (carriage returns) so a string can look like this: $string = '[quote=xx]\r\nfoo\r\n[/quote]\r\nmore text\r\n\r\n\r\n\r\n'; and your regexp will only catch if there is just \n any solution for \r\n in combinati

Re: [PHP] PHP mysql Apache install on FC3

2005-08-04 Thread Vidyut Luther
Look into the SELinux settings for your system, if you have that enabled, by default PHP is not allowed to get that file via the user nobody. If you look into /var/log/messages you'll see some selinux messages. You either need to disable selinux, or set your policy...http:// fedora.redhat.co

Re: [PHP] strip out too many newlines

2005-08-04 Thread Marco Tabini
Don't know much about the app you're writing, but does this do the trick for you? echo preg_replace ('! ( \[quote (?:=[^\]]*)? \] )# Capture the [quote=xxx] part

[PHP] strip out too many newlines

2005-08-04 Thread Sebastian
im working on a comment/forum app and when a user enters too many carriage returns i want to remove them before insert to db. example, user input: -snip- [quote=user] foo [/quote] more text... -snip- I to change to: [quote=user]foo[/quote] more text... i try this regexp:

Re: [PHP] very simple, yet can't think how.

2005-08-04 Thread Jochem Maas
[EMAIL PROTECTED] wrote: Thanks Mark and Sonu... as much as I've learned over the last few months I think I'm still a little confused about some of this stuff. I appreciate the Help you've given me :-) Would any of you know about any tutorials on something like this? books with tutorials

[PHP] PHP mysql Apache install on FC3

2005-08-04 Thread robert
Hello, I am not quite sure if this is the correct mailing list to post this question, but here I go anyway. I have a vanilla Fedora Core 3 installation, and I am trying to run a php script through a local website that has calls into a MySQL database. I can run this script at the command line

[PHP] Re: Using File to count number of lines

2005-08-04 Thread Al
Tom Chubb wrote: I'm having a problem with the following code: $file = "http://www.mysite.co.uk/mailing_list_database.list";; $lines = count(file($file)); echo "$lines "; ?> I'm trying to show the number of subscribers to my visitors from a text file, but it returns a value of 1 when it sh

Re: [PHP] Using File to count number of lines

2005-08-04 Thread Sebastian
sorry, i forgot to put file(); Sebastian wrote: do this: $file = 'http://www.mysite.co.uk/mailing_list_database.list'; echo ''; print_r($file); echo ''; im pretty sure you'll only see 1 key.. if each has its own line, you would see something like: Array ( [0] => foo [1] => foo [2]

Re: [PHP] Using File to count number of lines

2005-08-04 Thread Sebastian
do this: $file = 'http://www.mysite.co.uk/mailing_list_database.list'; echo ''; print_r($file); echo ''; im pretty sure you'll only see 1 key.. if each has its own line, you would see something like: Array ( [0] => foo [1] => foo [2] => foo [3] => foo ) etc... Tom Chubb wrote:

RE: [PHP] Using File to count number of lines

2005-08-04 Thread Jay Blanchard
[snip] When I open the list in notepad everything is on one line with a square box character. When I open it in wordpad, it's one email address on each line. [/snip] Sounds like that there are not any newline characters in the file. You could do something like this... $theFile = fopen("http://www

RE: [PHP] Setting up a new box from scratch?

2005-08-04 Thread Jim Moseby
> > > Hey all - > > I have an unused Pentium box here, recent, well loaded with RAM and > HD. I want to turn it into a LAMP box. Never done that before; is > there a preferred one-stop-shop installer CD or anything (easy - > knock on wood)? It would be nice to end up with some kind of dece

Re: [PHP] Using File to count number of lines

2005-08-04 Thread Tom Chubb
When I open the list in notepad everything is on one line with a square box character. When I open it in wordpad, it's one email address on each line. On 04/08/05, Sebastian <[EMAIL PROTECTED]> wrote: > you sure each is on its own line (\n) ? > > if you're only getting a value of 1 it is likely

Re: [PHP] Using File to count number of lines

2005-08-04 Thread Sebastian
you sure each is on its own line (\n) ? if you're only getting a value of 1 it is likely putting everything on a single array key.. Tom Chubb wrote: I'm having a problem with the following code: $file = "http://www.mysite.co.uk/mailing_list_database.list";; $lines = count(file($file));

[PHP] Do I need to use --with-pic with configure?

2005-08-04 Thread Denis Solovyov
I have a question I can't answer by myself. :) Do I need to use "--with-pic" option when configuring php 4? I'm going to build it as an Apache 1.3 DSO module and going to run multiple instances of Apache (under different users). I use Linux (kernel 2.4.30). Generally, when one may need to use "

[PHP] Using File to count number of lines

2005-08-04 Thread Tom Chubb
I'm having a problem with the following code: http://www.mysite.co.uk/mailing_list_database.list";; $lines = count(file($file)); echo "$lines "; ?> I'm trying to show the number of subscribers to my visitors from a text file, but it returns a value of 1 when it should be 5000. I think it's to

[PHP] Re: can't find the parser error

2005-08-04 Thread hope
well u have a parse error in ur TESTARRAY.PHP file within the foreach loop u hav writen print "$day" while here u must also terminate it through semi-colon like this print "$day"; This wil solve the problem Now it wil work zedleon wrote: I am having tro

Re: [PHP] To count number of vists of one particular Website

2005-08-04 Thread Jochem Maas
suma parakala wrote: Hi Can anyone tell me how can I count how many times my website has been viewed using php you'd think someone had done this before - try google first - there are 1000's of scripts that do this, have a look at some and see how they do it. e.g.: http://www.google.com/search

RE: [PHP] code generation

2005-08-04 Thread Shaw, Chris - Accenture
thanx for the responses, i thought of that but wouldn't changing the system date on your machine be a way of getting around that? Time and Date functions are dependent on the locale settings of your server. This message has been delivered to the Internet by the Reven

[PHP] To count number of vists of one particular Website

2005-08-04 Thread suma parakala
Hi Can anyone tell me how can I count how many times my website has been viewed using php Thanks Suma _ Post FREE Classifieds. http://www.sulekha.com/classifieds/cllist.aspx?nma=IN&ref=msn Reach out to over a million NRIs. -- P

Re: [PHP] code generation

2005-08-04 Thread Johan Grobler
yes sorry about that, i was going to ask about code generation but then rephrased the question without changing the subject... thanx for the responses, i thought of that but wouldn't changing the system date on your machine be a way of getting around that? >>> Jochem Maas <[EMAIL PROTECTED]> 08

Re: [PHP] Knowledge Management

2005-08-04 Thread Roger Thomas
OK thanks Rory. I will certainly evaluate it. -- Roger Quoting Rory McKinley <[EMAIL PROTECTED]>: > Roger Thomas wrote: > > I am trying to find a suitable opensource Knowledge Management System to be > used in my organisation; at least with document management, project > management group collabo

Re: [PHP] Knowledge Management

2005-08-04 Thread Rory McKinley
Roger Thomas wrote: > I am trying to find a suitable opensource Knowledge Management System to be > used in my organisation; at least with document management, project > management group collaboration capabilities, like http://cortexpro.com/ > > Any clues ? > Hi Roger KnowledgeTree comes hig

[PHP] Knowledge Management

2005-08-04 Thread Roger Thomas
I am trying to find a suitable opensource Knowledge Management System to be used in my organisation; at least with document management, project management group collaboration capabilities, like http://cortexpro.com/ Any clues ? -- Roger --- Si

[PHP] Re: The Naming of Directories

2005-08-04 Thread Mark Rees
"Tom Chubb" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] This may be slightly OT, but I've modified a gallery script that I had written for me which reads directories and echos the dir name as a gallery. Unfortunately, it doesn't look very nice with say picsofsomething so I renamed t

[PHP] The Naming of Directories

2005-08-04 Thread Tom Chubb
This may be slightly OT, but I've modified a gallery script that I had written for me which reads directories and echos the dir name as a gallery. Unfortunately, it doesn't look very nice with say picsofsomething so I renamed the folder 'pics of something' When this is read, the string inserts %20

Re: [PHP] code generation

2005-08-04 Thread Jochem Maas
btw - what has 'code generation' got to do with the question? a oneliner to check 2 dates is not considered code generation - I'd call it 'writing a oneliner' or something similiar :-) [EMAIL PROTECTED] wrote: Couldn't you use a date check with date()? if(todays date < end date) { load the site