Re: [PHP] In a shared environment...

2002-09-19 Thread Leonid Mamtchenkov

Dear Bill Leonard,

Once you wrote about "[PHP] In a shared environment...":
> Relative newbie here, and I am just coming to grips with something that I
> think is a very bad thing... Please tell me I am wrong.
> 
> When using PHP, it is the Apache user that actually performs things, and
> therefore needs permissions. For example, if I want to write data to a file,
> I have to chmod o+w the directory it's in to get that to happen.

You can use PHP not only in combination with web server (like Apache),
but also as a standalone compiler/interpreter (/usr/bin/php).

> The trouble with this, is a shared environment, doesn't this give anyone who
> can use PHP on your system the ability to write over any other user's file
> if they know the name of it? Am I missing something fundamental here?

If you are using PHP as a standalone tool there is no problem with this.
On the other hand, if you do web development, then you do not usually
write to files.  You use database.  If there is something you absolutely
HAVE to write to file, then you can use /tmp directory for that
purposes.

-- 
Best regards,
  Leonid Mamtchenkov, RHCE
  System Administrator
  Francoudi & Stephanou Ltd.

BOFH: It's stuck in the Web.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Auto-increment value

2002-09-18 Thread Leonid Mamtchenkov

Dear Faisal Abdullah,

Once you wrote about "RE: [PHP] Auto-increment value":
> > There is a similar one for postgresql as well: pg_last_oid() .
> 
> I tried that. It gives me 24807, instead of 5.
> Or is oid is a reference to something else, which would 
> lead me to the '5' i'm looking for?

I'd bet that 24807 is your oid.  Check the difference between
"SELECT * FROM table;" and "SELECT oid,* FROM table;".

HTH.

> -- snip snip --
> 
> if($result = pg_exec($db, $sql))
> {
>   $query = "success";
>   echo "oid : " .pg_last_oid($result);
>   }
> 
> -- snip snip --

-- 
Best regards,
  Leonid Mamtchenkov, RHCE
  System Administrator
  Francoudi & Stephanou Ltd.

BOFH: somebody was calculating pi on the server

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Auto-increment value

2002-09-18 Thread Leonid Mamtchenkov

Dear Faisal Abdullah,

Once you wrote about "RE: [PHP] Auto-increment value":
> Thanks for your reply,
> but I'm using postgresql.
> Mysql is irrelevant for me.

There is a similar one for postgresql as well: pg_last_oid() .

> -Original Message-
> From: Marek Kilimajer [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 18, 2002 7:41 PM
> To: PHP
> Subject: Re: [PHP] Auto-increment value
> 
> MySQL has |LAST_INSERT_ID() function, try it ("SELECT ||LAST_INSERT_ID()")|

-- 
Best regards,
  Leonid Mamtchenkov, RHCE
  System Administrator
  Francoudi & Stephanou Ltd.

BOFH: HTTPD Error 666 : BOFH was here

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Mail system with folders?

2002-09-11 Thread Leonid Mamtchenkov

Dear Leif K-Brooks,

Once you wrote about "[PHP] Mail system with folders?":
> I'm designing a site, and I want to put mail with folders on it.  Fairly 
> simply, but I'm not sure what to do for the default folders.  I want to 
> have three precreated folders: inbox, trash, and sent.  I'm not sure 
> about the best way to do these.  Any ideas?

I think you should investigate more on the subject of "web mail" if that
is what you need to do.  Usually, php (or any other language) is used to
create an interface for an operational mail server, which can be
accessed via IMAP.  You can find lots of examples at
http://www.freshmeat.net or any other software repository.

Do not reinvent the wheel. ;)

-- 
Best regards,
  Leonid Mamtchenkov, RHCE
  System Administrator
  Francoudi & Stephanou Ltd.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Load / Stress Testing

2002-09-09 Thread Leonid Mamtchenkov

Dear Dan Hardiker,

Once you wrote about "[PHP] Load / Stress Testing":
DH> I have a CPU intensive PHP application, and would like to stress test it
DH> to find out the number of concurrent connections I can have before the
DH> response rate from my script is 5 seconds or more.
DH> 
DH> The tests will initally take place over a 100mbs LAN.
DH> 
DH> The following are in use:
DH>   PHP 4.2.3 (using APXS) [also v4.3.0-dev will be tested]
DH>   Apache 1.3
DH>   MySQL 3.23
DH>   FreeBSD 4.6-STABLE
DH> 
DH> Ive thought of writting a load testing script, but Im not after
DH> reinventing the wheel.

There is a benchmarking utlity that comes with apache, called ab.

HTH.

-- 
Best regards,
  Leonid Mamtchenkov, RHCE
  System Administrator
  Francoudi & Stephanou Ltd.

BOFH excuse #159:

Stubborn processes

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php