Re: [PHP] For the RegExps gurus!

2001-09-07 Thread ~~~i LeoNid ~~
On Fri, 7 Sep 2001 09:39:37 +0200 impersonator of [EMAIL PROTECTED] (* RZe:) planted I saw in php.general: Original message From: ~~~i LeoNid ~~ [EMAIL PROTECTED] Date: Thu, Sep 06, 2001 at 05:30:44PM + Message-ID: 3b97b222.78196206@localhost Subject: Re: [PHP] For the RegExps gurus! You

[PHP] Re: How to pass variables to php functions from url's?

2001-09-07 Thread ~~~i LeoNid ~~
On Fri, 7 Sep 2001 13:28:16 +0200 impersonator of [EMAIL PROTECTED] (\ Tais M. Hansen) planted I saw in php.general: Hi Martin, Take a look at the Apache mod_rewrite docs. http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html I added this to my httpd.conf: Or if you don't have access to

[PHP] execute a script on access to a directory

2001-09-07 Thread Enrique Vadillo
Hi, I would like to know how i can force a PHP script to be executed everytime a certain directory is accessed, for example in http://domain.com/go/getit the presence of the /go/ directory would force a PHP script to be executed prior to any operation. Do i need to play with rewriting urls in

Re: [PHP] execute a script on access to a directory

2001-09-07 Thread Jason Bell
You could always add an include() for every page under the /go directory. Simplest way that I can think of. - Original Message - From: Enrique Vadillo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 07, 2001 12:09 PM Subject: [PHP] execute a script on access to a

[PHP] Error handling and the usage of @

2001-09-07 Thread Seb Frost
Could someone give me an example of the sort of error handling you put in your php scripts? Cheers. Should I be preceding every command with @? Anything where this would be harmful? Just looking for some pointers really :-) - seb --- Outgoing mail is certified Virus Free. Checked by AVG

[PHP] Re: network connections

2001-09-07 Thread Doug Granzow
If you're talking over a million messages, I think you need a solution that is designed specifically for handling mail. I would suggest looking into qmail (www.qmail.org) to replace sendmail on the server in question. qmail is much more efficient than sendmail in handling large amounts of mail,

[PHP] randomly picking a variable from an array

2001-09-07 Thread Joseph Bannon
How do you randomly picking a variable from an array with PHP? Thanks, Joseph PS. Thanks to those who helped me with GD. If you go to my site, you'll see the new counter I created at the top of the page. http://www.collegesucks.com -- PHP General Mailing List

Re: [PHP] execute a script on access to a directory

2001-09-07 Thread Enrique Vadillo
Nope, i'm not talking about a directory containing exclusively PHP scripts, in that case i would've prepended a php script to the directory and we're done, but no, i am talking about access to a directory containing files of any kind. see? Thanks for the help anyway, any better suggestions?

[PHP] Re: Error handling and the usage of @

2001-09-07 Thread Hugh Bothwell
Seb Frost [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Could someone give me an example of the sort of error handling you put in your php scripts? Cheers. Should I be preceding every command with @? Anything where this would be harmful? Just looking for

RE: [PHP] Re: Error handling and the usage of @

2001-09-07 Thread Seb Frost
So I should chuck it on all mysql functions? Done. Don't ya just love search and replacing a whole directory of scripts :-) Still works fine too - bonus! - seb -Original Message- From: Hugh Bothwell [mailto:[EMAIL PROTECTED]] Sent: 07 September 2001 20:32 To: [EMAIL PROTECTED]

RE: [PHP] randomly picking a variable from an array

2001-09-07 Thread Jack Dempsey
create a random number from 0 to count($array) and use that as the index jack -Original Message- From: Joseph Bannon [mailto:[EMAIL PROTECTED]] Sent: Friday, September 07, 2001 3:08 PM To: PHP (E-mail) Subject: [PHP] randomly picking a variable from an array How do you randomly

Re: [PHP] Re: Error handling and the usage of @

2001-09-07 Thread Hugh Bothwell
Seb Frost [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... So I should chuck it on all mysql functions? Done. Don't ya just love search and replacing a whole directory of scripts :-) Still works fine too - bonus! er... I should have noted - if you are going

[PHP] Re: execute a script on access to a directory

2001-09-07 Thread Doug Granzow
You can make go the name of your PHP script, then put this in your Apache config: Location /go ForceType application/x-httpd-php /Location Now in your go script, you have it do whatever you wanted it to do, then use an include to load the getit script. Here's an except from my equivalent

Re: [PHP] randomly picking a variable from an array

2001-09-07 Thread Kath
Example if you do know the number of items in the array: /* Begin */ $choice = rand(1, 6); echo $array[$choice]; /* End */ That will randomly pick something from 1-6 in the array. If you do not know the number of things in the array (say it is off a form or something): /* Begin */ $numinarray

[PHP] Content management

2001-09-07 Thread Scott Parks
Hi All- I am developing a web interface for a school that will allow them to mange the entire site, from users to the actual display elements. The trick has been, they must not have to know HTML to do the administration. The question: does anyone have some links or examples of this kind of

[PHP] Re: clear contents?

2001-09-07 Thread Franklin van Velthuizen
Jeremy Morano [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi everone... I'm having a little problem. The code below pops up a password dialog box where the user types in a username and a password to be able to proceed. However, if the user does not close

[PHP] Re: newbie ? :)

2001-09-07 Thread Gaylen Fraley
Have you contacted Mercury yet? Try them or try the linux.redhat.misc newsgroup. -- Gaylen Caleb Carvalho [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... hello all, i am trying to install Loadrunner for in linux, am not sure where is my LD_LIBRARY_PATH

RE: [PHP] randomly picking a variable from an array

2001-09-07 Thread King, Justin
The easiest way I can think of would be to get a random number based on the size of an array. If you're querying your database and filling an array with all images, just use the database's random routine instead. (I.E. SELECT quote,author from randomQuote ORDER by RAND() LIMIT 1 in mysql) If

RE: [PHP] Content management

2001-09-07 Thread King, Justin
I'm actually doing the same thing for my district. We've developed a code system much like html, only not. Sounds stupid but it works. I mostly ripped off UBB code. For example: [b]bold[/b], [i]italics[/i] Then we give the people using it an instruction sheet. Since [ and ] don't require a

RE: [PHP] randomly picking a variable from an array

2001-09-07 Thread King, Justin
But that would make sense rasmus... and I don't like to make sense =)... if its an array filled from a database, randomizing on the database level would still be better though. --Justin King, School District of Superior Web Coordinator (www.superior.k12.wi.us) -Original Message- From:

[PHP] socket error

2001-09-07 Thread sagar
line10 - if (($sock = socket(AF_INET, SOCK_STREAM, 0)) 0) { echo socket() failed: reason: . strerror($sock) . \n; } i'm getting an error saying Fatal error: Call to undefined function: socket() in c:\program files\apache group\apache\htdocs\test\sock.php on

Re: [PHP] socket error

2001-09-07 Thread Sterling Hughes
On Sat, 8 Sep 2001, sagar wrote: line10 - if (($sock = socket(AF_INET, SOCK_STREAM, 0)) 0) { echo socket() failed: reason: . strerror($sock) . \n; } i'm getting an error saying Fatal error: Call to undefined function: socket() in c:\program files\apache

RE: [PHP] randomly picking a variable from an array

2001-09-07 Thread Sterling Hughes
On Fri, 7 Sep 2001, King, Justin wrote: The easiest way I can think of would be to get a random number based on the size of an array. If you're querying your database and filling an array with all images, just use the database's random routine instead. (I.E. SELECT quote,author from

Re: [PHP] socket error

2001-09-07 Thread sagar
thanX sterling, i've changed it to socket_open() but the problem still exists. /sagar - Original Message - From: Sterling Hughes [EMAIL PROTECTED] To: sagar [EMAIL PROTECTED] Cc: php [EMAIL PROTECTED] Sent: Saturday, September 08, 2001 1:54 AM Subject: Re: [PHP] socket error On

Re: [PHP] socket error

2001-09-07 Thread Sterling Hughes
On Sat, 8 Sep 2001, sagar wrote: thanX sterling, i've changed it to socket_open() but the problem still exists. Sorry, meant socket_create() -- for a list of the new names, open up php4/ext/sockets/sockets.c and take a look at the function entry. -Sterling /sagar -

[PHP] run a script for any HTTP request (was: run a script on access to a directory)

2001-09-07 Thread Enrique Vadillo
That was a fine idea Doug, but what if we push the subject and go a little further? I am thinking now that i'd like to make it possible that for ANY http request received by my Apache i'd like to have a php script executed first, i.e.: http://domain.com/ http://domain.com/anydir/anyfile for

[PHP] Hosting Question

2001-09-07 Thread Matt \TrollBoy\ Wiseman
Anyone ever use Featurehosting.com? They seem ridiculously cheap. I was wondering if they're too good to be true or if they're the real deal. Look at small to medium traffic stes, no amazon.com's here. Matt TrollBoy Wiseman Webmaster: Shoggoth.net Site Designer: phpslash.org The oldest and

Re: [PHP] randomly picking a variable from an array

2001-09-07 Thread Kath
Which is more resource attentive however (Random question, not necessarily pertaining to this)? Making MySQL do extra work or PHP do some extra work? - k - Original Message - From: King, Justin [EMAIL PROTECTED] To: Rasmus Lerdorf [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday,

[PHP] Re: run a script for any HTTP request (was: run a script on accessto a directory)

2001-09-07 Thread Philip Hallstrom
What's wrong with rewriting urls? The other alternative is to make sure that none of the urls you are accessing actually exist and then setup an ErrorDocument handler which calls the php script of your choice... which can then do whatever you want... -philip On Fri, 7 Sep 2001, Enrique Vadillo

Re[2]: [PHP] The future of PHP

2001-09-07 Thread Manuel Carrara
Hello Sean, Thursday, September 06, 2001, 1:46:28 PM, you wrote: SCM My experience is the same. Here in Spain everybody uses Microsoft SCM products. W95, W98, NT everywhere, and now 2000. There a lot of MCSE SCM around and very little Linux/PHP experts. Yes there are a lot of people SCM that

Re: [PHP] randomly picking a variable from an array

2001-09-07 Thread Sheridan Saint-Michel
Actually, the difference in speed between generating a random number in either MySQL or PHP is pretty much negligable. If you can have MySQL return just a single row, however, instead of an entire set of rows then there will be a notable difference =) Sheridan Saint-Michel Website

[PHP] file management

2001-09-07 Thread Gerard Samuel
Can a file be truncated from the beginning, and by x amount of lines?? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

[PHP] PHP 4.0.4pl1 HEAD request problem

2001-09-07 Thread Hardy Merrill
Software: Apache/1.3.19 (Unix) PHP/4.0.4pl1 mod_ssl/2.8.2 OpenSSL/0.9.6 and PHP is built as a loadable module for Apache. HEAD requests to PHP pages that have calls to ob_start() and ob_end_flush() do not work properly. index.php - *without* ob_start() / ob_end_flush()

Re: [PHP] randomly picking a variable from an array

2001-09-07 Thread Rasmus Lerdorf
Which is more resource attentive however (Random question, not necessarily pertaining to this)? Making MySQL do extra work or PHP do some extra work? Generally it would be more efficient to have MySQL do it as part of its SELECT. But there could be cases where it would be more efficient to

Re: [PHP] Re: run a script for any HTTP request (was: run a script on access toa directory)

2001-09-07 Thread Enrique Vadillo
MSIE does not support 404 ErrorDocument, that only works fine with Netscape. Rewriting URLs is nasty when you have to mix it with php script writing, this could be so much simpler with a php script. I know it's a tough question, anyone dares to beat the problem? Enrique- From: Philip Hallstrom

[PHP] Cybercash compiling as shared module

2001-09-07 Thread Michael Kimsal
I'm trying this specifically with the cybercash module. When I just do ./configure --with-cybercash=/path/to/mck, it works (well, it gets thru configure and make anyway). ./configure --with-cybercash=/path/to/mck,shared and ./configure --with-cybercash=shared,/path/to/mck both don't work.

Re: [PHP] file management

2001-09-07 Thread Sterling Hughes
On Fri, 7 Sep 2001, Gerard Samuel wrote: Can a file be truncated from the beginning, and by x amount of lines?? Thanks Truncated from the beginning? Do you mean truncate the file by X lines, starting from the first position in the file, well, yeah: ?php $fp = fopen(filename,

Re: [PHP] Cybercash compiling as shared module

2001-09-07 Thread Sterling Hughes
On Fri, 7 Sep 2001, Michael Kimsal wrote: I'm trying this specifically with the cybercash module. When I just do ./configure --with-cybercash=/path/to/mck, it works (well, it gets thru configure and make anyway). ./configure --with-cybercash=/path/to/mck,shared and ./configure

Re: [PHP] Re: run a script for any HTTP request (was: run a script on access to a directory)

2001-09-07 Thread Jason Bell
Explorer does support 404 documents. You just have to make sure the document is bigger than 512 bytes. - Original Message - From: Enrique Vadillo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, September 07, 2001 2:36 PM Subject: Re: [PHP] Re: run a script

Re: [PHP] Re: run a script for any HTTP request (was: run a scripton access to a directory)

2001-09-07 Thread Rasmus Lerdorf
What do you mean MSIE does not support 404 ErrorDocument? That is a server-side function. It has absolutely nothing to do with the browser. Try going to: http://php.net/strlen That is an ErrorDocument 404 thing that kicks in and takes you to the right place in the PHP documentation. And

Re: [PHP] Re: run a script for any HTTP request (was: run a script on access to a directory)

2001-09-07 Thread Jason Bell
IE has Friendly Error Messages so on a normal 404 response, IE would show it's own error message, and not the one from the server. The Documented way around this is to ensure that your 404 document is larger than 512 bytes. http://www.zdnet.com/products/stories/reviews/0,4161,2779295-3,00.html

[PHP] auto increment

2001-09-07 Thread nate
you know how, if you make a field a primary key and have it auto increment... then if you delete an entry and add a new one it makes the field 2 instead of 1... i know thats explained bad but do you know what i mean? is there a way to make it go back to 1 as if there were never any fields

RE: [PHP] URLencode

2001-09-07 Thread Brandon Orther
I just realized that on the server I am trying to run this on, URLEncode is working like rawurlencode. Does anyone have any idea why this might be happening? Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED]

Re: [PHP] URLencode

2001-09-07 Thread Tom Carter
Simplest way is to do this $string = my string; $string=urlencode(str_replace( ,+,$string)); ie use str_replace to manually replace spaces with +, urlencode then won't do anything further to it - Original Message - From: Brandon Orther [EMAIL PROTECTED] To: PHP User Group [EMAIL

Re: [PHP] Re: run a script for any HTTP request (was: run a scripton access to a directory)

2001-09-07 Thread Rasmus Lerdorf
Sure, I know that very well, but that has nothing to do with what we are discussing here. -Rasmus On Fri, 7 Sep 2001, Jason Bell wrote: IE has Friendly Error Messages so on a normal 404 response, IE would show it's own error message, and not the one from the server. The Documented way

[PHP] private functions

2001-09-07 Thread Lukas
Hello, Sorry, i posted this to my local newsfeed a while ago but i don't think it is propogating properly, however i apologise if this appears twice. --- i've been using private functions like the code below a little, and just discovered that if you call the outside function more than once you

[PHP] GD picture quality

2001-09-07 Thread Joseph Bannon
Take a look at this picture... http://www.sayimhot.com/images/mycurrentscore.jpg ... now take a look at it while text is added to it... http://www.sayimhot.com/myscore.php What happens to the picture quality? How can it be improved? (code below) Thanks, Joseph ?php // create image

[PHP] strange register_shutdown_function() and fopen() conflict

2001-09-07 Thread Kevin Bullaughey
scenario... i am trying to open a file from i function that is called automatically because it is registered with register_shutdown_function(). for some reason i am unable to call fopen(). i am assuming that my script causes a fatal error and i cannot see the output because with apache, one

[PHP] Re: C-style parameterized macros

2001-09-07 Thread 602e23
Neil == Neil Zanella [EMAIL PROTECTED] writes: Neil Hello, Neil I have noticed that PHP can be used to define constants but Neil not parametrized macros, a feature is is currently lacking. Neil It is possible to use arrays instead with the only Neil disadvantage that array

Re: [PHP] GD picture quality

2001-09-07 Thread speedboy
Take a look at this picture... http://www.sayimhot.com/images/mycurrentscore.jpg ... now take a look at it while text is added to it... http://www.sayimhot.com/myscore.php What happens to the picture quality? How can it be improved? (code below) You mean the font quality? The

[PHP] php/mysql search. need help

2001-09-07 Thread lizlynch
i have a form where a user inputs a home service type and this results in a list of that value, eg a user inputs 'plumber' and a list of plumbers is displayed. if a user accidentally types plumbar no results are displayed. is there anyway of making php/mysql recognise the first three letters

Re: [PHP] GD

2001-09-07 Thread Dennis Moore
Make sure you do not have an older version of gd on your system before trying to compile gd a new version. This will save you hours of frustration. /dkm - Original Message - From: Sebastian Wenleder [EMAIL PROTECTED] To: Joseph Bannon [EMAIL PROTECTED]; PHP (E-mail) [EMAIL PROTECTED]

Re: [PHP] file management

2001-09-07 Thread Gerard Samuel
You know what, I think Im explaining myself wrong. The word truncate in itself means I believe to cut at the bottom. This isn't what I need. Basically, its a chat script and all the newer messages are at the bottom, and when the file reaches x bytes I want to 'cut off the head' of the file by x

RE: [PHP] Re: php.ini not being read

2001-09-07 Thread Brett
Is php.ini readable? Any messages in your Apache error log? No messages in the apache error logs. Are you 100% sure you really killed Apache and restarted?... I've had cases where I managed to install the new Apache in a different location, and ended up with two different sets of httpd's

RE: [PHP] Re: php.ini not being read

2001-09-07 Thread Rasmus Lerdorf
I am positive. /etc/rc.d/init.d/httpd stop /etc/rc.d/init.d/httpd start I have never touched the apache installation. I am currently under the impression that compiling with --with-config-file-path=/etc/httpd/conf/php.ini has screwed up the install. That is unless someone has any other

[PHP] Delete top 2 lines (was file management)

2001-09-07 Thread Gerard Samuel
Here is what Im attempting $size = filesize(chat/chat.txt); // get size of file if (filesize(chat/chat.txt) 500) { // if over x bytes chop it down $fp = fopen(./chat/chat.txt, r+); // open a fp $count = 0; // setup a count while

[PHP] Ordering a query

2001-09-07 Thread nate
I use the following code to order the results of the query by the variable $order. $result = mysql_query(SELECT articles.title,vote.votes,vote.total,articles.date,staff.firstname,articles.content,articles.id FROM staff,articles,vote WHERE articles.authorid = staff.id AND articles.id =

[PHP] Iffy W2K, dodgy PHP or sketchy programmer?

2001-09-07 Thread Jon Thompson Coon
Been up for four f**g hours too late trying to find something wrong with my code, lately finding out, that there apparently is nothing wrong with it (in this particular case). I wish for verification. As a developement box I run a W2K, newest Apache and PHP 4.0.whatnot. Had this problem

[PHP] Reprise of dissapearing session variables

2001-09-07 Thread Jason Bell
ok! I've been trying to figure this out, and I'm completely stumped! I've started from scratch with a test script, here is my code: ? session_start(); if (!$PHPSESSID) { $sess_name = Jason; $sess_auth = 1; session_register(sess_name); session_register(sess_auth); }; print

[PHP] PHP and MySQL

2001-09-07 Thread Pieter Philippaerts
Hello, we're using our MySQL database quite extensively from our PHP scripts, but sometimes everything stops working and it says Too many connections. Is there a problem with MySQL support from within PHP? Doesn't it close its connections with the database when the script stops executing? Is

[PHP] files

2001-09-07 Thread Gerard Samuel
hey, I have a large file and I want to keep the last x row of it. I figured out how to navigate to the point where I want to extract the data, but I cant figure out how to extact from the file current $fp and write out the data to another file. Think of it like this, when the file gets to be

Re: [PHP] how to execute a php script thru a cron job

2001-09-07 Thread Carry Ian
thanks daniel, but how do i add it to the cron job for daily execution ? regards carry On Thursday, September 06, 2001 at 10:51:00 PM, Daniel Rezny wrote: Hello Carry, Thursday, September 06, 2001, 5:05:53 PM, you wrote: CI hello, CI can anybody suggest me

Re: [PHP] Re: run a script for any HTTP request (was: run a script on access toa directory)

2001-09-07 Thread Enrique Vadillo
Jason thanks! your information about those 512 bytes is VERY useful but just a lil' too late, i already came up with a solution using a conditional URL rewrite rule in my apache, along with a Location ForceType .. which helps me invoke my php script, if anyone is interested i can send out the

[PHP] how to pass authentication info to SMTP server

2001-09-07 Thread Balaji Ankem
Hi Ramsus and Renze, I would like to implement sending an e-mail through SMTP server. Here my SMTP server needs authentication. How to pass the username and password to SMTP server?? Thanks in advance. Regards -Balaji

Re: [PHP] Re: Function call introspection: possible or not?

2001-09-07 Thread Geoff Caplan
Richard I don't think there is such a documented function available in PHP yet... Use the source, and do it. :-) Sadly I am a humble PHP hacker with no system programming skills, so I'll have to leave it to the experts. Still - it would be a very useful feature, I think, if anyone with the

Re: [PHP] auto increment

2001-09-07 Thread Martín Marqués
On Vie 07 Sep 2001 19:01, [EMAIL PROTECTED] wrote: you know how, if you make a field a primary key and have it auto increment... then if you delete an entry and add a new one it makes the field 2 instead of 1... i know thats explained bad but do you know what i mean? is there a way to make it

Re: [PHP] Locale Month Name

2001-09-07 Thread Papp Gyozo
LC_* are predefined constants, so: setlocale(LC_ALL, LT); - Original Message - From: Veniamin Goldin [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 11:37 AM Subject: [PHP] Locale Month Name Hello ! Please help me, How to get Month name according to

<    1   2