[PHP] code generation

2005-08-04 Thread Johan Grobler
is there a way to limit the time a website is available in php?, if you want to have a database driven website but you would only like it to be active for 6 months for instance, i'm doing a project at univirsity and this is part of the specs, but i cant think of a good way how to do it...

RE: [PHP] Regex help

2005-08-04 Thread Lizet Pena de Sola
Ok, it's not the regexp for detecting email addresses what I need, that's widely published, thanks. I'm using ereg to match this regular expression: (On)[\s\w\d\W\S\D\n]*(wr[i|o]te[s]?:) That will match phrases like On 8/3/05, Carol Swinehart [EMAIL PROTECTED] wrote: the type On date, name email

Re: [PHP] code generation

2005-08-04 Thread Ligaya Turmelle
Maybe have a cron job that deletes/changes perms to make inaccessible the script after the given date. Johan Grobler wrote: is there a way to limit the time a website is available in php?, if you want to have a database driven website but you would only like it to be active for 6 months for

Re: [PHP] code generation

2005-08-04 Thread sub
Couldn't you use a date check with date()? if(todays date end date) { load the site } else { the site has expired } Andrew Darrow Kronos1 Productions www.pudlz.com - Original Message - From: Johan Grobler [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Wednesday, August 03,

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

[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

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

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

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 ? snip Hi Roger KnowledgeTree comes

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 collaboration

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]

[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=INref=msn Reach out to over a million NRIs. --

RE: [PHP] code generation

2005-08-04 Thread Shaw, Chris - Accenture
snip 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? /snip Time and Date functions are dependent on the locale settings of your server. This message has been delivered to the Internet by

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

[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

[PHP] Using File to count number of lines

2005-08-04 Thread Tom Chubb
I'm having a problem with the following code: ?php $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 should be 5000. I

[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

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: ?php $file = http://www.mysite.co.uk/mailing_list_database.list;; $lines =

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] 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 decent

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 =

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 'pre'; print_r($file); echo '/pre'; 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

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 'pre'; print_r($file); echo '/pre'; 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

[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: ?php $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

[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

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

[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] bunch of extra lines more text... -snip- I to change to: [quote=user]foo[/quote] more

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

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

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

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] bunch of extra lines more text... -- PHP General Mailing List (http://www.php.net/)

[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] 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?

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

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

[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

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

[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 figure out

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 enter

[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

[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

[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

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/

[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.zip

[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.html

[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 configured/

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 files.

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

[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 gallery.

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

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, bsd,

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

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: 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'); $object-printVar(); //

[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; private

[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

Re: [PHP] Sessions again....

2005-08-04 Thread James
So what is your question...? - Original Message - From: Suhas [EMAIL PROTECTED] To: php-general php-general@lists.php.net 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

[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

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

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

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!

[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

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 live

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

[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

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.

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 that is

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

[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] bunch of extra lines more text... -snip- I to change to:

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