[PHP] cookies

2001-01-13 Thread Steve Lawson
You have to call setcookie() before anything is outputtedthat was it sounds like. SL.

[PHP] User/Group for PHP

2001-01-13 Thread Steve Lawson
Yo, Anyone know of a cfg option that would make files written by php be a different user/group than the apache server user/group? With my current setup, the only way to give php write access also allows any surfer write access to that same folder...which is "not a good thing". Thanks,

Re: [PHP] SQL - Select rand() ?

2001-04-17 Thread Steve Lawson
Sup, In the newer versions of mySQL, you can get random results like SELECT id FROM table ORDER BY rand() LIMIT 0,1 SL. - Original Message - From: "James, Yz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, April 17, 2001 2:55 PM Subject: [PHP] SQL - Select rand() ? >

Re: [PHP] Which is better coding style...

2001-04-19 Thread Steve Lawson
Personally, I hate trailing {'s I think this function blah() { switch( $bob ) { case 1: $var = "whatever"; break; } } Is much easier to read and follow. As for the exiting question... The "proper" way is to use the breaks. "They" say that multiple returns in any

Re: [PHP] Site Searchable function

2001-04-19 Thread Steve Lawson
Hey, Well, I would write two scripts. One to pregen a reference database and one to search using that database. The pregen could use the readdir function that Matthew Luchak suggested. You could use the fopen command to get the pages. fopen("http://localhost/name-of-file") will return the re

Re: [PHP] Starting PHP script with crontab

2001-04-19 Thread Steve Lawson
Sup, You have to make the output write to a file. Like lynx http://www.page.come > /home/me/bleh.htm SL. - Original Message - From: "Bertjan Schrader" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, April 19, 2001 4:15 AM Subject: [PHP] Starting PHP script with crontab

Re: [PHP] PERL vs. PHP

2001-04-20 Thread Steve Lawson
No, you won't. PHP is has very similar syntax to c/c++ and perl but the concepts are extremely different. SL. - Original Message - From: "Jason Caldwell" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, April 20, 2001 3:10 PM Subject: [PHP] PERL vs. PHP > If I know PHP will

Re: [PHP] mysql_free_result

2001-04-21 Thread Steve Lawson
Sup, PHP will automatically free results after the script finishes. But, PHP has a memory cap, I think the default is 8megs -- check php.ini. Anyway, so lets say you wanted to pull 2 large results sets. You may get a memory error. So you could pull 1 result, do the necessary calculations,

Re: [PHP] Apache, PHP, Windows XP, MSIE 6, Cheese, and Cookies.

2001-04-22 Thread Steve Lawson
Yea, I got a solution. Choose a flavor of linux, format your HD, install, and run the that server like it was meant to run. Apache is not even 100% on NT much less the XP beta, it's like your running a beta on a beta...That's why it's not working. Here is a good quote from apache.org: "Please

Re: [PHP] problem with storing & displaying image in db

2001-04-22 Thread Steve Lawson
Why not just store the filename? SL. - Original Message - From: "Keyur Kalaria" <[EMAIL PROTECTED]> To: "php" <[EMAIL PROTECTED]> Sent: Saturday, April 21, 2001 9:52 AM Subject: [PHP] problem with storing & displaying image in db > Hello everybody, > > I am facing a strange problem whi

Re: [PHP] getting rows from separate tables stacked in a single array ? (newbie, mysql)

2001-04-24 Thread Steve Lawson
Sup, It can be done...but it will be complicated. First off. You should check out the extract() php command. http://php.net/extract This function makes entries in an array into local variables. Let's say your row array has 2 columns, title and duration. You can do: while( $row = mysql_f

Re: [PHP] random letters and numbers

2001-04-24 Thread Steve Lawson
Sup, I made this and have been using it for about 6 months without problem. mt_rand() is 4 times faster than normal rand(), remember to use mt_srand() to seed. The 8 in the while controls how long the $password will be... $count = 0; mt_srand( (double) microtime() * 100); while( $coun

Re: [PHP] getting rows from separate tables stacked in a single array ? (newbie, mysql)

2001-04-24 Thread Steve Lawson
Doh, I shoulda thought of that, a temp table is the best way to do it. Altho, I don't see why you have a spot_id as a key for that table. Your are probably never going to access that table via that arbitrary number. If anything, you should make item_id the key. The id on your other tables shoul

Re: [PHP] SQL Query time?

2001-04-25 Thread Steve Lawson
Sup, Adding "explain" before the select query will show you how long it will take, along with some other info, but it won't actually give you the results. I use a the function microtime (http://php.net/microtime) to figure execution time. When called, microtime will return a string with mili

Re: [PHP] problems with a netscape post

2001-08-19 Thread Steve Lawson
Try giving the form a name? I normally use something like... Any it works in NS 4+ SL - Original Message - From: "Quentin Gillet" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, August 19, 2001 10:06 AM Subject: RE: [PHP] problems with a netscape post > I have the same pr