[PHP] Re: query caching caching in general

2003-01-23 Thread Jean-Christian Imbeault
Justin French wrote:


anyone got any links to decent tutorials on sql caching, and caching in
general?


A few questions:

At what level do you want the caching?
Are you talking about stored procedures?
Do you mean storing functions in the DB? (some DB's, like PostgreSQL can 
compile functions once and reuse the compiled function).

Let me know where you want the caching to be and maybe I have a link or two.

Jc


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



Re: [PHP] htpasswd

2003-01-23 Thread Peter Janett
Don't run the htpasswd program at all, just write the .htpasswd file with
PHP.  The format is very simple, it's just
username:crypted_password

So, you can just write those lines to the file, using the crypt function to
create the crypted password.

Of course the same file permission issues exist that Evan pointed out
(unless you're not in a shred environment, or are running PHP as cgi with
Apache SuExe.), but those issues are for anything you do in PHP.

HTH,

Peter Janett

New Media One Web Services

New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43

PostgreSQL coming soon!

http://www.newmediaone.net
[EMAIL PROTECTED]
(303)828-9882


- Original Message -
From: Evan Nemerson [EMAIL PROTECTED]
To: Kris [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, January 23, 2003 12:37 AM
Subject: Re: [PHP] htpasswd


 Don't chmod .htpasswd- _huge_ security risk... Will your server allow you
to
 have suid scripts??? If so, you can just write a little wrapper and make
it
 suid. If you do that, I'd also reccomend using an extension other than
PHP,
 and/or placing it outside your web root. Wouldn't want people adding
 themselves...

 I'd reccomend not using .htaccess at all, and just whip up a system using
a
 real database, wth the real work done in PHP. htaccess just isn't designed
to
 be dynamic.



 On Wednesday 22 January 2003 06:56 pm, Kris wrote:
  Hi
 
  I've built a secure site. After the user has chosen a valid username and
  password I want my script to run htpasswd on the .htpasswd file in the
  directory. The script can run htpasswd as it doesn't have permission.
  What is the safest way to do this?
  Should I chmod htpasswd or is there a better option for this whole
thing??
 
  Thanks
 
  Kris


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




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




Re: [PHP] Re: query caching caching in general

2003-01-23 Thread Peter Janett
Query caching is something that seems to exist in Cold Fusion, but not PHP.

What I'm referring to is that in Cold Fusion you can specify that query
results be cached in memory, and how long to cache those results.  So, if
you have a page that runs the same query each time it's loaded, and you
cache a query on that page, then the results of that query are in memory, so
the call to the database is not run, instead the results from memory are
used, which can represent a HUGE speed increase.

To be totally repetitive, I'm not talking about a database cacheing results
of a query, but PHP caching the results of the query, instead of querying
the database.

I don't think it's possible to do anything like this in PHP, because of the
multiple database support, different function calls for different databases,
etc.

I've looked around, and found some PHP code that saves results sets in tmp
files, but I'm guessing that having the results cached in memory would be
faster than in files.

I think maybe the file caching was part of a database abstraction layer.

HTH,

Peter Janett

New Media One Web Services

New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43

PostgreSQL coming soon!

http://www.newmediaone.net
[EMAIL PROTECTED]
(303)828-9882


- Original Message -
From: Jean-Christian Imbeault [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 23, 2003 1:20 AM
Subject: [PHP] Re: query caching  caching in general


 Justin French wrote:
 
  anyone got any links to decent tutorials on sql caching, and caching in
  general?

 A few questions:

 At what level do you want the caching?
 Are you talking about stored procedures?
 Do you mean storing functions in the DB? (some DB's, like PostgreSQL can
 compile functions once and reuse the compiled function).

 Let me know where you want the caching to be and maybe I have a link or
two.

 Jc


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




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




RE: [PHP] Re: query caching caching in general

2003-01-23 Thread Clarkson, Nick

I found this on Zend - SQL Query Caching -
http://www.zend.com/zend/tut/tutorial-staub2.php;

The basics to caching is using the serialize() and unserialize() PHP
functions...

I don't know if this will help.

Nick




-Original Message-
From: Peter Janett [mailto:[EMAIL PROTECTED]]
Sent: 23 January 2003 08:41
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: query caching  caching in general


Query caching is something that seems to exist in Cold Fusion, but not PHP.

What I'm referring to is that in Cold Fusion you can specify that query
results be cached in memory, and how long to cache those results.  So, if
you have a page that runs the same query each time it's loaded, and you
cache a query on that page, then the results of that query are in memory, so
the call to the database is not run, instead the results from memory are
used, which can represent a HUGE speed increase.

To be totally repetitive, I'm not talking about a database cacheing results
of a query, but PHP caching the results of the query, instead of querying
the database.

I don't think it's possible to do anything like this in PHP, because of the
multiple database support, different function calls for different databases,
etc.

I've looked around, and found some PHP code that saves results sets in tmp
files, but I'm guessing that having the results cached in memory would be
faster than in files.

I think maybe the file caching was part of a database abstraction layer.

HTH,

Peter Janett

New Media One Web Services

New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43

PostgreSQL coming soon!

http://www.newmediaone.net
[EMAIL PROTECTED]
(303)828-9882


- Original Message -
From: Jean-Christian Imbeault [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 23, 2003 1:20 AM
Subject: [PHP] Re: query caching  caching in general


 Justin French wrote:
 
  anyone got any links to decent tutorials on sql caching, and caching in
  general?

 A few questions:

 At what level do you want the caching?
 Are you talking about stored procedures?
 Do you mean storing functions in the DB? (some DB's, like PostgreSQL can
 compile functions once and reuse the compiled function).

 Let me know where you want the caching to be and maybe I have a link or
two.

 Jc


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




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


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




[PHP] PHP and xemacs

2003-01-23 Thread Hans Jacob Simonsen
Hi 

I have just started using xemacs as editor to my php scripts
I think that the indentation in emacs stinks! xemacs has imorted a php
package for med, but it does not make indentation on my html codes.
table
tr
td
/td
/tr
/table

i would prefer looking like:
table
tr
 td
 /td
and so fourth. 

Is there a way I can do this automatically? Now I do it by pressing space
a lot of times. I hope there is a package I can import. Maybe there is
some shortcut I can press where I want my tabbing to be, something like:

table
 [press short-cut here]
[here I only need to press TAB to get the right indent]

Are there other nice editors for Linux RedHat?

Please help me. I really need it.

Jacob


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




Re: [PHP] PHP and xemacs

2003-01-23 Thread Faisal Abdullah
I use Kate. Love it for the following features:

1. Wonderful customizable syntax highlighting not only for PHP, but
other languages/scripts as well. 

2. Splittable screen

3. Line numbering

4. A handy terminal emulator

5. Indent tracking, and brace tracking

6. Remembers recently opened files. I'll know what I've been working on.

7. Configurable tab spaces (I use 4 spaces)


Faisal


On Thu, 2003-01-23 at 16:47, Hans Jacob Simonsen wrote:
 Hi 
 
 I have just started using xemacs as editor to my php scripts
 I think that the indentation in emacs stinks! xemacs has imorted a php
 package for med, but it does not make indentation on my html codes.
 table
 tr
 td
 /td
 /tr
 /table
 
 i would prefer looking like:
 table
 tr
td
  /td
 and so fourth. 
 
 Is there a way I can do this automatically? Now I do it by pressing space
 a lot of times. I hope there is a package I can import. Maybe there is
 some shortcut I can press where I want my tabbing to be, something like:
 
 table
  [press short-cut here]
 [here I only need to press TAB to get the right indent]
 
 Are there other nice editors for Linux RedHat?
 
 Please help me. I really need it.
 
 Jacob
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 
~~
Faisal Abdullah [EMAIL PROTECTED]
Systems Developer   Magnifix Sdn. Bhd.

Tel : 603-4142 1775 Fax : 603-4142 1550

~~
Isn't it time you browse through a different window?


__


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




[PHP] Uploading and storing large files

2003-01-23 Thread peter a

Hi.

I am currently working on a projekt that will involve uploading files with filesizes 
up to about 10mb, and all sorts of different filetypes and I havet o Questsions 
concerning that.

1 ) How should the upload be done? I don't feel all  that comfortable posting 
10mb-files via a simple html-form, wouldn't that take a while if the connections is 
slow, and even if it was fast, it would take a minute or two. I was drawing out a 
upload functions with the built in ftp-functions,  but then it occured to me, doesn't 
a form always  posts it's content to the server anyway? How do I post large files 
without worrying about broken uploads, timeouts and all that?

2 ) How should I store the files? I suppose I have to optiones. Database ( I have 
mySQL installed ) or in folders (  in RedHat8.0 ) Should I build up  a 
folder-structure to hold the files or just put it all in the database? A mySQL table 
in RedHat can hold 4gb, which is a lot, but my content may exceed that, how coud I 
check the size of the tables, and dynamically create new databases and when running a 
member Query, select content from them all? 
Would a file structure be better, with a folder strucuture for member a-b store in 
this folder c-d to in this and so on... Would it be stupid to store a 1 10mb mpegs 
in one database?

Any suggestions?



   /peter a





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




[PHP] Disable pic copy/save?

2003-01-23 Thread Anthony Rodriguez
Hi!

A client wants to test market two versions of an advertising but wants to 
disable the users' ability to copy/save the ads (right click, copy/save).

How can this be done in PHP?

Thanks!

Anthony F. Rodriguez
([EMAIL PROTECTED])




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



[PHP] compiling php-4.3.0 error message : BrowserMatch regex could not be compiled.

2003-01-23 Thread info
Hello,

I compiled php-4.3.0 succesful --with-apxs=...path-to-apxs after make and make 
install on a RedHat8.0 box.

I started my apache-1.3.27 and got the follwing error message:
 Syntax error on line 956 of /usr/local/apache/conf/httpd.conf:
  BrowserMatch regex could not be compiled. 

Any hints? Any proposals?
 would be great

Oliver Etzel


Re: [PHP] Disable pic copy/save?

2003-01-23 Thread Jason Wong
On Thursday 23 January 2003 17:52, Anthony Rodriguez wrote:
 Hi!

 A client wants to test market two versions of an advertising but wants to
 disable the users' ability to copy/save the ads (right click, copy/save).

 How can this be done in PHP?

It can't be done, period. You need to get the data to the browser for it to be 
displayed. Once it's on the user's browser a determined user will be able to 
save whatever it is that's being displayed.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
It is wrong always, everywhere and for everyone to believe anything upon
insufficient evidence.
- W. K. Clifford, British philosopher, circa 1876
*/


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




RE: [PHP] Disable pic copy/save?

2003-01-23 Thread Clarkson, Nick

This cannt be done in PHP. You would have to use something like Flash or
Java - which is a lot of effort. The best you can do is disable right click
using javascript, but that's easy to circumvent. Because everything's
displayed client side, then a user could go into their Temporary Internet
Files folder and find it in their anyway. Even using Flash or Java, if
someone was determined to grab the individual images, then screenshots and
an app to rebuild gifs would be easy to do. Unless of course they are full
blown Flash ads, which would be harder to 'rip'. Why would a user want to
save an advert anyway ? I don't believe I've ever saved an advert graphic -
in fact I quite often resort to banner blocking, because some sites in
particular go OTT on their use.

Nick


-Original Message-
From: Anthony Rodriguez [mailto:[EMAIL PROTECTED]]
Sent: 23 January 2003 09:52
To: [EMAIL PROTECTED]
Subject: [PHP] Disable pic copy/save?


Hi!

A client wants to test market two versions of an advertising but wants to 
disable the users' ability to copy/save the ads (right click, copy/save).

How can this be done in PHP?

Thanks!

Anthony F. Rodriguez
([EMAIL PROTECTED])




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


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




Re: [PHP] PHP and xemacs

2003-01-23 Thread Hans Jacob Simonsen
On 23 Jan 2003, Faisal Abdullah wrote:

 I use Kate. Love it for the following features:
 
 1. Wonderful customizable syntax highlighting not only for PHP, but
 other languages/scripts as well. 
 
 2. Splittable screen
 
 3. Line numbering
 
 4. A handy terminal emulator
 
 5. Indent tracking, and brace tracking
 
 6. Remembers recently opened files. I'll know what I've been working on.
 
 7. Configurable tab spaces (I use 4 spaces)
 
 
 Faisal
 
 
Sorry I forgot to tell you. I am using GNOME, and I'm on a company
computer so I can't change to KDE.

Jacob


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




[PHP] setcookie function

2003-01-23 Thread Sukrit
Hi listers,

I have some webspace on a Unix server running apache. Things look like
this there:

Path to dir with files - /home/username/public_html/
URL - www.somesite.net/~username

setcookie(id,$randval,time()+3600,Q1,Q2,0);

What do I plug into Q1 and Q2? I want to set cookie for only my part
of the site and not the whole site.

regards
sukrit


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




[PHP] HELP: Regex pattern matching

2003-01-23 Thread Nasko Vassilev
I have an ASCII file which has multiple blocks of text I want to clear. The
scheme is as follows:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
line 1 Everything between the separators,
line 2 including the separators
line 3 I want to clear from the text file
line 4
-

This text I want to keep

There are infinite number of blocks surrounded by exactly the same
separators.
So, I guess I need to clear everything between the starting = and the
ending -.

Can anyone suggest a regex pattern string that would help me accomplish
that?

Thank you all guys in advance!

Nasko




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




Re: [PHP] Disable pic copy/save?

2003-01-23 Thread af
Not true -- you can use JavaScript to catch right-click events and do something 
creative with them, or disable them entirely.

But that, of course, is a client-side scripting issue, which has nothing to do with 
server-side languages such as PHP.

Cheers,
Alex



 On Thursday 23 January 2003 17:52, Anthony Rodriguez wrote:

  Hi!
 
  A client wants to test market two versions of an advertising but wants to
  disable the users' ability to copy/save the ads (right click, copy/save).
 
  How can this be done in PHP?
 
 It can't be done, period. You need to get the data to the browser for it to be 
 displayed. Once it's on the user's browser a determined user will be able to 
 save whatever it is that's being displayed.
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 
 /*
 It is wrong always, everywhere and for everyone to believe anything upon
 insufficient evidence.
 - W. K. Clifford, British philosopher, circa 1876
 */

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




[PHP] Re: Disable pic copy/save?

2003-01-23 Thread Foong
try this article
http://www.devarticles.com/art/1/265

However it is not perfect.

Foong


Anthony Rodriguez [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi!

 A client wants to test market two versions of an advertising but wants to
 disable the users' ability to copy/save the ads (right click, copy/save).

 How can this be done in PHP?

 Thanks!

 Anthony F. Rodriguez
 ([EMAIL PROTECTED])






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




Re: [PHP] Disable pic copy/save?

2003-01-23 Thread Martin Hudec
H it might be done by checking which mouse button is pressed using 
javascript :) but i think this works only in Iexplore ;)...i used such code 
on my webpageit shows only copyright etcanyway user does not need to 
rightclik and save if he knows where is his browser cache located.

Martin


On Thursday 23 January 2003 10:57 am, Jason Wong wrote:
 On Thursday 23 January 2003 17:52, Anthony Rodriguez wrote:
  Hi!
 
  A client wants to test market two versions of an advertising but wants to
  disable the users' ability to copy/save the ads (right click, copy/save).
 
  How can this be done in PHP?

 It can't be done, period. You need to get the data to the browser for it to
 be displayed. Once it's on the user's browser a determined user will be
 able to save whatever it is that's being displayed.


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




[PHP] File upload security

2003-01-23 Thread Marco Alting
Hi, I have a php script which uploads file to a webserver. The idea is that
anyone can upload files, but only another php script can read the files. At
this moment I think someone is deleting file from my upload folder. What
CHMOD settings do I need to secure this?



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




Re: [PHP] Disable pic copy/save?

2003-01-23 Thread Negrea Mihai
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

There is no client side solution. The only one I see is serverside: to put a 
text on the image, a bit transparent so that it does not affect very much the 
image but it can't be used.


- -- 
Negrea Mihai
http://www.negrea.net

On Thursday 23 January 2003 12:17, Martin Hudec wrote:
 H it might be done by checking which mouse button is pressed using
 javascript :) but i think this works only in Iexplore ;)...i used such code
 on my webpageit shows only copyright etcanyway user does not need
 to rightclik and save if he knows where is his browser cache located.

 Martin

 On Thursday 23 January 2003 10:57 am, Jason Wong wrote:
  On Thursday 23 January 2003 17:52, Anthony Rodriguez wrote:
   Hi!
  
   A client wants to test market two versions of an advertising but wants
   to disable the users' ability to copy/save the ads (right click,
   copy/save).
  
   How can this be done in PHP?
 
  It can't be done, period. You need to get the data to the browser for it
  to be displayed. Once it's on the user's browser a determined user will
  be able to save whatever it is that's being displayed.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+L8M98hhhNOp8KlQRAgZ8AJsFU+rVYUep9IB/EDzG6XpSyyrsCwCgvE+Z
S4pfbI10n0sqjf8buSZ3p9Y=
=ADeG
-END PGP SIGNATURE-


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




[PHP] Sessions Security

2003-01-23 Thread Clarkson, Nick

Hi,

I am trying to find the best method for implementing sessions in PHP to
track/limit users. However, the more I read, the more I am concerned about
security. Can anyone give me a definitive answer as to the best method of
tracking users with security in mind ?

Thanks,

Nick


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




Re: [PHP] File upload security

2003-01-23 Thread peter a

Files in web folders should usually be 755
  /peter a



At 2003-01-23 11:15, Marco Alting wrote:
Hi, I have a php script which uploads file to a webserver. The idea is that
anyone can upload files, but only another php script can read the files. At
this moment I think someone is deleting file from my upload folder. What
CHMOD settings do I need to secure this?



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


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




[PHP] PHP and Oracle

2003-01-23 Thread Christophe Valentin
Hello,

Does someone had a speed trouble when using PHP and Oracle with OCI ??
The trouble i have is that the php pages are slower and slower during the
day.
It looks that if I make an apache restart things restart in a good way.
I don't understand where the trouble come from.

Help !

Christophe


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




[PHP] get current username from the windows system

2003-01-23 Thread Thomas Franz
Hi.

is their a possibilty to get the windows username of the current logged on
user with php.

I want this to make a logon dialog more comfortable.

Thanks for an answer and a little example if it's possible.

Thomas




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




Re: [PHP] Disable pic copy/save?

2003-01-23 Thread MH
If someone wants your pic, he will take it, even if Alt+Print Screen is the
last resort.  The best way is to watermark it with text to make it unusable,
but even with some patients this can be edited out if they want it badly
enough.

Mh

Jason Wong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Thursday 23 January 2003 17:52, Anthony Rodriguez wrote:
  Hi!
 
  A client wants to test market two versions of an advertising but wants
to
  disable the users' ability to copy/save the ads (right click,
copy/save).
 
  How can this be done in PHP?

 It can't be done, period. You need to get the data to the browser for it
to be
 displayed. Once it's on the user's browser a determined user will be able
to
 save whatever it is that's being displayed.

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *

 /*
 It is wrong always, everywhere and for everyone to believe anything upon
 insufficient evidence.
 - W. K. Clifford, British philosopher, circa 1876
 */




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




[PHP] Page doesn't load..

2003-01-23 Thread Borut Kovacec
Hello ..

I don't know if this is the right question for this mailing list .. but I'm having 
some problems with loading some php pages, localy on my computer (win XP, apache 
1.3,Mysql) ..

The prioblem is that certain page doesnt load ... I get The page doesn't exist 
message .. but it's there... 
And then if I press refresh button couple of times, then sometimes it works .. but if 
I hit refresh aggain it doesn't work aggain...

Would anybody maybe have an idea of what could be wrong?

Thanx in advance
B.



Re: [PHP] get current username from the windows system

2003-01-23 Thread Justin French
So, you want the server (PHP) to probe the client (user's) remote machine to
find out the windows username?

Can't be done.  First thing to remember is that PHP is server side.  SOME
LIMITED information is sent to the server by the browser, but I doubt this
would ever be considered -- or even secure.

Second thing to remember is that not every user will be on a windows
machine.

Some things can be achieved by client side scripts like javascript, but I
honestly doubt you could do this, not would it be secure for the user.


Justin


on 23/01/03 9:43 PM, Thomas Franz ([EMAIL PROTECTED]) wrote:

 Hi.
 
 is their a possibilty to get the windows username of the current logged on
 user with php.
 
 I want this to make a logon dialog more comfortable.
 
 Thanks for an answer and a little example if it's possible.
 
 Thomas
 
 
 


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




[PHP] handling files error

2003-01-23 Thread Gilberto Garcia Jr.
Hey guys,

I have a red hat 7.3 server running apache and php4. It all seems working fine, but 
when I try to upload a file through a form I got nothing. I mean, I can ouput the temp 
name of the file, the final name, size and other stuff. but some functions don´t work.

Like

If (!is_executable($userfile_temp)) - this don´t block executables files.

if I change to If (!is_executable($userfile_name)) - it´s point me that all files is 
executable.

and when i try to move the file from /tmp directory to another directory with 
move_upload_file function. This func. doesn´t do anything, and doesn´t move the file 
to the specified directory

any help are welcome

[]´s
Iced Sun



[PHP] session domain

2003-01-23 Thread Stain

i would use sessions in multiple hosts of my domain. say my domain is 
example.com, i'd use sessions in several hosts such as:
www1.example.com
www2.example.com
www3.example.com

this could be easily configured in php.ini by putting:
session.cookie_domain = example.com

but how can i do if i would EXCLUDE some hosts of my domain? someting like 
giving the exact list of hosts the cookie should be sent by user clients to 
the server:
session.cookie_domain = www1.exclude.com,www2.example.com,www3.example.com
(i tried, but it doesn't works!)

such thing is useful when you have some hosts in which you're sure you manage 
them, while some others you're not so sure. for istance, someone on an hosted 
site of the same domain could catch all sessions clients sent to his site and 
re-use those sessions faking someone other authentication...

some hints?

tell me if it's not clear...

bye, stain.

-- 
If there is any, error is human

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




Re: [PHP] PHP and xemacs

2003-01-23 Thread Chris Hewitt
Hans Jacob Simonsen wrote:


Sorry I forgot to tell you. I am using GNOME, and I'm on a company
computer so I can't change to KDE.


I'm using gnome and kate works by just typing its name at a shell prompt.

HTH
Chris



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




[PHP] nested queries/loops

2003-01-23 Thread Justin French
Hi all,

I'm aware that this post is borderline MySQL, but the solution may be more
PHP-oriented, so I'm asking here first.

I have 4 related tables:

partner (id,name,url,desc)
category (id,name)
service (id,categoryid,name)
pid_to_sid (pid,sid)

To point out the obvious, a partner provides one or more services, and a
service belongs to a category.

However, the above table structure may not be the best solution, because I'm
find that I need to perform MANY queries to get the information I need.

For example, to retrieve all 20 partners, with a list of the services they
perform, broken into the 5 categories, requires heaps of queries:

while(partners loop of 20+ partners)
{
while(category loop of 5+ categories)
{
list services that match this cat and partner
}
}

Or, if I want to show tick boxes for all the services (broken by category)
for a particular partner (say on an admin form):

while(category loop of 5)
{
while(all services loop of 30)
{
query DB to see if service is true for this partner
}
}


So, what I'm looking for is some missing snippet of code or information, or
some little theory or tutorial that shows me the light on how I might reduce
the number of queries, perform smarter, more complex queries, or something
like that.

Otherwise, I can see myself writing some really sluggish code :)


Or perhaps my problem is back at the database level, with too many tables,
or whatever.


Justin French


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




Re: [PHP] HELP: Regex pattern matching

2003-01-23 Thread af
Hmmm... I was about to reply with a simple solution, but there's a problem with it 
that I can't explain.  Assuming the text is in $str...

I can't get preg_replace to match a newline at the end of a pattern.  If I use...

 $str = preg_replace('/\n=.+--\n/sU', '', $str);

...it matches nothing, but if I put a tag character at the end of the dashes, e.g.

x

...then use...
 
 $str = preg_replace('/\n=.+--x/sU', '', $str);

...it works perfectly.  I'm not sure why the pattern doesn't care about the first 
newline, but it chokes on the second one.  Any thoughts?

Thanks,
Alex



 I have an ASCII file which has multiple blocks of text I want to clear. The
 scheme is as follows:
 
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 line 1 Everything between the separators,
 line 2 including the separators
 line 3 I want to clear from the text file
 line 4
 -
 
 This text I want to keep
 
 There are infinite number of blocks surrounded by exactly the same
 separators.
 So, I guess I need to clear everything between the starting = and the
 ending -.
 
 Can anyone suggest a regex pattern string that would help me accomplish
 that?
 
 Thank you all guys in advance!
 
 Nasko

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




Re: [PHP] get current username from the windows system

2003-01-23 Thread 1LT John W. Holmes
$_SERVER['LOGON_USER'] also works.

---John Holmes...


- Original Message -
From: James Lobley [EMAIL PROTECTED]
To: 'Thomas Franz' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Thursday, January 23, 2003 6:05 AM
Subject: RE: [PHP] get current username from the windows system


 Hi Thomas,

 The following code should help you...
 Note that you have to turn off anonymous access in IIS, so that the user
 authenticates to a domain.

 ?
 $ip = getenv(REMOTE_ADDR);
 echo(IP address is $ipBR);

 $user_chunks = explode(\\,strtoupper(getenv(REMOTE_USER)));
 $user_domain = $user_chunks[0];
 $user_name = $user_chunks[1];

 echo(User domain is $user_domainBR);
 echo(User name is $user_nameBR);
 ?


 James


 -Original Message-
 From: Thomas Franz [mailto:[EMAIL PROTECTED]]
 Sent: 23 January 2003 10:44
 To: [EMAIL PROTECTED]
 Subject: [PHP] get current username from the windows system


 Hi.

 is their a possibilty to get the windows username of the current logged on
 user with php.

 I want this to make a logon dialog more comfortable.

 Thanks for an answer and a little example if it's possible.

 Thomas




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


 This email is only intended for the person(s) to whom it is addressed and
 may contain confidential information.  Unless stated to the contrary, any
 opinions or comments are personal to the writer and do not represent the
 official view of the company.  If you have received this e-mail in error,
 please notify us immediately by reply e-mail and then delete this message
 from your system.  Please do not copy it or use if for any purposes, or
 disclose its contents to any other person.

 We make every effort to keep our network free from viruses. You should
 independently check this e-mail and any attachments for viruses, as we
 can take no responsibility for any computer viruses that might be
 transferred by way of this e-mail.



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



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




[PHP] JOB: PHP SOFTWARE ENGINEER (Cape Town, South Africa)

2003-01-23 Thread Mark Henderson
JOB: PHP SOFTWARE ENGINEER

DESCRIPTION
Small, fast-paced, software company seeks PHP Software Engineer.
Our Software Engineers are responsible for all aspects of
technical development, including architecture, design,
implementation, and performance tuning. They play a key role in
helping the organization think through its processes and become
more efficient. This is an ideal opportunity for someone
interested in joining a small team, taking on significant
responsibility, and seeing the impact of their work.


RESPONSIBILITIES
* Work with business users during design process
* Implement high-quality applications
* Troubleshoot and stabilize existing code
* Scalability planning


REQUIREMENTS
This role requires at least 2-3 years experience building
complex, data-driven web systems. The successful candidate will
demonstrate:
* Significant skill  in PHP scripting language (a must!)
* Proficiency in Object Oriented design and development
* Proficiency with SQL and relational database design
* Positive, can-do attitude
* Ability to work directly with business users


PREFERRED
* Proficiency in Ruby, Python or similar OO scripting languages
* Working knowledge of Linux, Apache, and MySQL
* BS in Computer Science or equivalent background in data
structures and algorithms
* Basic familiarity with networking and system administration


ABOUT KALUMA Kaluma Development (Pty) Ltd is an Open Source
friendly software development firm based in Cape Town, South
Africa.

Please send your resume to [EMAIL PROTECTED] We encourage a
(very brief) cover letter citing an example of an interesting
and/or complex project you've undertaken.

Principals only. Recruiters, please don't contact us.
Please email. No phone calls about this job.



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




[PHP] Extending PHP

2003-01-23 Thread MH
I am looking for 3d party extensions of PHP like PHPTurbine.  Anything will
do, I am just curious whats available.  Anyone know of any sites dedicated
to PHP extensions that I can look at?

Thanks
Mh



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




Re: [PHP] nested queries/loops

2003-01-23 Thread Tim Ward
// pseudo code (mostly)
if (mysql_query(SELECT * FROM partner, category, service
WHERE partner.id = service.id
AND service.categoryid = category.id))
{while ($array = mysql_fetcharray($result))
{$partners[$array[id][]= $array;
}
}

// then do ...
foreach($partners as $services)
{...
foreach($services as $service)
{...
}
}

this may not be quite what you need but you get the general idea.
looks like services as effectively a many to many link table, nothing
wrong with that as far as I can see

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
- Original Message -
From: Justin French [EMAIL PROTECTED]
To: php [EMAIL PROTECTED]
Sent: Thursday, January 23, 2003 11:26 AM
Subject: [PHP] nested queries/loops


 Hi all,

 I'm aware that this post is borderline MySQL, but the solution may be more
 PHP-oriented, so I'm asking here first.

 I have 4 related tables:

 partner (id,name,url,desc)
 category (id,name)
 service (id,categoryid,name)
 pid_to_sid (pid,sid)

 To point out the obvious, a partner provides one or more services, and a
 service belongs to a category.

 However, the above table structure may not be the best solution, because
I'm
 find that I need to perform MANY queries to get the information I need.

 For example, to retrieve all 20 partners, with a list of the services they
 perform, broken into the 5 categories, requires heaps of queries:

 while(partners loop of 20+ partners)
 {
 while(category loop of 5+ categories)
 {
 list services that match this cat and partner
 }
 }

 Or, if I want to show tick boxes for all the services (broken by category)
 for a particular partner (say on an admin form):

 while(category loop of 5)
 {
 while(all services loop of 30)
 {
 query DB to see if service is true for this partner
 }
 }


 So, what I'm looking for is some missing snippet of code or information,
or
 some little theory or tutorial that shows me the light on how I might
reduce
 the number of queries, perform smarter, more complex queries, or something
 like that.

 Otherwise, I can see myself writing some really sluggish code :)


 Or perhaps my problem is back at the database level, with too many tables,
 or whatever.


 Justin French


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




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




[PHP] Re: textarea new line

2003-01-23 Thread Neil M
Adi wrote:

i want to add in textarea a string with new line tag in it. how to do that?

my try:
$string=-line1n\ -line2 n\-line3;
echo brtextarea name='aria' cols='50' rows='2'$string/textarea;

but i see a single line instead of:
-line1
-line2
-line3

tx in advance for any help



Hello

For a new line in a text area you cant use html br's

You need to use either \n OR \r\n

Thanks

Neil


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




[PHP] Re: Removing the #!/usr... from cgi output?

2003-01-23 Thread Neil M
Colin McDonald wrote:

Did you try it without that line at all?

I'm pretty sure you can setup apache (you are using apache right?) to 
use /usr/.../bin/php for all files with the extension .php

colin

David Brannlund wrote:

Example:

  #!/usr/local/bin/php
  ?php
  print foo;
  ?

becomes

  #!/usr/local/bin/php
  foo





Hi there

yes , the shebang ( the  #!/usr/local/bin/php ) is not needed for use 
with dynamic webpages wether they be perl , php or whatever

Shebangs are used only with shell based scripts. Your webserver should 
be configured to know what to do with the file by extension, e.g. .php 
files should be processed by php in apache

This link describes how to configure a webserver to do this

http://www.php.net/manual/en/install.unix.php
( a unix server , but its nearly the same for windows )


Thanks

Neil


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



[PHP] Re: File upload problem

2003-01-23 Thread Neil M
John M wrote:

Hello,

I have the code below. It's a simple file upload. But it doesn't work.
Before the line if(isset( $Submit )) is an echo which can I read. But after
choosing a file and press a submit nothing happens. Why is if(isset(
$Submit )) always false? Maybe my apache or php config is wrong?

I use WinXp Prof, Apache 2.0.43, PHP 4.2.3, safe_mode is on , upload_tmp_dir
is c:\tmp\ and upload_max_filesize is 2M in PHP config file.



try a double \\ in windows paths



Thanks!


html
head
titleUntitled Document/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head
body

form name=form1 method=post action= enctype=multipart/form-data


you will need to put a form action url in above line , like 
action=http://www.domain-name.com/script.php;

input type=file name=imagefile
input type=submit name=Submit value=Submit

?
echo Before submit br\n;
if(isset( $Submit ))
{
echo After submit br\n;

if ($_FILES['imagefile']['type'] == image/gif){
copy ($_FILES['imagefile']['tmp_name'],
files/.$_FILES['imagefile']['name'])
or die (Could not copy);
echo Name: .$_FILES['imagefile']['name'].;
   }
 else {
echo ;
echo Could Not Copy, Wrong Filetype
(.$_FILES['imagefile']['name'].);
}
}
?
/form

/body
/html




Thanks

Neil


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




Re: [PHP] Re: textarea new line

2003-01-23 Thread Ernest E Vogelsinger
At 12:55 23.01.2003, Neil M said:
[snip]
Adi wrote:
 i want to add in textarea a string with new line tag in it. how to do that?
 
 my try:
 $string=-line1n\ -line2 n\-line3;
 echo brtextarea name='aria' cols='50' rows='2'$string/textarea;
 
 but i see a single line instead of:
 -line1
 -line2
 -line3
[snip] 

Use nl2br(), something like:

echo 'textarea', nl2br(htmlentities($string)), '/textarea';

This should give you the results you need.


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] nested queries/loops

2003-01-23 Thread Marek Kilimajer
For me it seems it can be done with one mysql query:
SELECT * FROM partner p LEFT JOIN pid_to_sid p2s ON p.id=p2s.pid LEFT 
JOIN service s ON p2s.sid=s.id LEFT JOIN category c ON s.categoryid=c.id 
WHERE $your_conditions ORDER BY p.name, c.name, s.name

The important part is ORDER BY clause, so when you retrieve the rows, by 
checking p.id and c.id to its previous ids, you find out you encountered 
next partner or category, respectively (if p.id has changed, c.id has 
changed too). LEFT JOINs are used so you get also partners not providing 
any service. You also use same column names in several tables, so 
instead of asterix use p.name AS partner_name and so on.

Hope this helps

Justin French wrote:

Hi all,

I'm aware that this post is borderline MySQL, but the solution may be more
PHP-oriented, so I'm asking here first.

I have 4 related tables:

partner (id,name,url,desc)
category (id,name)
service (id,categoryid,name)
pid_to_sid (pid,sid)

To point out the obvious, a partner provides one or more services, and a
service belongs to a category.

However, the above table structure may not be the best solution, because I'm
find that I need to perform MANY queries to get the information I need.

For example, to retrieve all 20 partners, with a list of the services they
perform, broken into the 5 categories, requires heaps of queries:

while(partners loop of 20+ partners)
   {
   while(category loop of 5+ categories)
   {
   list services that match this cat and partner
   }
   }

Or, if I want to show tick boxes for all the services (broken by category)
for a particular partner (say on an admin form):

while(category loop of 5)
   {
   while(all services loop of 30)
   {
   query DB to see if service is true for this partner
   }
   }


So, what I'm looking for is some missing snippet of code or information, or
some little theory or tutorial that shows me the light on how I might reduce
the number of queries, perform smarter, more complex queries, or something
like that.

Otherwise, I can see myself writing some really sluggish code :)


Or perhaps my problem is back at the database level, with too many tables,
or whatever.


Justin French


 



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




Re: [PHP] HELP: Regex pattern matching

2003-01-23 Thread Nasko Vassilev
Hmm... i'm not that advanced...
May be first I replace any string containing --- with ---x, then use
your solution?

[EMAIL PROTECTED] wrote in message
news:r01050400-1023-F7D646F52EC711D78B79003065B83B6C@[208.37.41.173]...
 Hmmm... I was about to reply with a simple solution, but there's a problem
with it that I can't explain.  Assuming the text is in $str...

 I can't get preg_replace to match a newline at the end of a pattern.  If I
use...

  $str = preg_replace('/\n=.+--\n/sU', '', $str);

 ...it matches nothing, but if I put a tag character at the end of the
dashes, e.g.

 x

 ...then use...

  $str = preg_replace('/\n=.+--x/sU', '', $str);

 ...it works perfectly.  I'm not sure why the pattern doesn't care about
the first newline, but it chokes on the second one.  Any thoughts?

 Thanks,
 Alex



  I have an ASCII file which has multiple blocks of text I want to clear.
The
  scheme is as follows:
 
  =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  line 1 Everything between the separators,
  line 2 including the separators
  line 3 I want to clear from the text file
  line 4
  -
 
  This text I want to keep
 
  There are infinite number of blocks surrounded by exactly the same
  separators.
  So, I guess I need to clear everything between the starting = and the
  ending -.
 
  Can anyone suggest a regex pattern string that would help me accomplish
  that?
 
  Thank you all guys in advance!
 
  Nasko



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




Re: [PHP] Page doesn't load..

2003-01-23 Thread Marek Kilimajer
Do you get the message from apache? If so, check apache logs. If it is 
the exploder's default error page, turn user friendly messages off (in 
IE), or try another browser

Borut Kovacec wrote:

Hello ..

I don't know if this is the right question for this mailing list .. but I'm having some problems with loading some php pages, localy on my computer (win XP, apache 1.3,Mysql) ..

The prioblem is that certain page doesnt load ... I get The page doesn't exist message .. but it's there... 
And then if I press refresh button couple of times, then sometimes it works .. but if I hit refresh aggain it doesn't work aggain...

Would anybody maybe have an idea of what could be wrong?

Thanx in advance
B.

 



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




Re: [PHP] session domain

2003-01-23 Thread Marek Kilimajer
It is cookie restriction, you can
- set several cookies, but it won't work if user has third party cookies 
disabled (many have)
- pass session id in url if the url is cross domain

Stain wrote:

i would use sessions in multiple hosts of my domain. say my domain is 
example.com, i'd use sessions in several hosts such as:
www1.example.com
www2.example.com
www3.example.com

this could be easily configured in php.ini by putting:
session.cookie_domain = example.com

but how can i do if i would EXCLUDE some hosts of my domain? someting like 
giving the exact list of hosts the cookie should be sent by user clients to 
the server:
session.cookie_domain = www1.exclude.com,www2.example.com,www3.example.com
(i tried, but it doesn't works!)

such thing is useful when you have some hosts in which you're sure you manage 
them, while some others you're not so sure. for istance, someone on an hosted 
site of the same domain could catch all sessions clients sent to his site and 
re-use those sessions faking someone other authentication...

some hints?

tell me if it's not clear...

bye, stain.

 



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




[PHP] A rather strange problem.

2003-01-23 Thread Denis L. Menezes
hello friends,

I run some queries and output the database fields in a form with text boxes for the 
purpose of editing by the administrator. My problem is that if my field value is of 2 
words or more, my output text box shows only the first work. e.g. if the field is 
Jane Enterprises, the textbox shows only jane. My code is below. Can someone 
please tell me what it is I am doing wrong?

Quote :


?php

 while($row=mysql_fetch_array($result)){
 print  form name=\form1\ method=\post\ action=\update.php\;
   print  input name=\OrgName\ type=\text\ id=\OrgName\ size=\30\ 
value=$row[OrgName];
 print  /form;
 }
 ?

Unquote

Thanks
denis


RE: [PHP] A rather strange problem.

2003-01-23 Thread Jon Haworth
Hi Denis,

 if the field is Jane Enterprises, the textbox shows only jane. 

At the moment, if you view the HTML, you'll see:

  input value=Jane Enterprises

Your browser sees this as an input with a value of jane and an attribute
called enterprises, which it doesn't recognise (and therefore ignores
completely).

What you need to do is stick quotes round this, so it'll become:

  input value=Jane Enterprises


HTH
Jon


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




Re: [PHP] Reading Directory in reverse

2003-01-23 Thread Marek Kilimajer
It does not read it in reverse alphabetical order, but in the order it 
is listed on the filesystem, which happens to be in reverse alphabetical 
order. If you need it ordered, use

$files=array();
if (!($dp = opendir($default_dir))) die(cannot open $default_dir);
while($file = readdir($dp))
   if($file != '.'  $file != '..') $files[]=$file;
closedir($dp);

sort($files);
foreach($files as $file) {
	echoa href='opendir.php?opendir=$file'$file/aBR;
}



Bob Irwin wrote:

Hi Guys,

Does anyone happen to know why the below code reads the directory in reverse
alphabetical order?  Not a major problem - easy enough to whack it in an
array and sort it, but annoying nonetheless.


$default_dir = ../screenshots;

if (!($dp = opendir($default_dir))) die(cannot open $default_dir);
while($file = readdir($dp))
   if($file != '.'  $file != '..') echoa
href='opendir.php?opendir=$file'$file/aBR;
closedir($dp);

Best Regards
Bob Irwin
Server Admin  Web Programmer
Planet Netcom


 



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




Re: [PHP] handling files error

2003-01-23 Thread Gilberto Garcia Jr.
Thanks, but just a little part of the problem was solved.

the other part is: why php doesn´t move the upload file to the specified
directory, with move_uploaded_file?
- Original Message -
From: Marek Kilimajer [EMAIL PROTECTED]
To: Gilberto Garcia Jr. [EMAIL PROTECTED]
Cc: PHP [EMAIL PROTECTED]
Sent: Thursday, January 23, 2003 10:36 AM
Subject: Re: [PHP] handling files error


 None of the uploaded files is executable, even if it is some .exe or
 shell script, simply it does not have the permission to execute.
 $userfile_name is only the name of the file as it was on the client's
 machine, there is no such file on your filesystem (unless you create it)

 Gilberto Garcia Jr. wrote:

 Hey guys,
 
 I have a red hat 7.3 server running apache and php4. It all seems working
fine, but when I try to upload a file through a form I got nothing. I mean,
I can ouput the temp name of the file, the final name, size and other stuff.
but some functions don´t work.
 
 Like
 
 If (!is_executable($userfile_temp)) - this don´t block executables
files.
 
 if I change to If (!is_executable($userfile_name)) - it´s point me that
all files is executable.
 
 and when i try to move the file from /tmp directory to another directory
with move_upload_file function. This func. doesn´t do anything, and doesn´t
move the file to the specified directory
 
 any help are welcome
 
 []´s
 Iced Sun
 
 
 


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




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




Re: [PHP] session domain

2003-01-23 Thread Stain

i thought this about cookies... but i would cookies to be sent by clients only 
on some hosts of the same domain, just this.

bye, stain.


Il 13:40, giovedì 23 gennaio 2003, Marek Kilimajer ha scritto:
 It is cookie restriction, you can
 - set several cookies, but it won't work if user has third party cookies
 disabled (many have)
 - pass session id in url if the url is cross domain

 Stain wrote:
 i would use sessions in multiple hosts of my domain. say my domain is
 example.com, i'd use sessions in several hosts such as:
 www1.example.com
 www2.example.com
 www3.example.com
 
 this could be easily configured in php.ini by putting:
 session.cookie_domain = example.com
 
 but how can i do if i would EXCLUDE some hosts of my domain? someting like
 giving the exact list of hosts the cookie should be sent by user clients
  to the server:
 session.cookie_domain = www1.exclude.com,www2.example.com,www3.example.com
 (i tried, but it doesn't works!)
 
 such thing is useful when you have some hosts in which you're sure you
  manage them, while some others you're not so sure. for istance, someone
  on an hosted site of the same domain could catch all sessions clients
  sent to his site and re-use those sessions faking someone other
  authentication...
 
 some hints?
 
 tell me if it's not clear...
 
 bye, stain.

-- 
If there is any, error is human

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




Re: [PHP] A rather strange problem.

2003-01-23 Thread Marek Kilimajer
And also use htmlspecialchars()

print ' input name=OrgName type=text id=OrgName size=30 value='.htmlspecialchars($row['OrgName']).'';



Jon Haworth wrote:


Hi Denis,

 

if the field is Jane Enterprises, the textbox shows only jane. 
   


At the moment, if you view the HTML, you'll see:

 input value=Jane Enterprises

Your browser sees this as an input with a value of jane and an attribute
called enterprises, which it doesn't recognise (and therefore ignores
completely).

What you need to do is stick quotes round this, so it'll become:

 input value=Jane Enterprises


HTH
Jon


 



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




Re: [PHP] HELP: Regex pattern matching

2003-01-23 Thread 1LT John W. Holmes
If the separators are always the same length, then you can use the
following:

$new_str = preg_replace(/(=-){5}(.*)-{10}/sU,,$str);

Where 5 is how many times the =- pattern repeats, and 10 is how many times
the - character repeats.

Hope that helps.

---John Holmes...

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 23, 2003 6:44 AM
Subject: Re: [PHP] HELP: Regex pattern matching


 Hmmm... I was about to reply with a simple solution, but there's a problem
with it that I can't explain.  Assuming the text is in $str...

 I can't get preg_replace to match a newline at the end of a pattern.  If I
use...

  $str = preg_replace('/\n=.+--\n/sU', '', $str);

 ...it matches nothing, but if I put a tag character at the end of the
dashes, e.g.

 x

 ...then use...

  $str = preg_replace('/\n=.+--x/sU', '', $str);

 ...it works perfectly.  I'm not sure why the pattern doesn't care about
the first newline, but it chokes on the second one.  Any thoughts?

 Thanks,
 Alex



  I have an ASCII file which has multiple blocks of text I want to clear.
The
  scheme is as follows:
 
  =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  line 1 Everything between the separators,
  line 2 including the separators
  line 3 I want to clear from the text file
  line 4
  -
 
  This text I want to keep
 
  There are infinite number of blocks surrounded by exactly the same
  separators.
  So, I guess I need to clear everything between the starting = and the
  ending -.
 
  Can anyone suggest a regex pattern string that would help me accomplish
  that?
 
  Thank you all guys in advance!
 
  Nasko

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



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




Re: [PHP] nested queries/loops

2003-01-23 Thread Justin French
Thanks Marek, That put me right on track :)

Justin



on 23/01/03 11:24 PM, Marek Kilimajer ([EMAIL PROTECTED]) wrote:

 SELECT * FROM partner p LEFT JOIN pid_to_sid p2s ON p.id=p2s.pid LEFT
 JOIN service s ON p2s.sid=s.id LEFT JOIN category c ON s.categoryid=c.id
 WHERE $your_conditions ORDER BY p.name, c.name, s.name


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




Re: [PHP] Uploading and storing large files

2003-01-23 Thread Marek Kilimajer


peter a wrote:


Hi.

I am currently working on a projekt that will involve uploading files with filesizes up to about 10mb, and all sorts of different filetypes and I havet o Questsions concerning that.

1 ) How should the upload be done? I don't feel all  that comfortable posting 10mb-files via a simple html-form, wouldn't that take a while if the connections is slow, and even if it was fast, it would take a minute or two. I was drawing out a upload functions with the built in ftp-functions,  but then it occured to me, doesn't a form always  posts it's content to the server anyway? How do I post large files without worrying about broken uploads, timeouts and all that?


Unless you want to give the users anonymous ftp write access (plain 
wrong), you have to go with post uploads. You don't need to worry about 
timeouts.


2 ) How should I store the files? I suppose I have to optiones. Database ( I have mySQL installed ) or in folders (  in RedHat8.0 ) Should I build up  a folder-structure to hold the files or just put it all in the database? A mySQL table in RedHat can hold 4gb, which is a lot, but my content may exceed that, how coud I check the size of the tables, and dynamically create new databases and when running a member Query, select content from them all? 
Would a file structure be better, with a folder strucuture for member a-b store in this folder c-d to in this and so on... Would it be stupid to store a 1 10mb mpegs in one database?

For files this big and so many, you definately want to go with filesystem.



Any suggestions?



  /peter a





 



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




[PHP] PHP Image Gallery

2003-01-23 Thread 1LT John W. Holmes
I know there are a ton of these out there and I've used a few of them, but
I'm looking for a specific feature, of course. :)

Does anyone know of a Gallery system where I can, once it's installed, just
drop a folder full of images into the gallery_root and the program
automatically makes it into a new gallery on the web site. In other words,
I don't want to go through and Browse... for each and every file.

Any advice is greatly appreciated. Again, I already know what gallery
program you use (I'm psychic ;) and I agree with you that it's the best
program out there, but does it have the above feature?

---John Holmes...


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




Re: [PHP] PHP and Oracle

2003-01-23 Thread Larry E. Ullman
Does someone had a speed trouble when using PHP and Oracle with OCI ??
The trouble i have is that the php pages are slower and slower during 
the
day.
It looks that if I make an apache restart things restart in a good way.
I don't understand where the trouble come from.

I've seen this once before and the cause was lots of phantom Oracle 
connections left open. So it wasn't PHP or Apache but connecting to the 
database which slowed things down. That may not be your problem but 
it's worth looking into...

Larry


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



[PHP] Upload file

2003-01-23 Thread Tyler Durdin

I am using PHP 4.2.1 and have noticed that I can only upload files with a 
php script when I have the php.ini file set with register globals on. Is 
there a way to use the file upload scripts without having to turn the 
register globals on? How about newer versions of PHP?




_
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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



Re: [PHP] Upload file

2003-01-23 Thread 1LT John W. Holmes
 I am using PHP 4.2.1 and have noticed that I can only upload files with a 
 php script when I have the php.ini file set with register globals on. Is 
 there a way to use the file upload scripts without having to turn the 
 register globals on? How about newer versions of PHP?

Yes, you'll use the $_FILES array to get to the uploaded file data.

---John Holmes...

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




RE: [PHP] Custom Error pages in IIS

2003-01-23 Thread Didier McGillis

Yes I always do that when I go there.
Sorry ..







From: John W. Holmes [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Custom Error pages in IIS
Date: Wed, 22 Jan 2003 19:28:03 -0500

No biggie, but you forgot an 's' on the address:

http://www.iis-resources.com, in case anyone was having trouble getting
there.

Thank you for the link, though.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

 -Original Message-
 From: Didier McGillis [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 22, 2003 4:42 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PHP] Custom Error pages in IIS

 Have you tried http://www.iis-resource.com, they have some good
resources.






 From: 1LT John W. Holmes [EMAIL PROTECTED]
 Reply-To: 1LT John W. Holmes [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [PHP] Custom Error pages in IIS
 Date: Wed, 22 Jan 2003 15:08:58 -0500
 
 Is anyone using PHP to create custom error pages in IIS. I want to
modify
 the 403 error page to do a redirect to HTTPS if it was requested with
 HTTP.
 I had someone try it, but they said it didn't work. I'm at work now
and
 don't have a box to try it on until I get home. Does anyone have this
 working out there, so I know whether or not to spend my time on it??
Any
 pointers? Thanks for any info.
 
 ---John Holmes...
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


 _
 Add photos to your e-mail with MSN 8. Get 2 months FREE*.
 http://join.msn.com/?page=features/featuredemail


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



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



_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus


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



[PHP] textarea problem

2003-01-23 Thread Denis L. Menezes
Thanks Marek.

Could you help me with this piece of code?

?php
  Print 'textarea name=OrgAddress cols=44 rows=5 id=textarea
value='.htmlspecialchars($row['OrgName']).'/textarea';
  ?

Thanks
denis


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




Re: [PHP] textarea problem

2003-01-23 Thread Ernest E Vogelsinger
At 14:34 23.01.2003, Denis L. Menezes said:
[snip]
?php
  Print 'textarea name=OrgAddress cols=44 rows=5 id=textarea
value='.htmlspecialchars($row['OrgName']).'/textarea';
  ?
[snip] 

This won't work. textarea needs its value outside the tag, without an
attribute, just plain:

Print 'textarea name=OrgAddress cols=44 rows=5 id=textarea',
  htmlspecialchars($row['OrgName']),
'/textarea';


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




[PHP] Help!!!

2003-01-23 Thread Brian McGarvie
I have just got use of a new dedicated webserver...

Now the 1st time a piece of code is ran it doesnt work but then the 2nd it
does...

i.e.

index.php

   // stuff...
  $visitDBID = referrerVisit($rid,$rgid,$visitIP,$visitFromURL);
   // stuff...

//end index.php

function  referrerVisit($rid,$rgid,$visitIP,$visitFromURL) {
  $db = dbConnect();
  $sql = 
insert into referral
   (RID, RGID, VisitorIP, VisitorDate, VisitorFromURL)
   values($rid,$rgid,'$visitIP',NOW(),'$visitFromURL')
  ;
  echo $sql;
  $result=mysql_query($sql);
  if(mysql_error()) {
   echo inserted not;
$errormessage = ;
$errormessage .= SQL: $sqlbr;
$errormessage .= Error Code: .mysql_errno().: .mysql_error();
echo 
  Sorry, an error has occured. It has been recorded and reported
  to the Website Administrator.brbr
  Error:br
  $errormessage
;
return null;
  } else {
   echo inserted;
return mysql_insert_id($db);
  }
}

When it's ran initilly: the sql that i generated looks like:

insert into referral (RID, RGID, VisitorIP, VisitorDate, VisitorFromURL)
values( insert into referral (RID, RGID, VisitorIP, VisitorDate,
VisitorFromURL) values(Resource id #4,Resource id #4,'Resource id
#4',NOW(),'Resource id #4') , insert into referral (RID, RGID, VisitorIP,
VisitorDate, VisitorFromURL) values(Resource id #4,Resource id #4,'Resource
id #4',NOW(),'Resource id #4') ,'

and gives the error:

Error:
SQL:
Error Code: 1065: Query was empty

However if i refresh the page: it executes correctly...

Any ideas?


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.438 / Virus Database: 246 - Release Date: 07/01/03



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




[PHP] Re: textarea problem

2003-01-23 Thread Marek Kilimajer
Yes - textarea does not have value attribute, put the value between 
textarea ...  and /textarea

Print 'textarea name=OrgAddress cols=44 rows=5 id=textarea'.htmlspecialchars($row['OrgName']).'/textarea';




Denis L. Menezes wrote:

Thanks Marek.

Could you help me with this piece of code?

?php
 Print 'textarea name=OrgAddress cols=44 rows=5 id=textarea
value='.htmlspecialchars($row['OrgName']).'/textarea';
 ?

Thanks
denis

 



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




[PHP] chown() despiration

2003-01-23 Thread Urb LeJeune
	I could do this in perl but I'm being stubborn :-)

When I run the following code as a regular user, everything fails.
When I run it as root the directory is created and the chmod
works. However, chown reports:

chown failed: Operation not permitted

	Here is the code.

  $Directory2Create = /home/e-govdemo/htdocs;
  mkdir($Directory2Create,0777);
  chown($Directory2Create,egovdemo);
  chmod($Directory2Create,0777);

  egovdemo is a legal user name as can be seen from this partial
directory listin.

egovdemo nobody   4096 Sep  6 11:29 Logs	

  also tried
  chown($Directory2Create,egovdemo:nobody);
  chown($Directory2Create,637);
  chown($Directory2Create,637:99);

	To help save my few reamining hairs and could someone with
root privilege try it and see if it's me or PHP?

Thanks

Urb



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




[PHP] Re: Help!!!

2003-01-23 Thread Brian McGarvie
ok i think i see the problem but how do i fix?

Before call to procedure:

VARS: 1,1,213.123.253.117,

inside procedure:
VARS: ,,,

Causing:
connectin: insert into referral (RID, RGID, VisitorIP, VisitorDate,
VisitorFromURL) values(Resource id #4,Resource id #4,'Resource id
#4',NOW(),'Resource id #4') inserted not Sorry, an error has occured. It has
been recorded and reported to the Website Administrator.

Error:
SQL:
Error Code: 1065: Query was empty

Brian McGarvie [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have just got use of a new dedicated webserver...

 Now the 1st time a piece of code is ran it doesnt work but then the 2nd it
 does...

 i.e.

 index.php

// stuff...
   $visitDBID = referrerVisit($rid,$rgid,$visitIP,$visitFromURL);
// stuff...

 //end index.php

 function  referrerVisit($rid,$rgid,$visitIP,$visitFromURL) {
   $db = dbConnect();
   $sql = 
 insert into referral
(RID, RGID, VisitorIP, VisitorDate, VisitorFromURL)
values($rid,$rgid,'$visitIP',NOW(),'$visitFromURL')
   ;
   echo $sql;
   $result=mysql_query($sql);
   if(mysql_error()) {
echo inserted not;
 $errormessage = ;
 $errormessage .= SQL: $sqlbr;
 $errormessage .= Error Code: .mysql_errno().: .mysql_error();
 echo 
   Sorry, an error has occured. It has been recorded and reported
   to the Website Administrator.brbr
   Error:br
   $errormessage
 ;
 return null;
   } else {
echo inserted;
 return mysql_insert_id($db);
   }
 }

 When it's ran initilly: the sql that i generated looks like:

 insert into referral (RID, RGID, VisitorIP, VisitorDate, VisitorFromURL)
 values( insert into referral (RID, RGID, VisitorIP, VisitorDate,
 VisitorFromURL) values(Resource id #4,Resource id #4,'Resource id
 #4',NOW(),'Resource id #4') , insert into referral (RID, RGID, VisitorIP,
 VisitorDate, VisitorFromURL) values(Resource id #4,Resource id
#4,'Resource
 id #4',NOW(),'Resource id #4') ,'

 and gives the error:

 Error:
 SQL:
 Error Code: 1065: Query was empty

 However if i refresh the page: it executes correctly...

 Any ideas?


 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.438 / Virus Database: 246 - Release Date: 07/01/03




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.438 / Virus Database: 246 - Release Date: 07/01/03



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




[PHP] Thanks Marek, Jon, Ernest

2003-01-23 Thread Denis L. Menezes
Thanks Marek, Jon, Ernest.



Denis



[PHP] Executing Shell Commands.

2003-01-23 Thread scott
Hello,

Does anybody know how to execute a shell command from PHP on a Linux
system?

Thanks,
Scott



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




[PHP] mysql_fetch_row problem

2003-01-23 Thread Bryan Brannigan
Can someone tell me what I'm doing wrong with the following code.  What I am
trying to do with this is insert some data from a form into a database.
Then I am querying another database to retrieve the email addresses related
to $location.  This is the error I get:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in D:\inetpub\webroot\usrmgr\upd.php on line 15

This is the problematic code:


$db = mysql_connect(localhost, webapp);
mysql_select_db(usermgr,$db);
$sql = INSERT INTO usernames
(name,location,position,email,home,citrix,timberline,sawmill,counter,insides
upport,am,receiving,shipping,purchasing,management,approval,uniqueid) VALUES
('$Name','$Location','$Position','$Emailaccess','$workathome','$citrix','$ti
mberline','$sawmill','$countersales','$insidesales','$accountmanager','$rece
iving','$shipping','$purchasing','$management','Waiting','$uniqueid');
$result = mysql_query($sql);
mysql_close($db);


$db = mysql_connect(localhost, webapp);
mysql_select_db(helpdesk,$db);
$result = mysql_query(SELECT contactemail FROM loc WHERE
location=$Location,$db);
while($row = mysql_fetch_row($result)){
$contactemail = $row[0];  
  }


Thanks in advance,
Bryan

~~
90% of being smart is knowing what you're dumb at.
Bryan Brannigan
Hancock Lumber
System Administrator
Information Technology 
(v)207.627.7694
(f)207.627.7041
[EMAIL PROTECTED]
~~

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




Re: [PHP] changing a key in an array

2003-01-23 Thread David T-G
Brent, et al --

...and then Brent Baisley said...
% 
% I'm not sure how you are creating your array, but your resulting array 

Well, here's some code with some commentary to perhaps help:

  - first we define a name for a picture basket; the default is
'default' (we might later get a new name from the user or replace
an existing basket and save the collection)

  - we base64_encode the basket name (if it isn't already done) so that
we can safely store it and use it as a key in the basket list

  - so we're ready to populate $pixbasket, an array of values (path to
picture) and keys (base64_encoded version of the value, in fact, for
the same sorts of reasons); we're given a base64_encoded path as the
picture to put in the basket:

if ( $fn == add || $fn == rm )  # are we adding or removing a 
pic?
{
  ...
$p = base64_decode($basketpic); # get the pic path
  ...
  case add: $pixbasket[$basketpic] = $p; break ;# add to basket
  ...
}

  - when it's time to save the basket, we put the whole array (as a
value) onto the basket list array:

  if ( $fn == manage )# still?
  {
...
if ( $basketsave  ( $newname || $target ) )   # what to do and how to do it?
{
  if ( $newname ) { $basketname = base64_encode($newname) ; }   # use this if 
we have it ...
else { $basketname = $target ; }# ... or else use 'target' 
(already encoded)
  $basketlist[$basketname] = $pixbasket ;   # put it in the array
  ...
}

  - then we write the whole basket list array to a file and get it back
some other day


% would look something like this:
% 
% Array
% (
%   [name1]=namevalue1
%   [a1]=Array
%   (
%   [k1]=value1
%   [k2]=value2
%   )
%   [name2]=namevalue2
%   [a2]=Array
%   (...

Hmmm...


% 
% You end up with a two dimensional array (avoiding the columns term) that 
% contains a name value and a values array for each entry.

OK.  I was able to construct this directly, but I don't see how to use
it; if I ask for array_keys() for the outer array I'll get both types of
keys and that would be a mess.

I suppose I could have another array like

  $names = array ('name1', 'name2', 'name3') ;

where I maintain the order (renaming 'name2' is as simple as

  $names[1] = 'newname' ;

once I determine that I'm working with position 1) and then have my array
of baskets, now simply by ID instead of like a hash, so

  $baskets = array (array(...),array(...),...) ;

would work) and then wrap both of those into the single array for writing
(like

  $basketlist = array($names,$baskets) ;

or so), but that seems even more of a kludge :-)

Given the array you present above, how would you extract a basket by
name?  The closest I can come is to go and find the name and then
increment the ID by 1 and then get out that basket, which sounds like a
*huge* mess...


Thanks again  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg94162/pgp0.pgp
Description: PGP signature


RE: [PHP] Executing Shell Commands.

2003-01-23 Thread Bryan Brannigan
I believe something like this would do it:

system('ls -l');


 -Original Message-
 From: scott [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 23, 2003 9:06 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Executing Shell Commands.
 
 
 Hello,
 
 Does anybody know how to execute a shell command from PHP on a Linux
 system?
 
 Thanks,
 Scott
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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




[PHP] Mail Function Parameters

2003-01-23 Thread Adam Voigt




I have a site with a PHP auto-mailer where the owner of the site gets a report

generated from the DB, it all works fine, except his server has spam filtering enabled

so the FROM header in my PHP-Generated email, which says apache@hostname

doesn't work because what the hostname is set to, isn't resolveable outside our network.

Now I know I can just set the servers hostname to a valid DNS name, but this brings

up another problem, even though I'm manually setting the From and Reply-to headers

in the PHP mail command (the last parameter), when the email's are listed in his box, it works,

if you open the headers in the email near the very top it still says

From: apache@hostname and a little ways below it says the From and Reply-to I set.



So, is there anyway to override the top From which says apache@hostname? Maybe

setting additional parameters on my sendmail command line in the php.ini? Any ideas?

I appreciate it.





-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


Re: [PHP] Mail Function Parameters

2003-01-23 Thread Petre Agenbag
You have to use sendmail with the -f flag. 
I have written a small test util to do this:

?php
$address = recipient@address;
$message = Subject: Test\n;
$message.= \n message;
$result = `echo -e $message | /usr/sbin/sendmail -f your@address
$address`;
$result.= `$message`;
echo $result;
?


On Thu, 2003-01-23 at 16:12, Adam Voigt wrote:
 I have a site with a PHP auto-mailer where the owner of the site gets a
 report
 generated from the DB, it all works fine, except his server has spam
 filtering enabled
 so the FROM header in my PHP-Generated email, which says
 apache@hostname
 doesn't work because what the hostname is set to, isn't resolveable
 outside our network.
 Now I know I can just set the servers hostname to a valid DNS name, but
 this brings
 up another problem, even though I'm manually setting the From and
 Reply-to headers
 in the PHP mail command (the last parameter), when the email's are
 listed in his box, it works,
 if you open the headers in the email near the very top it still says
 From: apache@hostname and a little ways below it says the From and
 Reply-to I set.
 
 So, is there anyway to override the top From which says apache@hostname?
 Maybe
 setting additional parameters on my sendmail command line in the
 php.ini? Any ideas?
 I appreciate it.
 
 -- 
 Adam Voigt ([EMAIL PROTECTED])
 The Cryptocomm Group
 My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc



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




Re: [PHP] PHP Image Gallery

2003-01-23 Thread David T-G
John --

...and then 1LT John W. Holmes said...
% 
% I know there are a ton of these out there and I've used a few of them, but
% I'm looking for a specific feature, of course. :)

Of course!


% 
% Does anyone know of a Gallery system where I can, once it's installed, just

Yep.


% drop a folder full of images into the gallery_root and the program

We typically mkdir and put via ftp, but a browser interface isn't by any
means impossible.  You throw your pix on the server in any dir layout you
want and then browse to the page and, voila!, the 'nails are made and the
pages laid out and you can add comments and whatnot.

Care for a demo account to try it out? :-)


% automatically makes it into a new gallery on the web site. In other words,
% I don't want to go through and Browse... for each and every file.

Fair enough.


% 
% Any advice is greatly appreciated. Again, I already know what gallery
% program you use (I'm psychic ;) and I agree with you that it's the best
% program out there, but does it have the above feature?

It sure does :-)


% 
% ---John Holmes...


HTH  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg94166/pgp0.pgp
Description: PGP signature


Re: [PHP] Executing Shell Commands.

2003-01-23 Thread Chris Hewitt
scott wrote:


Hello,

Does anybody know how to execute a shell command from PHP on a Linux
system?


exec() and friends.

HTH
Chris



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




RE: [PHP] mysql_fetch_row problem

2003-01-23 Thread Matt Schroebel
 -Original Message-
 From: Bryan Brannigan [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, January 23, 2003 9:03 AM
 Subject: [PHP] mysql_fetch_row problem 

 $db = mysql_connect(localhost, webapp);
 mysql_select_db(helpdesk,$db);
 $result = mysql_query(SELECT contactemail FROM loc WHERE ...

Try putting the sql into a var, using that in the mysql_query, and
adding:

if (!$result) {
  echo Sql was: $sqlbr\n;
  echo mysql_error();
}

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




Re: [PHP] mysql_fetch_row problem

2003-01-23 Thread Rick Emery
I'm gong to bet that $Location is alpha, not numeric.  Therefore:
$result = mysql_query(SELECT contactemail FROM loc WHERE location=\$Location\,$db);
- Original Message - 
From: Bryan Brannigan [EMAIL PROTECTED]
To: Php List (E-mail) [EMAIL PROTECTED]
Sent: Thursday, January 23, 2003 8:03 AM
Subject: [PHP] mysql_fetch_row problem


Can someone tell me what I'm doing wrong with the following code.  What I am
trying to do with this is insert some data from a form into a database.
Then I am querying another database to retrieve the email addresses related
to $location.  This is the error I get:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in D:\inetpub\webroot\usrmgr\upd.php on line 15

This is the problematic code:


$db = mysql_connect(localhost, webapp);
mysql_select_db(usermgr,$db);
$sql = INSERT INTO usernames
(name,location,position,email,home,citrix,timberline,sawmill,counter,insides
upport,am,receiving,shipping,purchasing,management,approval,uniqueid) VALUES
('$Name','$Location','$Position','$Emailaccess','$workathome','$citrix','$ti
mberline','$sawmill','$countersales','$insidesales','$accountmanager','$rece
iving','$shipping','$purchasing','$management','Waiting','$uniqueid');
$result = mysql_query($sql);
mysql_close($db);


$db = mysql_connect(localhost, webapp);
mysql_select_db(helpdesk,$db);
$result = mysql_query(SELECT contactemail FROM loc WHERE
location=$Location,$db);
while($row = mysql_fetch_row($result)){
$contactemail = $row[0];  
  }


Thanks in advance,
Bryan

~~
90% of being smart is knowing what you're dumb at.
Bryan Brannigan
Hancock Lumber
System Administrator
Information Technology 
(v)207.627.7694
(f)207.627.7041
[EMAIL PROTECTED]
~~

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




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




[PHP] RE: Solved [PHP] mysql_fetch_row problem

2003-01-23 Thread Bryan Brannigan
Thanks all for the responses.. the solution was to add single quotes around
the $Location variable.

 -Original Message-
 From: Rick Emery [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 23, 2003 10:10 AM
 To: Bryan Brannigan; Php List (E-mail)
 Subject: Re: [PHP] mysql_fetch_row problem
 
 
 I'm gong to bet that $Location is alpha, not numeric.  Therefore:
 $result = mysql_query(SELECT contactemail FROM loc WHERE 
 location=\$Location\,$db);
 - Original Message - 
 From: Bryan Brannigan [EMAIL PROTECTED]
 To: Php List (E-mail) [EMAIL PROTECTED]
 Sent: Thursday, January 23, 2003 8:03 AM
 Subject: [PHP] mysql_fetch_row problem
 
 
 Can someone tell me what I'm doing wrong with the following 
 code.  What I am
 trying to do with this is insert some data from a form into a 
 database.
 Then I am querying another database to retrieve the email 
 addresses related
 to $location.  This is the error I get:
 
 Warning: mysql_fetch_row(): supplied argument is not a valid 
 MySQL result
 resource in D:\inetpub\webroot\usrmgr\upd.php on line 15
 
 This is the problematic code:
 
 
 $db = mysql_connect(localhost, webapp);
 mysql_select_db(usermgr,$db);
 $sql = INSERT INTO usernames
 (name,location,position,email,home,citrix,timberline,sawmill,c
 ounter,insides
 upport,am,receiving,shipping,purchasing,management,approval,un
 iqueid) VALUES
 ('$Name','$Location','$Position','$Emailaccess','$workathome',
 '$citrix','$ti
 mberline','$sawmill','$countersales','$insidesales','$accountm
 anager','$rece
 iving','$shipping','$purchasing','$management','Waiting','$uni
 queid');
 $result = mysql_query($sql);
 mysql_close($db);
 
 
 $db = mysql_connect(localhost, webapp);
 mysql_select_db(helpdesk,$db);
 $result = mysql_query(SELECT contactemail FROM loc WHERE
 location=$Location,$db);
 while($row = mysql_fetch_row($result)){
 $contactemail = $row[0];  
   }
 
 
 Thanks in advance,
 Bryan
 
 ~~
 90% of being smart is knowing what you're dumb at.
 Bryan Brannigan
 Hancock Lumber
 System Administrator
 Information Technology 
 (v)207.627.7694
 (f)207.627.7041
 [EMAIL PROTECTED]
 ~~
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 

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




[PHP] looking for PHP, MYSQL IMAGEMAGIK hosting

2003-01-23 Thread Vahan Yerkanian
I know I'll start another flamewar, but I'm desperate for
a quality hosting provider supporting php/mysql/imagemagik

anyone has good experience with any company?

regards,
Vahan



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




Re: [PHP] Page doesn't load..

2003-01-23 Thread Marek Kilimajer
Yes, it is strange. Something that might help you debug this out:
- check server logs
- turn off any output buffers
- call flush() in your while loop
- use another browser, IE is hiding stuff from users, but you are a 
developer, you need to know what is going on
- check your loop if it is not endless
- post some code

Borut Kovacec wrote:

I get the default browser message .. The page cannot be displayed and I'm
using IE6 .. But I figured out that if I put this line in comment:
//while ($row = mysql_fetch_array($result)) 

which cycles through mysql result query .. and then outputs smo html tables
and if I replace it with:

for (int $i=0;i5;$++)
$row = mysql_fetch_array($result)

then it works!? .. but if I change i5 to i20 or so .. it doesnt work
anymore aggain .. so it's about how much data I get from databese or what?

really strange...


 Original Message -
From: Marek Kilimajer [EMAIL PROTECTED]
To: Borut Kovacec [EMAIL PROTECTED]
Cc: PHP Mailing List [EMAIL PROTECTED]
Sent: Thursday, January 23, 2003 1:31 PM
Subject: Re: [PHP] Page doesn't load..


 

Do you get the message from apache? If so, check apache logs. If it is
the exploder's default error page, turn user friendly messages off (in
IE), or try another browser

Borut Kovacec wrote:

   

Hello ..

I don't know if this is the right question for this mailing list .. but
 

I'm having some problems with loading some php pages, localy on my computer
(win XP, apache 1.3,Mysql) ..
 

The prioblem is that certain page doesnt load ... I get The page doesn't
 

exist message .. but it's there...
 

And then if I press refresh button couple of times, then sometimes it
 

works .. but if I hit refresh aggain it doesn't work aggain...
 

Would anybody maybe have an idea of what could be wrong?

Thanx in advance
B.



 

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

   


 



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




Re: [PHP] Sessions Security

2003-01-23 Thread Chris Shiflett
--- Clarkson, Nick [EMAIL PROTECTED] wrote:
 I am trying to find the best method for implementing
 sessions in PHP to track/limit users. However, the
 more I read, the more I am concerned about security.
 Can anyone give me a definitive answer as to the best
 method of tracking users with security in mind?

I have spoken on this topic several times in the past. Here
are a few recent ones:

http://groups.google.com/groups?selm=20030115215804.74315.qmail%40web14307.mail.yahoo.com
http://groups.google.com/groups?selm=20030102155526.52596.qmail%40web14302.mail.yahoo.com
http://groups.google.com/groups?selm=3DC35A8C.6030208%40php.net
http://groups.google.com/groups?selm=3DBC8190.9080007%40shiflett.org
http://groups.google.com/groups?selm=3D7BBDD2.7090803%40php.net

Hopefully that will give you a good start.

Chris

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




Re: [PHP] Re: textarea new line

2003-01-23 Thread David T-G
Adi, et al --

I somehow missed the original message.  Odd...


...and then Neil M said...
% 
% Adi wrote:
% i want to add in textarea a string with new line tag in it. how to do that?
% 
% my try:
% $string=-line1n\ -line2 n\-line3;
% echo brtextarea name='aria' cols='50' rows='2'$string/textarea;

Did you type this from memory or paste it in?  You have n\ instead of the
backslash before the n.  I think that

  $string=-line1\n-line2\n-line3 ;

would give you the line breaks you want.


HTH  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg94174/pgp0.pgp
Description: PGP signature


[PHP] Re: Extending PHP

2003-01-23 Thread J Smith

Look at PEAR's PECL project:

http://cvs.php.net/cvs.php/pear/PECL

J


Mh wrote:

 I am looking for 3d party extensions of PHP like PHPTurbine.  Anything
 will
 do, I am just curious whats available.  Anyone know of any sites dedicated
 to PHP extensions that I can look at?
 
 Thanks
 Mh


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




RE: [PHP] Sessions Security

2003-01-23 Thread Clarkson, Nick

Thanks - I've only just joined the list so must have missed your previous
msgs. I'll give them a read later.

Thanks again.

Nick

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]]
Sent: 23 January 2003 15:28
To: Clarkson, Nick; [EMAIL PROTECTED]
Subject: Re: [PHP] Sessions  Security


--- Clarkson, Nick [EMAIL PROTECTED] wrote:
 I am trying to find the best method for implementing
 sessions in PHP to track/limit users. However, the
 more I read, the more I am concerned about security.
 Can anyone give me a definitive answer as to the best
 method of tracking users with security in mind?

I have spoken on this topic several times in the past. Here
are a few recent ones:

http://groups.google.com/groups?selm=20030115215804.74315.qmail%40web14307.m
ail.yahoo.com
http://groups.google.com/groups?selm=20030102155526.52596.qmail%40web14302.m
ail.yahoo.com
http://groups.google.com/groups?selm=3DC35A8C.6030208%40php.net
http://groups.google.com/groups?selm=3DBC8190.9080007%40shiflett.org
http://groups.google.com/groups?selm=3D7BBDD2.7090803%40php.net

Hopefully that will give you a good start.

Chris

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


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




Re: [PHP] looking for PHP, MYSQL IMAGEMAGIK hosting

2003-01-23 Thread David T-G
Vahan, et al --

...and then Vahan Yerkanian said...
% 
% I know I'll start another flamewar, but I'm desperate for
% a quality hosting provider supporting php/mysql/imagemagik
% 
% anyone has good experience with any company?

I promise that I'm not just here to keep beating my own drum, but you've
described us to a tee (well, you left out perl :-)  What do you need?
Drop me a note off-list (since I doubt anyone else wants to hear much
about it) for more info..


% 
% regards,
% Vahan


HTH  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg94177/pgp0.pgp
Description: PGP signature


[PHP] editing textfile

2003-01-23 Thread Patrick
Hi,

i got a textfile and i want to edit one post in it.
here is what i use to read the file

$fp = fopen($servername, r) or die(error);
$wuser = file($servername);
$num = -1;
for ($i=0; $i  count($wuser); $i++) {
$wtemp = explode(;;, $wuser[$i]);
if ($ausername == $wtemp[0]) {
$wserver = explode(;;, $wuser[$i]);
}
}
fclose($fp);


then the user will do some inputs on a form and submit em back,
and i want to save em back to the database, how do i alter/delete just one
post in a textfile?

regards
patrick



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




Re: [PHP] HELP: Regex pattern matching

2003-01-23 Thread Nasko Vassilev
Thanks indeed!
This pattern worked just perfect.

Nasko

1lt John W. Holmes [EMAIL PROTECTED] wrote in message
00e601c2c2e0$0c204720$a629089b@TBHHCCDR">news:00e601c2c2e0$0c204720$a629089b@TBHHCCDR...
 If the separators are always the same length, then you can use the
 following:

 $new_str = preg_replace(/(=-){5}(.*)-{10}/sU,,$str);

 Where 5 is how many times the =- pattern repeats, and 10 is how many times
 the - character repeats.

 Hope that helps.

 ---John Holmes...




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




[PHP] A way to detach the existing session data while making a new one???

2003-01-23 Thread Scott Fletcher
Hi!

I'm wondering is, is there a way to lose the existing session and
existing session data while making a new session id???   I can't use
session_destroy() function because it affected IE users, it doesn't affect
the non-IE user at all.  I got so tired of problems with IE and having it to
work properly with the session id, so I decided not to use
session_destory().

So, a case situation here is when an IE user closed the browser without
logging out.  Then later on, fire-up the browser and log in.  Problem with
this is when I create a new session_id(), it should work but for some
reason, a couple of IE users are being affected because the original user
did not log out in the first place.  So, I decided not to use
session_destroy() because of some strange relation between many IEs and the
PHP session_id.  So, is there a way to detach any existing session data then
creating a new session id when logging in???

Thanks!!!



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




Re: [PHP] changing a key in an array

2003-01-23 Thread Brent Baisley
Unless the user has a lot of baskets, I would assume you would just list 
all the baskets the user has as links on the web page or as a pop up 
menu. The value passed by the links or pop up would be the element 
number of the array item containing the desired basket.
To extract a basket by name I would say you could use array_search, but 
in looking into that function it appears to have changed through recent 
versions of PHP. In PHP 4.1 it doesn't search multi-dimensional arrays, 
I'm not sure about in 4.2.

But it's easy enough to create your own function to search the array. 
And you are right, the setup I recommended can get a bit kludgy. But if 
you denormalize the array structure it can get easy again. Just make 
the first element for each basket the name of basket.
$baskets[] = array(basketname1,item1,item2);
$baskets[] = array(basketname2,item1,item2,item3);
$baskets[] = array(basketname3,item1,item2,...);

You can use sort() to sort the array.

Hope that helps and sorry about steering you down the difficult path 
first.

On Thursday, January 23, 2003, at 09:05 AM, David T-G wrote:

Given the array you present above, how would you extract a basket by
name?  The closest I can come is to go and find the name and then
increment the ID by 1 and then get out that basket, which sounds like a
*huge* mess...


--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


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




[PHP] Possible Bug in 4.3.0

2003-01-23 Thread Bob Horton
I've got a site running PHP w/ MySQL  DBF extensions on Apache with
mod_ssl/openssl.

Yesterday, following upgrading to 4.3.0 (and upgrading mod_ssl/apache as
well) the site stopped working.  I quickly figured out there was a change in
session processing and that I needed to no longer use global variables to
transfer information from my $_POST array into $_SESSION but that I needed
to transfer the information directly.

After making this change I was able to get rid of the warning messages and
things started looking like they were working correctly but the results of
the queries didn't respond consistently.  In fact, if I run the same query
10 times I'm likely to get 3 different kinds of results.  No records found
(which is false), a Page Not Found error (also false), and about 15% of
the time I'll get the correct results.

I've tried setting the PHP.INI settings for the compatibility and warning in
all 4 different combinations and I've even turned register_globals back on
to see if that would solve it ...

This was a live e-commerce site until I upgraded and now my client, his
customers and my rep are going down the tubes ...

Help please someone!

Bob.

P.S. Please respond directly to my e-mail as well as the list as I get the
digest and wont see responses for a while otherwise.  Thanks.

Bob Horton
PSD Services Inc.
Web Hosting  Development
Phone: (306) 522-4638 (522-INET)
[EMAIL PROTECTED]



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




[PHP] Size of images (in bytes)

2003-01-23 Thread Oliver Witt
Hi,
After calling to the function ImageCreateFromJPEG() and before outputing
the image with ImageJPEG, is there a way to determine the images size in
bytes?
I want to reduce the quality more and more until it has reached a
certain level.
Thanks,
Olli


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




[PHP] Cycle through multiple servers....

2003-01-23 Thread Christopher Ditty
Hello all.  I have a few servers that I need to check during a login process.  If the 
first server fails to connect, then I need to do server #2 and so on.  Below is the 
code that I am using, but I am unable to get it to work like it should.  Can anyone 
offer some advice on how this should be accomplushed?

Thanks

CDitty


function sConnect($serverID){
$ds = ldap_connect($serverID);
return $ds;
}

$i = 0;
do{
ldapConnect($config['ldapServer'][$i]);
$i++;
}while(!$ds  ($i  (count($config['ldapServer']) + 1)));



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




Re: [PHP] Size of images (in bytes)

2003-01-23 Thread 1LT John W. Holmes
 After calling to the function ImageCreateFromJPEG() and before outputing
 the image with ImageJPEG, is there a way to determine the images size in
 bytes?
 I want to reduce the quality more and more until it has reached a
 certain level.
 Thanks,
 Olli

You have the image data in a string, right? Could you relate the length of
that string to the resulting size of the file, somehow?

---John Holmes...


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




[PHP] Word Count

2003-01-23 Thread Craig
Is there a way to count the number of words in a string?



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




Re: [PHP] Size of images (in bytes)

2003-01-23 Thread Oliver Witt
1lt John W. Holmes schrieb:

  After calling to the function ImageCreateFromJPEG() and before outputing
  the image with ImageJPEG, is there a way to determine the images size in
  bytes?
  I want to reduce the quality more and more until it has reached a
  certain level.
  Thanks,
  Olli

 You have the image data in a string, right? Could you relate the length of
 that string to the resulting size of the file, somehow?

 ---John Holmes...

After calling the funtion ImageCreateFromJPEG like this:
$im = ImageCreateFromJPEG(pic.jpg);
then $im is not a string but a resource. I don't know how to get it into a
string
Olli



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




Re: [PHP] Word Count

2003-01-23 Thread Chris Boget
 Is there a way to count the number of words in a string?

Untested, but this should work.

$string = Is there a way to count the number of words in a string?

$numOfWords = count( explode(  , $string ));

Chris


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




Re: [PHP] Word Count

2003-01-23 Thread Adam Voigt




Umm, how about:



$string = hi my name is bob;

$count = (substr_count($string, )+1);



On Thu, 2003-01-23 at 11:35, Craig wrote:

Is there a way to count the number of words in a string?







-- 

PHP General Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


[PHP] $_GET space in index changed to underscore

2003-01-23 Thread Per
Hi

Anyone who knows why get variables whit spaces in looking like this in 
the URL blah.php?aa+bb=1 is changed to aa_bb in $_GET resulting in 
$_GET['aa_bb'] instead of $_GET['aa bb']?

/P


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



RE: [PHP] $_GET space in index changed to underscore

2003-01-23 Thread Jon Haworth
Hi Per,

 Anyone who knows why get variables whit spaces in looking like this in 
 the URL blah.php?aa+bb=1 is changed to aa_bb in $_GET resulting in 
 $_GET['aa_bb'] instead of $_GET['aa bb']?

I don't think spaces are legal in variable names - PHP's probably just
trying to recover from the dodgy data it's getting.

Cheers
Jon

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




Re: [PHP] A rather strange problem.

2003-01-23 Thread Tom Rogers
Hi,

Thursday, January 23, 2003, 10:47:56 PM, you wrote:
DLM hello friends,

DLM I run some queries and output the database fields in a form with text boxes for 
the purpose of editing by the administrator. My problem is that if my field value is 
of 2 words or more, my output
DLM text box shows only the first work. e.g. if the field is Jane Enterprises, the 
textbox shows only jane. My code is below. Can someone please tell me what it is I 
am doing wrong?

DLM Quote :


DLM ?php

DLM  while($row=mysql_fetch_array($result)){
DLM  print  form name=\form1\ method=\post\ action=\update.php\;
DLMprint  input name=\OrgName\ type=\text\ id=\OrgName\ size=\30\ 
value=$row[OrgName];
DLM  print  /form;
DLM  }
DLM  ?

DLM Unquote

DLM Thanks
DLM denis

put the value in quotes

value=\$row[OrgName]\
-- 
regards,
Tom


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




Re: [PHP] $_GET space in index changed to underscore

2003-01-23 Thread 1LT John W. Holmes
 Anyone who knows why get variables whit spaces in looking like this in
 the URL blah.php?aa+bb=1 is changed to aa_bb in $_GET resulting in
 $_GET['aa_bb'] instead of $_GET['aa bb']?

That's just what PHP does. It'll also convert any periods in a form element
name to an underscore.

Otherwise, if you have register globals on, it would try to create a
variable of $aa bb which doesn't make sense, or $aa.bb which doesn't
make sense, either, because the dot is a concatinator.

---John Holmes...


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




[PHP] Re: chown() despiration

2003-01-23 Thread Peter Clarke
Urb Lejeune wrote:

I could do this in perl but I'm being stubborn :-)

When I run the following code as a regular user, everything fails.
When I run it as root the directory is created and the chmod
works. However, chown reports:

chown failed: Operation not permitted

Here is the code.

  $Directory2Create = /home/e-govdemo/htdocs;
  mkdir($Directory2Create,0777);
  chown($Directory2Create,egovdemo);
  chmod($Directory2Create,0777);

  egovdemo is a legal user name as can be seen from this partial
directory listin.

egovdemo nobody   4096 Sep  6 11:29 Logs   

  also tried
  chown($Directory2Create,egovdemo:nobody);
  chown($Directory2Create,637);
  chown($Directory2Create,637:99);

To help save my few reamining hairs and could someone with
root privilege try it and see if it's me or PHP?

Thanks

Urb



It works fine with PHP 4.2.2 from the command line run as root on my 
Linux system (using a user on my system) produced:

drwxrwxrwx2 leagas   root 4096 Jan 23 16:43 test


Peter


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



Re: [PHP] Size of images (in bytes)

2003-01-23 Thread Marek Kilimajer
Use output buffer:
ob_start();
ImageJPEG($im);
$imagestring=ob_get_contents();
ob_end_clean();


Oliver Witt wrote:


1lt John W. Holmes schrieb:

 

After calling to the function ImageCreateFromJPEG() and before outputing
the image with ImageJPEG, is there a way to determine the images size in
bytes?
I want to reduce the quality more and more until it has reached a
certain level.
Thanks,
Olli
 

You have the image data in a string, right? Could you relate the length of
that string to the resulting size of the file, somehow?

---John Holmes...
   


After calling the funtion ImageCreateFromJPEG like this:
$im = ImageCreateFromJPEG(pic.jpg);
then $im is not a string but a resource. I don't know how to get it into a
string
Olli



 



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




  1   2   >