[PHP] File Upload stuck in the midst

2001-02-13 Thread Dhaval Desai

Hi!

I am facing some problems while uploading files..
I just copied the code from php.net from the section
"Handling File Uploads".

My index.php pages has the following code:

html
head
titleFile Uploads/title

/head
body
FORM ENCTYPE="multipart/form-data"
ACTION="action.php" METHOD=POST
INPUT TYPE="hidden" name="MAX_FILE_SIZE"
value="2000"
Send this file: INPUT NAME="userfile" TYPE="file"
INPUT TYPE="submit" VALUE="Send File"
/FORM


/body
/html




ACtion.php has the following code:

?php 
if (is_uploaded_file($userfile)) {
copy($userfile, "(c:\\)");
} else {
echo "Possible file upload attack: filename
'$userfile'.";
}
/* ...or... */
move_uploaded_file($userfile, "(c:\\)");
?


I always get the error: message..

[Possible file upload attack: filename 'none'.]


Can anybody tell me what could be the possible reason
for this.


Thanx a lot!
Dhaval Desai

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




php-general Digest 13 Feb 2001 08:38:31 -0000 Issue 509

2001-02-13 Thread php-general-digest-help


php-general Digest 13 Feb 2001 08:38:31 - Issue 509

Topics (messages 39255 through 39376):

Apache not starting after adding php via mod_so.
39255 by: Sieger, Roland

Re: Regex help needed...
39256 by: Jesse Swensen
39260 by: Jason Stechschulte
39270 by: Christian Reiniger
39282 by: Jesse Swensen

Re: Search  replace text
39257 by: Christian Reiniger

Re: rewriting this SQL statement to remove subselect
39258 by: Christian Reiniger

mysql +php+ array
39259 by: Ramiro Radjiman
39267 by: Web master

strtotime problem running PHP as Apache module
39261 by: Charles Mulford

sorting a csv text file in PHP
39262 by: Mike Mike

returning multiple variables from a function?
39263 by: James, Yz
39265 by: Matt McClanahan
39268 by: John Donagher
39363 by: Ankur Verma

(g)Zip archiving of local files?
39264 by: Michael Geary
39310 by: Maxim Maletsky

Re: money maths
39266 by: Christian Reiniger

Problems with ! in mail();
39269 by: Curtis, Lorenzo
39274 by: Christian Reiniger
39277 by: Curtis, Lorenzo
39278 by: Christian Reiniger
39288 by: CC Zona
39366 by: Ankur Verma

Broken icon?
39271 by: Malouin Design Graphique
39273 by: Web master
39364 by: Ankur Verma

Re: comparisons
39272 by: Christian Reiniger

Using PHP to process forms
39275 by: Don
39276 by: Joe Stump
39311 by: Maxim Maletsky
39365 by: Ankur Verma

Re: XML Parsing The Sequel II
39279 by: Steve Haemelinck

input type equals image
39280 by: matthewt tozer
39281 by: Jason Murray

How to check if vaiable is defined or not?
39283 by: SED
39285 by: eschmid+sic.s.netic.de
39287 by: Reuben D Budiardja
39289 by: Brian V Bonini
39367 by: Ankur Verma

PHP/Oracle mod
39284 by: rbradley
39291 by: Joe Conway

Nothing Showling up in Netscape
39286 by: Peter Houchin
39290 by: Jason Murray
39323 by: Steve Werby
39368 by: Ankur Verma

Re: Preserve variables between page loads?
39292 by: Chuck Mayo

serialize/deserialize data
39293 by: Brian V Bonini
39317 by: Steve Werby
39372 by: Ankur Verma

Re: To The Hacker: CodeBoy
39294 by: Jonathan Sharp

security question
39295 by: Marc Aragnou
39296 by: Augusto Cesar Castoldi
39369 by: Ankur Verma

How To Tell Which v. PHP?
39297 by: Jeff Oien
39298 by: Jason Murray
39299 by: Brandon Orther
39312 by: Maxim Maletsky
39370 by: Ankur Verma

re:[PHP]Using PHP to process forms
39300 by: Sean Kennedy
39304 by: Philip Olson
39305 by: Jeff Oien

checkboxes and arrays
39301 by: Christian Dechery
39320 by: Steve Werby

LOCK TABLES x COMMIT/ROLLBACK
39302 by: Christian Dechery

Pay for help
39303 by: rbradley

Reg. Exp. Help
39306 by: Scott Mebberson
39326 by: Scott Mebberson

Parse HTML Block
39307 by: Mark Green
39314 by: Thor M. Steindorsson

Re: echo vs print
39308 by: Maxim Maletsky

Re: How to send email
39309 by: Maxim Maletsky
39360 by: Ankur Verma

create filesystem folder?
39313 by: andrew
39315 by: Philip Olson
39371 by: Ankur Verma

session_register()
39316 by: Peter Houchin

Using php as a shell scripting language
39318 by: Tony Bibbs
39324 by: Jason Brooke
39325 by: David Robley

Newbie: Images refs not loading (Broken Icons) How to?
39319 by: Malouin Design Graphique
39321 by: Steve Werby
39322 by: David Robley
39328 by: Malouin Design Graphique
39330 by: Steve Werby

help with classes
39327 by: Joseph H Blythe
39331 by: Joe Conway
39335 by: Joseph H Blythe
39337 by: Sean Cazzell
39342 by: Joseph H Blythe
39345 by: Joe Conway
39349 by: Joseph H Blythe
39373 by: Ankur Verma

mysql_fetch_array and row referencing under 4.0.4pl1
39329 by: Scott Brown
39332 by: Thomas Deliduka
39333 by: Steve Werby
39334 by: Steve Werby
39341 by: Scott Brown
39343 by: Scott Brown
39350 by: Steve Werby

Re: new release : phpdoc v2.0
39336 by: Christian Calloway
39339 by: Christian Calloway

Build HREF list from database???
39338 by: andrew
39346 by: David Robley
39348 by: andrew
39374 by: Ankur Verma

Mail classes
39340 by: Josh G
39375 by: Ankur Verma

mktime + 4 days
39344 by: Christopher Allen

Netscape6 with HTML Form using POST method
39347 by: Yasuo Ohgaki

SELECT statement
39351 by: Peter Houchin
39352 by: Philip Olson
39355 by: David Robley
 

Re: [PHP] File Upload stuck in the midst

2001-02-13 Thread Ankur Verma

tuirn on the following setting in your php.ini file

register_globals = On

currently it seems to be off in your settings file

hope that helps

regards

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India

- Original Message - 
From: "Dhaval Desai" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 2:10 PM
Subject: [PHP] File Upload stuck in the midst


 Hi!
 
 I am facing some problems while uploading files..
 I just copied the code from php.net from the section
 "Handling File Uploads".
 
 My index.php pages has the following code:
 
 html
 head
 titleFile Uploads/title
 
 /head
 body
 FORM ENCTYPE="multipart/form-data"
 ACTION="action.php" METHOD=POST
 INPUT TYPE="hidden" name="MAX_FILE_SIZE"
 value="2000"
 Send this file: INPUT NAME="userfile" TYPE="file"
 INPUT TYPE="submit" VALUE="Send File"
 /FORM
 
 
 /body
 /html
 
 
 
 
 ACtion.php has the following code:
 
 ?php 
 if (is_uploaded_file($userfile)) {
 copy($userfile, "(c:\\)");
 } else {
 echo "Possible file upload attack: filename
 '$userfile'.";
 }
 /* ...or... */
 move_uploaded_file($userfile, "(c:\\)");
 ?
 
 
 I always get the error: message..
 
 [Possible file upload attack: filename 'none'.]
 
 
 Can anybody tell me what could be the possible reason
 for this.
 
 
 Thanx a lot!
 Dhaval Desai
 
 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail - only $35 
 a year!  http://personal.mail.yahoo.com/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Fatal error loading extension

2001-02-13 Thread A. Giacomelli

Hi,

I have managed (with some struggle) to compile an extension for PHP.

I tried to open a test page, loading the extension wit the dl command,
and this is what I get:

Fatal error: Unable to load dynamic library
'/opt/gislab/php/extensions/php_mapscript.so' - ld.so.1:
/opt/gislab/apache/bin/httpd: fatal:
/opt/gislab/php/extensions/php_mapscript.so: required mapping 0x1
size 0x82000, is
already in use by file /opt/gislab/apache/bin/httpd in
/opt/gislab/apache/htdocs/php/phpinfo_mapscript.php3 on line 21


...any suggestions as to how to resolve this ?

Thanks,



Andrea

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] File Upload stuck in the midst

2001-02-13 Thread Ankur Verma

also take a good look at the following document

http://www.php.net/manual/en/features.file-upload.php

regards

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India

- Original Message - 
From: "Dhaval Desai" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 2:10 PM
Subject: [PHP] File Upload stuck in the midst


 Hi!
 
 I am facing some problems while uploading files..
 I just copied the code from php.net from the section
 "Handling File Uploads".
 
 My index.php pages has the following code:
 
 html
 head
 titleFile Uploads/title
 
 /head
 body
 FORM ENCTYPE="multipart/form-data"
 ACTION="action.php" METHOD=POST
 INPUT TYPE="hidden" name="MAX_FILE_SIZE"
 value="2000"
 Send this file: INPUT NAME="userfile" TYPE="file"
 INPUT TYPE="submit" VALUE="Send File"
 /FORM
 
 
 /body
 /html
 
 
 
 
 ACtion.php has the following code:
 
 ?php 
 if (is_uploaded_file($userfile)) {
 copy($userfile, "(c:\\)");
 } else {
 echo "Possible file upload attack: filename
 '$userfile'.";
 }
 /* ...or... */
 move_uploaded_file($userfile, "(c:\\)");
 ?
 
 
 I always get the error: message..
 
 [Possible file upload attack: filename 'none'.]
 
 
 Can anybody tell me what could be the possible reason
 for this.
 
 
 Thanx a lot!
 Dhaval Desai
 
 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail - only $35 
 a year!  http://personal.mail.yahoo.com/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Here you have, ;o)

2001-02-13 Thread James Moore

Hi:
Check This!





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


Re: [PHP] Here you have, ;o)

2001-02-13 Thread Jonatan Bagge

You guys should really stop using outlook.


ajay arora wrote:

 Hi:
 Check This!

   
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] php socket function

2001-02-13 Thread Tissandié



Hi all, need some help about socket 
functions.
I try tu 
use socket function.This is my script:

if (($sock = socket(AF_INET, SOCK_STREAM, 0))  
0) {echo "socket() a echoué - raison : " . strerror($sock) . 
"\n";}

And this is the error I always get :Fatal 
error: Call to undefined function: socket() in d:\myscript.php on 
line175

I'm using PHP with WIN NT. The error is the same 
with PHP Version 4.0.5-dev, or PHP Version 4.0.4.I've installed PHP from 
binary code, not with re-compiling source.

First question : is socket function installed on 
php version for windows ?Second : if yes, where is the 
problem.

Thank you for your help,
François Tissandié.
Embrassez ceux que vous 
aimezAtos-InfogéranceTour MANHATTAN6 Place de l'Iris92400 
Courbevoie CedexTél. : 01.70.92.49.67Fax. : 01.70.92.48.57e-mail : 
[EMAIL PROTECTED] 



Re: [PHP] php socket function

2001-02-13 Thread Ankur Verma

in php you need to use the function fsockopen() instead of the socket()

check up the php manual for the scoket cunctions at

http://www.php.net/manual/en/ref.sockets.php

you can also download a good example of a class that uses the socket
functions to send and recieve email from http://myprojects.cjb.net/

Download the Kazzam Intranet Email System code from here which has the class
and the example of how to use it for sending and recieving email

regards

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India

- Original Message -
From: Tissandi
To: Mailing Php (E-mail)
Sent: Tuesday, February 13, 2001 2:44 PM
Subject: [PHP] php socket function


Hi all, need some help about socket functions.

I try tu use socket function.
This is my script:

if (($sock = socket(AF_INET, SOCK_STREAM, 0))  0) {
 echo "socket() a echou - raison : " . strerror($sock) . "\n";
}

And this is the error I always get :
Fatal error: Call to undefined function: socket() in d:\myscript.php on line
175

I'm using PHP with WIN NT. The error is the same with PHP Version 4.0.5-dev
, or PHP Version 4.0.4.
I've installed PHP from binary code, not with re-compiling source.

First question : is socket function installed on php version for windows ?
Second : if yes, where is the problem.

Thank you for your help,

Franois Tissandi.

Embrassez ceux que vous aimez


Atos-Infogrance
Tour MANHATTAN
6 Place de l'Iris
92400 Courbevoie Cedex
Tl. : 01.70.92.49.67
Fax. : 01.70.92.48.57
e-mail : [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] user rights for an upload

2001-02-13 Thread Bogdan Morar

Hi,
On a linux system, I have an directory owned by the user X. How can I
force an upload in that directory if my "apache user" is "nobody". I
tried with PHP_AUTH_USER but doesn't work. I tried all the examples from
php doc, all the "explorers" from zend.com, baut i don't find a good
solution.

I know are many solutions with ftp, Special directory in http.conf, but
i'm looking for a php solution.

Thanks in advance,
Bogdan Morar

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] user rights for an upload

2001-02-13 Thread Ankur Verma

Interesting Query! Please let me know of any solution that you might come up
with.

regards

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India

- Original Message -
From: "Bogdan Morar" [EMAIL PROTECTED]
To: "Php general" [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 3:10 PM
Subject: [PHP] user rights for an upload


 Hi,
 On a linux system, I have an directory owned by the user X. How can I
 force an upload in that directory if my "apache user" is "nobody". I
 tried with PHP_AUTH_USER but doesn't work. I tried all the examples from
 php doc, all the "explorers" from zend.com, baut i don't find a good
 solution.

 I know are many solutions with ftp, Special directory in http.conf, but
 i'm looking for a php solution.

 Thanks in advance,
 Bogdan Morar

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] limitation of file upload??

2001-02-13 Thread John LYC


is there limitations on file upload.. such as file size when using
input type=file???

thanks



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] limitation of file upload??

2001-02-13 Thread Ankur Verma

The maximum filesize for file uploads is either set in the php.ini file
using the setting

upload_max_filesize = 2M  ; Maximum allowed size for uploaded files

or you can also specify the maximum file upload size at runt time as follows
FORM ENCTYPE="multipart/form-data" ACTION="_URL_" METHOD=POST
INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000"
Send this file: INPUT NAME="userfile" TYPE="file"
INPUT TYPE="submit" VALUE="Send File"
/FORM

consult the following section of the php manual for more info
http://www.php.net/manual/en/features.file-upload.php
hope that helps
regards
Ankur VermaHCL TechnologiesA1CD, Sec -16Noida, UPIndia
- Original Message -
From: "John LYC" [EMAIL PROTECTED]
To: "PHP List" [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 3:24 PM
Subject: [PHP] limitation of file upload??



 is there limitations on file upload.. such as file size when using
 input type=file???

 thanks



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] problem with classes

2001-02-13 Thread Siim Einfeldt aka Itpunk


 Thanks all for your help

Siim Einfeldt


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] limitation of file upload??

2001-02-13 Thread John LYC

Hi..
can i upload a 50 Mb file thur this method?..
any complication?
john

Ankur Verma wrote:

 The maximum filesize for file uploads is either set in the php.ini file
 using the setting

 upload_max_filesize = 2M  ; Maximum allowed size for uploaded files

 or you can also specify the maximum file upload size at runt time as follows
 FORM ENCTYPE="multipart/form-data" ACTION="_URL_" METHOD=POST
 INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000"
 Send this file: INPUT NAME="userfile" TYPE="file"
 INPUT TYPE="submit" VALUE="Send File"
 /FORM

 consult the following section of the php manual for more info
 http://www.php.net/manual/en/features.file-upload.php
 hope that helps
 regards
 Ankur VermaHCL TechnologiesA1CD, Sec -16Noida, UPIndia
 - Original Message -
 From: "John LYC" [EMAIL PROTECTED]
 To: "PHP List" [EMAIL PROTECTED]
 Sent: Tuesday, February 13, 2001 3:24 PM
 Subject: [PHP] limitation of file upload??

 
  is there limitations on file upload.. such as file size when using
  input type=file???
 
  thanks
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] limitation of file upload??

2001-02-13 Thread Ankur Verma

well!

Nice question. I haven't gone beyond 2.5 MB on any occassion.

but I guess theoretically this should be possible by setting the maximum
upload file size setting using the methods already discusssed. Another thing
that you might want to look out for in this case would be the maximum
execution time of the script

take a look at the max_execution_time setting in php.ini and the
set_time_limit() function in the php manual.

don't forget to tell me the results of this experiment of yours. :) :)

regards

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India




.- Original Message -
From: "John LYC" [EMAIL PROTECTED]
To: "Ankur Verma" [EMAIL PROTECTED]
Cc: "PHP List" [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 3:46 PM
Subject: Re: [PHP] limitation of file upload??


 Hi..
 can i upload a 50 Mb file thur this method?..
 any complication?
 john

 Ankur Verma wrote:

  The maximum filesize for file uploads is either set in the php.ini file
  using the setting
 
  upload_max_filesize = 2M  ; Maximum allowed size for uploaded files
 
  or you can also specify the maximum file upload size at runt time as
follows
  FORM ENCTYPE="multipart/form-data" ACTION="_URL_" METHOD=POST
  INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000"
  Send this file: INPUT NAME="userfile" TYPE="file"
  INPUT TYPE="submit" VALUE="Send File"
  /FORM
 
  consult the following section of the php manual for more info
  http://www.php.net/manual/en/features.file-upload.php
  hope that helps
  regards
  Ankur VermaHCL TechnologiesA1CD, Sec -16Noida, UPIndia
  - Original Message -
  From: "John LYC" [EMAIL PROTECTED]
  To: "PHP List" [EMAIL PROTECTED]
  Sent: Tuesday, February 13, 2001 3:24 PM
  Subject: [PHP] limitation of file upload??
 
  
   is there limitations on file upload.. such as file size when using
   input type=file???
  
   thanks
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
[EMAIL PROTECTED]


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] Re: [PHP-DEV] FW: [PHP-CVS] cvs: php4 /ext/midgard .cvsignore ChangeLog INSTALL Makefile.in access.c article.c attachment.c calendar.c config.m4 element.c event.c eventmember.c file.c fudge genentry

2001-02-13 Thread Alexander Bokovoy

On Tue, Feb 13, 2001 at 12:29:02PM +0200, Stanislav Malyshev wrote:
 RL The idea here is that Midgard has a large installed base of
 RL users, all of whom have to run a modified version of PHP.  The
 RL extension, albeit rather large at this point, is supposed to
 RL provide the basic functionality in the standard PHP distribution
 RL so people will not have to run a modified PHP to use midgard.
 
 From what I know from my contacts with Midgard people, users will _still_
 have to use modified PHP - since Midgrard requires modifications to Zend
 parser. If it was as simple as compiling PHP module, nobody would need to
 run modified PHP - just to compile .so and load it as an extension.
These days are gone, now we have _different_ implementation which
doesn't require changes in Zend engine at all while keeping Midgard
syntax intact. Midgard extension to PHP4 is a _regular_ extension like
any other one though it's bigger than others.

-- 
Sincerely yours, Alexander Bokovoy 
  The Midgard Project   | www.midgard-project.org |Aurora RD team 
Minsk Linux Users Group |www.minsk-lug.net|  www.aurora-linux.com  
   IPLabs Linux Team| linux.iplabs.ru | Architecte Open Source
-- Small is beautiful.


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] problems with writing picture to the database.

2001-02-13 Thread Siim Einfeldt aka Itpunk


  Thanks, I will take a look at it once more, probably will come with some
more questions as at first it didn`t 'look like working', but it really
worked and then suddenly I get complains that it doesn`t anymore

Siim


 read the manual on handling file uploads. It looks like you're using 
 $image_name which is the original image name on the client where you 
 want $image which is the temporary file name on the server. If your 
 server is running on the machine you access the form from it may look 
 like things are working right when they aren't.
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] foo[bar] _or_ foo['bar'] ?

2001-02-13 Thread Matthias Krehl

Hi there!

I'd really appreciate a clear statement whether to use better

$foo = array('bar' = 'boing');
doWhatSoEver($foo[bar]);

or

$foo = array('bar' = 'boing');
doWhatSoEver($foo['bar']);

Someone to know that?

bye Matthias


Matthias Krehl
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] problems with writing picture to the database.

2001-02-13 Thread Siim Einfeldt aka Itpunk


 O.K. I still got the problems. I`ll paste everything needed here and
please, if anyone knows how to make it work, let  me know.

*First, the part of the form is the following:

INPUT TYPE="file" NAME="file"

the enctype in my form tag is ENCTYPE="multipart/form-data" and METHOD =
POST 

*The  code that actually *should* take care of the upload process to
mysql, is the following:

if (isset($file) AND $file != "none" AND strlen($file)2){
$file_data = fread( fopen($file, 'r'),
filesize($file) );
$theq = "INSERT INTO pildid
(file_name,file_type,file_data,tyyp,subid,picnr) VALUES ('$file',
'$file_type', '".addslashes($file_data)."','travels','$it','0')";
$result = mysql_query($theq);

}

And the errors I get, are':

Warning: fopen("C:\\ajutine\\Kevad.jpg","r") - No such file or directory
in /home/einfeldt/public_html/bt2/reis.php3 on line 62

Warning: Supplied argument is not a valid File-Handle resource in
/home/einfeldt/public_html/bt2/reis.php3 on line 62
INSERT INTO pildid (file_name,file_type,file_data,tyyp,subid,picnr) VALUES
('C:\\ajutine\\Kevad.jpg', '', '','travels','9','0')


Thanks
Siim Einfeldt



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] limitation of file upload??

2001-02-13 Thread John LYC

well.
tried a 20++ mb file...
it was just as good.. :)

thanks for the help!
john

Ankur Verma wrote:

 The maximum filesize for file uploads is either set in the php.ini file
 using the setting

 upload_max_filesize = 2M  ; Maximum allowed size for uploaded files

 or you can also specify the maximum file upload size at runt time as follows
 FORM ENCTYPE="multipart/form-data" ACTION="_URL_" METHOD=POST
 INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000"
 Send this file: INPUT NAME="userfile" TYPE="file"
 INPUT TYPE="submit" VALUE="Send File"
 /FORM

 consult the following section of the php manual for more info
 http://www.php.net/manual/en/features.file-upload.php
 hope that helps
 regards
 Ankur VermaHCL TechnologiesA1CD, Sec -16Noida, UPIndia
 - Original Message -
 From: "John LYC" [EMAIL PROTECTED]
 To: "PHP List" [EMAIL PROTECTED]
 Sent: Tuesday, February 13, 2001 3:24 PM
 Subject: [PHP] limitation of file upload??

 
  is there limitations on file upload.. such as file size when using
  input type=file???
 
  thanks
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] What Does This Mean?

2001-02-13 Thread Ben Ocean

Hi;
I'm getting this error:
 
Unsatisfied dependencies for mod-php3-mysql-3.0.8-2: mod-php3 = 3.0.8

What does it mean and what should I do about it (if anything)?
TIA,
BenO


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] What Does This Mean?

2001-02-13 Thread Ankur Verma

I am not very sure of what exactly does this this mean but I guess that the
particular module that you are installing requires a cversion of PHP that
has to be greater than 3.0.8.

This is just a guess. I aplogize if it's wrong.

regards

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India


- Original Message -
From: "Ben Ocean" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 3:28 PM
Subject: [PHP] What Does This Mean?


 Hi;
 I'm getting this error:
  
 Unsatisfied dependencies for mod-php3-mysql-3.0.8-2: mod-php3 = 3.0.8
 
 What does it mean and what should I do about it (if anything)?
 TIA,
 BenO


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/midgard config.m4

2001-02-13 Thread Sascha Schumann

sas Tue Feb 13 03:58:34 2001 EDT

  Modified files:  
/php4/ext/midgard   config.m4 
  Log:
  Outcomment everything contained in here.  
  
  This file must not perform any checks, unless the user has enabled 
  Midgard.
  
  
Index: php4/ext/midgard/config.m4
diff -u php4/ext/midgard/config.m4:1.1 php4/ext/midgard/config.m4:1.2
--- php4/ext/midgard/config.m4:1.1  Mon Feb 12 09:23:36 2001
+++ php4/ext/midgard/config.m4  Tue Feb 13 03:58:34 2001
@@ -1,42 +1,42 @@
-dnl $Id: config.m4,v 1.1 2001/02/12 17:23:36 emile Exp $
-dnl config.m4 for extension midgard
-dnl don't forget to call PHP_EXTENSION(midgard)
-
-AC_PROG_YACC
-AC_DECL_YYTEXT
-AC_PROG_LEX
-
-PHP_ARG_WITH(midgard, for midgard support,
-[  --with-midgard  Include midgard 1.4 support])
-
-if test "$PHP_MIDGARD" != "no"; then
-  if test "$PHP_MIDGARD" != "yes"; then
-AC_ADD_LIBRARY_WITH_PATH(midgard, "$PHP_MIDGARD/lib", MIDGARD_SHARED_LIBADD)
-AC_ADD_INCLUDE("$PHP_MIDGARD/include")
-  else
-AC_ADD_LIBRARY(midgard)
-  fi
-  AC_DEFINE(HAVE_MIDGARD, 1, [ ])
-  PHP_EXTENSION(midgard, $ext_shared)
-fi
-
-dnl EEH/TODO: Add checks for apache-static compilation
-AC_PATH_PROG(APXS, apxs)
-if test -z $APXS; then
-  AC_MSG_ERROR(apxs not found.)
-fi
-APACHE_INCLUDES=`$APXS -q INCLUDEDIR`
-AC_ADD_INCLUDE($APACHE_INCLUDES)
-
-AC_PATH_PROG(GLIBCONFIG, glib-config)
-dnl Ackackack... why do people do this?
-if test -z $GLIBCONFIG; then
-  AC_PATH_PROG(GLIBCONFIG, glib12-config)
-fi
-if test -z $GLIBCONFIG; then
-  AC_MSG_ERROR(glib-config not found. Did you install glib?)
-fi
-AC_ADD_LIBRARY_WITH_PATH(`$GLIBCONFIG --libs`)
-LFLAGS="-Pmgd -olex.yy.c"
-
-PHP_SUBST(GLIBCONFIG)
+dnl dnl $Id: config.m4,v 1.2 2001/02/13 11:58:34 sas Exp $
+dnl dnl config.m4 for extension midgard
+dnl dnl don't forget to call PHP_EXTENSION(midgard)
+dnl 
+dnl AC_PROG_YACC
+dnl AC_DECL_YYTEXT
+dnl AC_PROG_LEX
+dnl 
+dnl PHP_ARG_WITH(midgard, for midgard support,
+dnl [  --with-midgard  Include midgard 1.4 support])
+dnl 
+dnl if test "$PHP_MIDGARD" != "no"; then
+dnl   if test "$PHP_MIDGARD" != "yes"; then
+dnl AC_ADD_LIBRARY_WITH_PATH(midgard, "$PHP_MIDGARD/lib", MIDGARD_SHARED_LIBADD)
+dnl AC_ADD_INCLUDE("$PHP_MIDGARD/include")
+dnl   else
+dnl AC_ADD_LIBRARY(midgard)
+dnl   fi
+dnl   AC_DEFINE(HAVE_MIDGARD, 1, [ ])
+dnl   PHP_EXTENSION(midgard, $ext_shared)
+dnl fi
+dnl 
+dnl dnl EEH/TODO: Add checks for apache-static compilation
+dnl AC_PATH_PROG(APXS, apxs)
+dnl if test -z $APXS; then
+dnl   AC_MSG_ERROR(apxs not found.)
+dnl fi
+dnl APACHE_INCLUDES=`$APXS -q INCLUDEDIR`
+dnl AC_ADD_INCLUDE($APACHE_INCLUDES)
+dnl 
+dnl AC_PATH_PROG(GLIBCONFIG, glib-config)
+dnl dnl Ackackack... why do people do this?
+dnl if test -z $GLIBCONFIG; then
+dnl   AC_PATH_PROG(GLIBCONFIG, glib12-config)
+dnl fi
+dnl if test -z $GLIBCONFIG; then
+dnl   AC_MSG_ERROR(glib-config not found. Did you install glib?)
+dnl fi
+dnl AC_ADD_LIBRARY_WITH_PATH(`$GLIBCONFIG --libs`)
+dnl LFLAGS="-Pmgd -olex.yy.c"
+dnl 
+dnl PHP_SUBST(GLIBCONFIG)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP and Java (CVS version)

2001-02-13 Thread Montgomery-Recht, Evan

I've noticed a problem with the config.m4 in the ext/java directory.

Basic issue I'm running redhat 7.0 with the sun jdk installed in
/usr/java/jdk1.3

I type in really simple after doing a buildconf

I have my JAVA_HOME and PATH's setup to get all java exe's.

configure --with-mysql=/usr --with-java=/usr/java/jdk1.3

now when I go to do a make it's trying to use zip and not jar, so what I did
what I changed line
 23 to match line 21 and everything compiles correctly.

So it sounds like autoconf is not recognizing the PATH statement in my
system.

I'm not experienced enough with the autoconf and automake to really make
this change so it works properly since I know that I didn't do the right
thing to get it working.

if someone else has a suggestion on how to fix it properly please let me
know, and hopefully the CVS tree will get updated.

evan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Any image drawing tutorials anywhere?

2001-02-13 Thread Alain \Cyb\

http://www.phpbuilder.com/columns/rasmus19990124.php3


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] help with classes

2001-02-13 Thread Marcus Rasmussen


You can allso do this:

//foo.class.php
class Foo{
var $bar;
function Foo($bar){
$this-bar = $bar;
}
}

//foo.php
include("foo.class.php");
$bar = "1234";
$foo = new Foo($bar);
//Now: $foo-bar = "1234"

Regards: Marcus Rasmussen

*** REPLY SEPARATOR  ***

On 14-02-2001 at 15:52 Joseph H Blythe wrote:

On Mon, 12 Feb 2001 21:04:30 -0800
Joe wrote:

JC Is this closer to what you were looking for?
JC - Joe
JC 
JC ?PHP
JC 
JC  class Foo {
JC 
JC  var $bar;
JC 
JC  function mymethod(){
JC 
JC   global $foo;
JC   $this-bar = $foo;
JC 
JC  }
JC 
JC }
JC 
JC $foo = "hello world";
JC 
JC echo "htmlbody";
JC 
JC $cls = new foo();
JC $cls-mymethod();
JC echo $cls-bar;
JC 
JC echo "/body/html";
JC ?
JC 

hmm sort of is, basically this works:

// Foo.class.php
class Foo {

var $bar;

setBar($bar) {
   $this-bar = $bar;
}

}

// foo.php
include("Foo.class.php");
$foo = new Foo;
$bar = "1234567789";
$foo-setBar($bar);

Regards,

Joseph

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] foo[bar] _or_ foo['bar'] ?

2001-02-13 Thread Phil Driscoll

This is the correct format:
doWhatSoEver($foo['bar']);

If your error reporting level is set high enough, php will complain about
$foo[bar] unless you have defined bar as a constant elsewhere.
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP/Oracle mod

2001-02-13 Thread Rouvas Stathis

From your mail, I understand that you cannot proceed past the
compilation step.
I've seen the same on previous versions of PHP for Linux, but now this
is solved.
Maybe the Solaris version didn't got the same fixes...
Anyway, PHP will look at ORACLE_HOME for the required libraries which
has now different semantics for Oracle.
Now(Ora.8i.later) ORACLE_BASE points to old (Ora.8.0.xx) ORACLE_HOME.
The new ORACLE_HOME should be $ORACLE_BASE/product/8.1.6 (or whatever
version you have).
Hope this helps.
-Stathis.

rbradley wrote:
 
 I'm really struggling configuring the php mod with oracle 8i support on
 Solaris 8.
 
 ./configure --enable-track-vars --with-o8ci=/export/home/oracle
 --with-oracle --enable-sigchild --with-apxs
 
 The ORACLE_HOME is set to /export/home/oracle.
 
 I am getting an error:
 
 checking Oracle Install-Dir...
 ++
 | Notice:|
 | If you encounter defunc processes when using a local Oracle-DB   |
 | please recompile PHP and specify --enable-sigchild when configuring|
 | (This problem has been reported un Linux using Oracle = 8.1.5)|
 ++
 checking Oracle version... configure: error: Oracle needed libraries not found
 
 I installed the oracle 8i client prior to compiling. I've installed all
 the compilers, Please God, WHAT HAVE I DONE WRONG.  If anyone out
 there can help this poor wrech of a man. Please help me..
 
 --
 Richard Bradley
 CTO YourLink, inc.
 (321) 452-6699
 IM lagoonr

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Any image drawing tutorials anywhere?

2001-02-13 Thread Lucas Persona

Hello,

I've seen this 'text images generators' but I would like to know where
I can find some explanation about image manipulation like merging/mixing
two or more images.
Something like, I have a background image and some small image elements
that will be somewher on that background image...for example, my
background image is a table and I have some images like a book, a pen, a
paper..and so on, and what I want to do is to create a final image where
sometimes it will show two books and three pens on the table...sometimes
it will be just a pen on the table...
Have you ever seen something like that and where I can find information
about that?

Thanks,
Lucas Persona
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: Newbie: Images refs not loading (Broken Icons) How to?

2001-02-13 Thread Tim Ward


 -Original Message-
 From: Malouin Design Graphique [mailto:[EMAIL PROTECTED]]
 Sent: 13 February 2001 03:26
 To: [EMAIL PROTECTED]
 Subject: Newbie: Images refs not loading (Broken Icons) How to?
 
 
 Hi,
 
 Is there anything wrong with this code below?
 Any help or fix to this code would be very much appreciated.
 
 
 
 The file to get the data out (gif file):
 
 ?php
 
 /* data_out.php3 */
 
 $db = mysql_connect("www.server.com", "root", "password");
 mysql_select_db("db_name", $db);
 $sql = "select * from table_name order by 'date'";
 $sql = "select * from table_name";
 $result = mysql_query($sql);
 while ($row = mysql_fetch_array($result)) {
 print("trtd bgcolor=\"#003399\"");
 printf("img src=\"$indice_url\"%s/td/tr\n",
 $row["indice_url"]);

printf("img src=\"%s\"%s/td/tr\n", $row["indice_url"],
$row["indice_url"]);

although not sure of the use of printf. I would do 

echo("img src='" . $row["indice_url"] . "'" . $row["indice_url"] .
"/td/tr\n");

 }
 ?
 
 
 
 
 Here's the "tiny" table that feeds it:
 
 CREATE TABLE indice (
 id int(11) DEFAULT '0' NOT NULL auto_increment,
 date text,
 indice text,
 indice_url varchar(255),
 PRIMARY KEY (id)
 );
 
 
 
 
 Merci,
 
 Yves
 -- 
 
 
 
 Malouin Design Graphique
 http://www.malouin.qc.ca
 
 Québec (Québec)  CANADA
 
 


Tim Ward
Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Creating mail users with PHP

2001-02-13 Thread Ian LeBlanc

I am attempting to create mail users with PHP.
I have seen it done with perl and I am wondering if any of you have had 
success with doing it with PHP.


So far this is the info I have.
to create a user on a linux server you call "adduser -p password username" 
the only problem is you can not call
that from the apache server.. as far as i know of anyways.. because only 
root can call that script... and PHP runs
(for me anyways... ) under the apache username and group...

Does anyone have any suggestions?


Regards,

Ian LeBlanc
Web Development
Rask, Inc. - www.rask.com
Phone: (727) 517-2000
Fax:   (727) 517-2001




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] GD library

2001-02-13 Thread Rahul Hari Bhide

Hi ,
I am configuring php with the  --with-gd option .
My libgd.a is sitting in /usr/local/lib and other header files in
/usr/local/include .

./configure --with-gd=/usr/local/lib gives me the following error :

checking whether to include GD support... configure: error: Unable to find
libgd.(a|so) anywhere under /usr/local/lib

though the file is very much existant.

Any ideas what is wrong???

~Rahul



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] help with classes

2001-02-13 Thread Jesse Swensen

on 2/13/01 12:04 AM, Joe Conway at [EMAIL PROTECTED] wrote:

 ?PHP
 
 class Foo {
 
 var $bar;
 
 function mymethod(){
 
 global $foo;
 $this-bar = $foo;
 
 }
 
 }
 
 $foo = "hello world";
 
 echo "htmlbody";
 
 $cls = new foo();
 $cls-mymethod();
 echo $cls-bar;
 
 echo "/body/html";
 ?

This can be simplified by:

?php
class Foo {
function Foo($foo="") {
$this-bar = $foo;
}
}

$foo = "Hello World";
$cls = new Foo($foo);
echo $cls-bar;
?
-- 
Jesse Swensen
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] (robert)HELLO...all doubts about XML/APACHE/PERL/PHP/MOD

2001-02-13 Thread Celestino Roberto Alejandro

Hello...'m new in this list,and for this...Hello Hello to all people.
...and begin, with my first doubt...
..We (I, a friend, for the our job, need make application with xml, =
better say, migrate a current system of news, to the structured of XML, =
and procceses it with XLS, for generate directly the out, ..but, what is =
the problem? (: matter)!!..we are developing with PHP3!, and reading the =
specification only after vsion4 support XLS, with Sablatron, and Expat =
as parser of xml...but, i think? Why i can do this? if, the chief dont =
like Perl...(: i suggest he, that we can make an script that take the =
file xml, etc..and generate the out, with an interface with php =
script...but say no!...and after, try make with php...then i think in =
can i install PHP4 and PHP3 and run together?...HOW?
...Somebody know how work Xalan(: xml.apache.org...?)...
...How i can make a module for PHP3?(:_not PHP4!)
Thanks...and=20
..GOOD LUCK.
Roberto Celestino.



Re: [PHP] Creating mail users with PHP

2001-02-13 Thread Rick Hodger


Ian LeBlanc [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I am attempting to create mail users with PHP.
 I have seen it done with perl and I am wondering if any of you have had
 success with doing it with PHP.

Simple. Add each username and password to a plain text file. Once an hour,
have another script running under root's crontab check that file for entries
and create the users.

--
Rick Hodger



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Search replace text

2001-02-13 Thread PHPBeginner.com

ok, here's a scratch:

$contents = file ($file);
for($i=0; $isizeof($contents); $i++){
$staff .= eregi_replace("this", "with_this", $staff);
}

$fp = fopen ($file, "w");
$fputs ($staff);
fclose ($fp);


I think this should work ...


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-Original Message-
From: CDitty [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 3:29 AM
To: PHPBeginner.com
Subject: RE: [PHP] Search  replace text


Thanks for the idea.  Can you give me an example of how to load a file into
an array?  My efforts failed.

Thanks

At 03:41 AM 2/12/01, you wrote:
instead of writing to you the code I'll give you an idea:

1. you open the file and read it line-by-line assigning it to an array,
2. you loop that array parsing it line by line changing it's values with
RegEx the way you want.
3. you open the same file and, looping the array writing it down overriding
any existing data in the file.

You are now set.


Sincerely,

  Maxim Maletsky
  Founder, Chief Developer

  PHPBeginner.com (Where PHP Begins)
  [EMAIL PROTECTED]
  www.phpbeginner.com




-Original Message-
From: CDitty [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 12, 2001 5:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Search  replace text


Hello all.  I am trying to search through a text file on my server to
replace the user email.  I can open the file and read it, but cannot get it
to "find" the actual string and replace it.  Can someone look over my code
and see what the problem is?  I am afraid that ereg is not my strongest
point.

Also, at what point should I start writing the file out?  Wouldn't there be
a permissions error if I was reading and writing at the same time?

Thanks
CDitty


$oldemail = "[EMAIL PROTECTED]";
$newemail = "[EMAIL PROTECTED]";
$user = "cditty";
$file = fopen("/path/to/the/user/file/$user.dat", "r");
if(!$file){
  echo "pUnable to open remote file.\n";
  exit;
}else{
  echo "Successbr";
}
while (!feof($file)) {
  $line = fgets($file, 255);
  if(eregi($oldemail, $line, $out)) {
  str_replace($oldemail, $newemail, $line);
  }

echo $line . "BR";
}
fclose($file)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Regex help needed...

2001-02-13 Thread PHPBeginner.com

try ereg_replace("^[ ]+(.)[ ]+$", '_\\1_', $here)

I haven't tested it, but if it won't work, then do this:

$here = ereg_replace("^[ ]+", '_', $here)
$here = ereg_replace("[ ]$", '_', $here)

this should work...

Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Jesse Swensen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 4:39 AM
To: PHPBeginner.com
Subject: Re: [PHP] Regex help needed...


Thank you for your suggest, but I don't want to just trim them, I need to
display them as underscores (_).
--
Jesse Swensen
[EMAIL PROTECTED]

 From: "PHPBeginner.com" [EMAIL PROTECTED]
 Date: Tue, 13 Feb 2001 03:25:59 +0900
 To: "Jesse Swensen" [EMAIL PROTECTED], [EMAIL PROTECTED]
 Subject: RE: [PHP] Regex help needed...

 rtrim()

 www.php.net/rtrim


 Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





 -Original Message-
 From: Jesse Swensen [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, February 13, 2001 2:15 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Regex help needed...


 This should be a quick one, but I can't seem to wrap my brain around it.
 All I need to do is replace leading or trailing spaces with underscores.
If
 there is spaces in between words, leave them alone.

 Suggestions?

 --
 Jesse Swensen
 [EMAIL PROTECTED]


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] create filesystem folder?

2001-02-13 Thread PHPBeginner.com

mkdir()


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: andrew [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 11:56 AM
To: PHP General
Subject: [PHP] create filesystem folder?


subject says it all - any way to create a new folder in the filesystem?

regards,
andrew


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] mktime + 4 days

2001-02-13 Thread PHPBeginner.com

$time = time();

$timePlus4Days = $time + 60*60*24*4;

$tomorrow = date ("d", $timePlus4Days);


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Christopher Allen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 2:06 PM
To: php
Subject: [PHP] mktime + 4 days


Hi!
How to get this to work for every month:

$tomorrow = date ("d", mktime(0,0,0,0,date("d") +4 ) );  
echo "Today + 4 days  is $tomorrow br";
screws up Feb et al


Thanks,

Christopher C. M. Allen


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] SELECT statement

2001-02-13 Thread PHPBeginner.com

Yeah, sure you can:

$sql="SELECT id, email FROM table WHERE user='$user' and pass='$pass'";


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Peter Houchin [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 2:30 PM
To: PHP MAIL GROUP
Subject: [PHP] SELECT statement


Hi,

Can you have a SELECT statement (using mysql) that goes something like

$sql="SELECT id  email FROM table WHERE user='$user' and pass='$pass'";

and if you can't is there a away around this?

Thanks

Peter


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to check if vaiable is defined or not?

2001-02-13 Thread PHPBeginner.com

There's also possible to do a simple "try"

if($variable)
echo 'It contains something';
else
echo 'Has nothing inside, unless it's a 0';


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Ankur Verma [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 3:29 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] How to check if vaiable is defined or not?


try using

isset() or empty()

see the php manual for more details

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India

- Original Message -
From: "SED" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 4:51 AM
Subject: [PHP] How to check if vaiable is defined or not?


 Hi,

 I'm sending a form, with check-boxes, via post to PHP-script and if the
 boxes are not checked they don't post value for its variable - Can I check
 with a function if the variable is defined? (or should I focus on another
 solution?)

 Regards,
 Sumarlidi Einar Dadason

 SED - Graphic Design

 --
 Phone:   (+354) 4615501
 Mobile:  (+354) 8960376
 Fax: (+354) 4615503
 E-mail:  [EMAIL PROTECTED]
 Homepage:www.sed.is - New Homepage!
 --


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] problems with writing picture to the database.

2001-02-13 Thread PHPBeginner.com

I am not sure on how to help you with this out,
this is because I've never done so before. Why would you put files inside a
database. Just copy them in some folder and name within a logic, inserting
only a small string in your DB or even without it. Then call the graphic.

This is easier, faster, reliable, extendable.

All these different databases support files to simply not to lose the war
with their competitors. Not much programmers use it.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Siim Einfeldt aka Itpunk [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 8:01 PM
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] problems with writing picture to the database.



 O.K. I still got the problems. I`ll paste everything needed here and
please, if anyone knows how to make it work, let  me know.

*First, the part of the form is the following:

INPUT TYPE="file" NAME="file"

the enctype in my form tag is ENCTYPE="multipart/form-data" and METHOD =
POST

*The  code that actually *should* take care of the upload process to
mysql, is the following:

if (isset($file) AND $file != "none" AND strlen($file)2){
$file_data = fread( fopen($file, 'r'),
filesize($file) );
$theq = "INSERT INTO pildid
(file_name,file_type,file_data,tyyp,subid,picnr) VALUES ('$file',
'$file_type', '".addslashes($file_data)."','travels','$it','0')";
$result = mysql_query($theq);

}

And the errors I get, are':

Warning: fopen("C:\\ajutine\\Kevad.jpg","r") - No such file or directory
in /home/einfeldt/public_html/bt2/reis.php3 on line 62

Warning: Supplied argument is not a valid File-Handle resource in
/home/einfeldt/public_html/bt2/reis.php3 on line 62
INSERT INTO pildid (file_name,file_type,file_data,tyyp,subid,picnr) VALUES
('C:\\ajutine\\Kevad.jpg', '', '','travels','9','0')


Thanks
Siim Einfeldt



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Search replace text

2001-02-13 Thread PHPBeginner.com

Sorry, I made a small mistake in my code ...

this is correct:

$contents = file ($file);
for($i=0; $isizeof($contents); $i++){
$staff .= eregi_replace("this", "with_this", $contents[$i]);
}

$fp = fopen ($file, "w");
$fputs ($staff);
fclose ($fp);


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-Original Message-
From: PHPBeginner.com [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 11:34 PM
To: PHP; CDitty
Subject: RE: [PHP] Search  replace text


ok, here's a scratch:

$contents = file ($file);
for($i=0; $isizeof($contents); $i++){
$staff .= eregi_replace("this", "with_this", $staff);
}

$fp = fopen ($file, "w");
$fputs ($staff);
fclose ($fp);


I think this should work ...


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-Original Message-
From: CDitty [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 3:29 AM
To: PHPBeginner.com
Subject: RE: [PHP] Search  replace text


Thanks for the idea.  Can you give me an example of how to load a file into
an array?  My efforts failed.

Thanks

At 03:41 AM 2/12/01, you wrote:
instead of writing to you the code I'll give you an idea:

1. you open the file and read it line-by-line assigning it to an array,
2. you loop that array parsing it line by line changing it's values with
RegEx the way you want.
3. you open the same file and, looping the array writing it down overriding
any existing data in the file.

You are now set.


Sincerely,

  Maxim Maletsky
  Founder, Chief Developer

  PHPBeginner.com (Where PHP Begins)
  [EMAIL PROTECTED]
  www.phpbeginner.com




-Original Message-
From: CDitty [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 12, 2001 5:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Search  replace text


Hello all.  I am trying to search through a text file on my server to
replace the user email.  I can open the file and read it, but cannot get it
to "find" the actual string and replace it.  Can someone look over my code
and see what the problem is?  I am afraid that ereg is not my strongest
point.

Also, at what point should I start writing the file out?  Wouldn't there be
a permissions error if I was reading and writing at the same time?

Thanks
CDitty


$oldemail = "[EMAIL PROTECTED]";
$newemail = "[EMAIL PROTECTED]";
$user = "cditty";
$file = fopen("/path/to/the/user/file/$user.dat", "r");
if(!$file){
  echo "pUnable to open remote file.\n";
  exit;
}else{
  echo "Successbr";
}
while (!feof($file)) {
  $line = fgets($file, 255);
  if(eregi($oldemail, $line, $out)) {
  str_replace($oldemail, $newemail, $line);
  }

echo $line . "BR";
}
fclose($file)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Problems with date() - what have I missed?

2001-02-13 Thread Jon Haworth

Hi list.

I have a strange problem with a PHP script (WinNT/Apache/PHP4/MySQL).

The line of code

$dayname = date("D", mktime(0,0,0,$cmonth,$eventdate,$cyear));

should, if I understand it correctly, fill the variable $dayname with the
three-letter abbreviation of the day of the week for the date I supply.

I have $cmonth=3, $eventdate=26, and $cyear=2001. I would expect this to put
"Mon" in $dayname, given that March 26th 2001 is a Monday. However, my
script displays "Tue" which is a bit peculiar.

As if that weren't enough, it isn't consistent in getting the days wrong.
For example:

November 30th 2000 was a Thursday. It gets this right.
December 14th 2000 was a Thursday. It says it was a Tuesday.
January 11th 2001 was a Thursday. It says it was a Monday.
February 11th 2001 was a Sunday. It says it was a Monday.
March 26th 2001 is a Monday. It says it is a Tuesday.

What am I doing wrong? Is it something to do with last year (officially it
wasn't a leap year but as 2000 is divisible by 4, many people thought it
should be)? I'm in GMT so unless it's a BST thing I'm not being affected by
a local time zone.

All help gratefully appreciated

Cheers
Jon


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] rename?

2001-02-13 Thread Miguel Loureiro

Hi ,
having a hierarchy of directories, like A\b\d, A\c, I would like to move directory 
A\b\d to A\c\d , to (try) to get it I test something like rename(d,".. / c/d"), but I 
get " Warning: Rename failed (No such file or directory) in  ", it's necessary create 
the directory first, I mean , Mkdir(second_d) ? but the command its RENAME... or there 
are other, better , ways to do what I want. Consider that the directory d have lots of 
things (files and directories...).
T.Y
Best Regards
Miguel Loureiro [EMAIL PROTECTED] 








[PHP] hidden form field.

2001-02-13 Thread Angerer, Chad

Hello list,

Can someone please explain to me in simple terms.  What the exact reason is
for putting hidden form fields into an html document that uses PHP to
connect to a mySQL db .. or any db for that matter.  I have looked around
and have not gotten a good clear answer?

Thanks.

Chad Angerer


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] hidden form field.

2001-02-13 Thread Ifrim Sorin

Hello,

The reason is that you might want to pass to PHP script that process
the form information that is not found in any other shown field of the form
,
 for example an id code.

HTH
Sorin Ifrim

- Original Message -
From: Angerer, Chad [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 5:14 PM
Subject: [PHP] hidden form field.


 Hello list,

 Can someone please explain to me in simple terms.  What the exact reason
is
 for putting hidden form fields into an html document that uses PHP to
 connect to a mySQL db .. or any db for that matter.  I have looked around
 and have not gotten a good clear answer?

 Thanks.

 Chad Angerer


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Mystery quotes

2001-02-13 Thread John Hofstad-Parkhill

I'm encountering the following problem and now wonder if it's related to
magic quotes.

The code in the current, non-working form. Please note that for the
input.. there are no quotes or apostropies around the word "text" the size
of 9, the name of proj[].

***
echo "  script language=\"JavaScript\"\n";
echo "  !-- // hide from older browsers\n";

echo "  var cell = 0;\n";
echo "  var temp;\n";

echo "  for (row = 0; row  tasksOnPage; row++)\n";
echo "  {\n";
echo "document.write(\"tr\" +\n";
echo "  \"font size=2 face=arial\");\n";

echo "temp = Proj[row];\n";
echo "if (temp == \"\")\n";
echo "  temp = \"(default)\";\n";
echo "document.write(\"tdinput type=text size=9 value='\" +\n";
echo "  temp +\n";
echo "  \"' name=proj[] notab readonly/td\");\n";

echo "if (temp == \"(default)\")\n";
echo " temp = \"Requirement \" + Rqmt[row];\n";
echo "else\n";
echo " temp = Desc[row];\n";

*
This is the "View Source" from the browser (MSIE 5.5) output when the
display is correct:


  script language="JavaScript"
  !-- // hide from older browsers
  var cell = 0;
  var temp;
  for (row = 0; row  tasksOnPage; row++)
  {
document.write("tr" +
  "font size=2 face=arial");
temp = Proj[row];
if (temp == "")
  temp = "(default)";
document.write("tdinput type=text size=9 value='" +
  temp +
  "' name=proj[] notab readonly/td");
if (temp == "(default)")
 temp = "Requirement " + Rqmt[row];
else
 temp = Desc[row];


Note the input type=text size=9...

Now look at the cache'd version that comes up when I View Source:
(the page comes up in error, so I select View | Source from the MSIE menu)
and get the following text:



  script language="JavaScript"
  !-- // hide from older browsers
  var cell = 0;
  var temp;
  for (row = 0; row  tasksOnPage; row++)
  {
document.write("tr" +
  "font size=2 face=arial");
temp = Proj[row];
if (temp == "")
  temp = "(default)";
document.write("tdinput type="text" size="9" value="" +
  temp +
  "" name="proj[]" notab readonly/td");
if (temp == "(default)")
 temp = "Requirement " + Rqmt[row];
else
 temp = Desc[row];

**
Somebody, somewhere, somehow inserted double quotes around type, size, name
and value. This fails miserably. The only way I can make it go away is to
delete all temporary internet files.

The snippet meta... expires 0 is part of these pages.









-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Mystery quotes

2001-02-13 Thread John Vanderbeck

What about just forcing the use of escaped quotes? Have you tried that?

instead of:
echo "document.write(\"tdinput type=text size=9 value='\" +\n";
try:
echo "document.write(\"tdinput type=\"text\" size=\"9\" value='\"
+\n";

- John Vanderbeck
- Admin, GameDesign


- Original Message -
From: "John Hofstad-Parkhill" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 10:38 AM
Subject: [PHP] Mystery quotes


 I'm encountering the following problem and now wonder if it's related to
 magic quotes.

 The code in the current, non-working form. Please note that for the
 input.. there are no quotes or apostropies around the word "text" the
size
 of 9, the name of proj[].


 ***
 echo "  script language=\"JavaScript\"\n";
 echo "  !-- // hide from older browsers\n";

 echo "  var cell = 0;\n";
 echo "  var temp;\n";

 echo "  for (row = 0; row  tasksOnPage; row++)\n";
 echo "  {\n";
 echo "document.write(\"tr\" +\n";
 echo "  \"font size=2 face=arial\");\n";

 echo "temp = Proj[row];\n";
 echo "if (temp == \"\")\n";
 echo "  temp = \"(default)\";\n";
 echo "document.write(\"tdinput type=text size=9 value='\" +\n";
 echo "  temp +\n";
 echo "  \"' name=proj[] notab readonly/td\");\n";

 echo "if (temp == \"(default)\")\n";
 echo " temp = \"Requirement \" + Rqmt[row];\n";
 echo "else\n";
 echo " temp = Desc[row];\n";


 *
 This is the "View Source" from the browser (MSIE 5.5) output when the
 display is correct:


   script language="JavaScript"
   !-- // hide from older browsers
   var cell = 0;
   var temp;
   for (row = 0; row  tasksOnPage; row++)
   {
 document.write("tr" +
   "font size=2 face=arial");
 temp = Proj[row];
 if (temp == "")
   temp = "(default)";
 document.write("tdinput type=text size=9 value='" +
   temp +
   "' name=proj[] notab readonly/td");
 if (temp == "(default)")
  temp = "Requirement " + Rqmt[row];
 else
  temp = Desc[row];


 
 Note the input type=text size=9...

 Now look at the cache'd version that comes up when I View Source:
 (the page comes up in error, so I select View | Source from the MSIE menu)
 and get the following text:


 

   script language="JavaScript"
   !-- // hide from older browsers
   var cell = 0;
   var temp;
   for (row = 0; row  tasksOnPage; row++)
   {
 document.write("tr" +
   "font size=2 face=arial");
 temp = Proj[row];
 if (temp == "")
   temp = "(default)";
 document.write("tdinput type="text" size="9" value="" +
   temp +
   "" name="proj[]" notab readonly/td");
 if (temp == "(default)")
  temp = "Requirement " + Rqmt[row];
 else
  temp = Desc[row];


 **
 Somebody, somewhere, somehow inserted double quotes around type, size,
name
 and value. This fails miserably. The only way I can make it go away is to
 delete all temporary internet files.

 The snippet meta... expires 0 is part of these pages.









 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] hidden form field.

2001-02-13 Thread Kevin McCarthy

If you mean why would any script bother using a hidden form field to hold a 
value between html pages as opposed to holding it in a db field, I would 
answer there are reasons.
One would be to use a hidden form field as a buffer so that you don't have 
to change a field's value until you are sure you want it to be in a 
persistent state. An example might be letting a user review values they 
have entered into form fields before committing them to the DB.

At 09:14 AM 2/13/2001 -0600, Angerer, Chad wrote:
Hello list,

Can someone please explain to me in simple terms.  What the exact reason is
for putting hidden form fields into an html document that uses PHP to
connect to a mySQL db .. or any db for that matter.  I have looked around
and have not gotten a good clear answer?

Thanks.

Chad Angerer


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Any performance penalties for switch vs. if/else?

2001-02-13 Thread John Guynn

If I have a complex if else statement and I replace it with a switch case
statement do I loose any performance?  I would think I would gain
performance and the code is definitely easier to maintain but I wanted some
other opinions.

John Guynn

This email brought to you by RFCs 821 and 1225.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Any performance penalties for switch vs. if/else?

2001-02-13 Thread John Vanderbeck

In most cases, using a switch is preferrable. The code is cleaner, and the
performance increases.  This is true accross languages.

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "John Guynn" [EMAIL PROTECTED]
To: "Php (E-mail)" [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 11:34 AM
Subject: [PHP] Any performance penalties for switch vs. if/else?


 If I have a complex if else statement and I replace it with a switch case
 statement do I loose any performance?  I would think I would gain
 performance and the code is definitely easier to maintain but I wanted
some
 other opinions.

 John Guynn

 This email brought to you by RFCs 821 and 1225.


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Cookies

2001-02-13 Thread Gary

I am getting the following error message from the code below.

Warning: Undefined index: getdwgnum in d:\apache\htdocs/getdwgnum.php on
line 4


?php

 $cook = mt_rand (5, 5) ;
 $cookieinfo = $HTTP_COOKIE_VARS["getdwgnum"];
 if ($cookieinfo  "")
 {
$str = "where Cook = $cookieinfo";
$cx=odbc_pconnect("doc","","");
  }
  else
 setcookie ("getdwgnum", $cook,time()+28800);

?


I want to look for a cookie and if it is not there I want to set one. Any
ideas?

Thanks, Gary



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] OOP in web development

2001-02-13 Thread Joe Sheble (Wizaerd)

I've been using PHP for over a year now and have been successfully running 
three different websites developed with PHP, but I've never done anything 
with classes or objects.  Even when returning data from a mySQL database, I 
use mysql_fetch_array() instead of mysql_fetch_object().

What am I missing by not using objects and classes, other than 
reusability?  What are the real benefits to using OOPs in PHP?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 /ext/midgard .cvsignore ChangeLog INSTALL Makefile.in access.c article.c attachment.c calendar.c config.m4 element.cevent.c eventmember.c file.c fudge genentry.pl group.c

2001-02-13 Thread Emiliano

Stanislav Malyshev wrote:
 
 E I'm not familiar with the problems you may have had with readline.
 E If there's a licencing issue I'd love to talk about it.
 
 Basically, PHP code is non-GPL, thus you cannot have any GPL code
 distributed with PHP (since it makes all PHP "derived work", by RMSs
 logic).

Really? I support the GPL but this sounds like reversed logic to me.
Anyhow, we have no issue with the PHP part of midgard being LGPL.
The libs it links to allready are.

 We had problems with readline, since it's licensed as GPL. Now we
 have non-GPL readline implementation (though I fear nobody uses it - I
 don't really know why).

Where would you use readline in PHP?

Emile

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP vs JSP

2001-02-13 Thread Website4S

Hi,

Just wondering if anyone knows of any links to information relating to PHP vs 
JSP where PHP is my language of choice and another developer is recommending 
JSP but I know nothing about JSP to help me convince the buyer that PHP is a 
better choice.

A question that was raised is that PHP cannot be integrated with C++ for 
large functions etc.

My response was that I haven`t found a function that PHP cannot handle 
therefor integration was not a requirement

Anyone else have any valid upside or downsides to the languages which could 
help

Thanks
Ade

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /main internal_functions.c.in internal_functions_win32.c

2001-02-13 Thread Thies C. Arntzen

thies   Tue Feb 13 07:58:58 2001 EDT

  Modified files:  
/php4/main  internal_functions.c.in internal_functions_win32.c 
  Log:
  remove unneded comments
  
  
Index: php4/main/internal_functions.c.in
diff -u php4/main/internal_functions.c.in:1.16 php4/main/internal_functions.c.in:1.17
--- php4/main/internal_functions.c.in:1.16  Mon Jun  5 16:24:42 2000
+++ php4/main/internal_functions.c.in   Tue Feb 13 07:58:58 2001
@@ -18,7 +18,7 @@
  */
 
 
-/* $Id: internal_functions.c.in,v 1.16 2000/06/05 23:24:42 sas Exp $ */
+/* $Id: internal_functions.c.in,v 1.17 2001/02/13 15:58:58 thies Exp $ */
 
 #include "php.h"
 #include "php_main.h"
@@ -30,9 +30,6 @@
 #include stdio.h
 
 @EXT_INCLUDE_CODE@
-
-/* SNMP has to be moved to ext */
-/* #include "dl/snmp/php3_snmp.h" */
 
 zend_module_entry *php_builtin_extensions[] = {
 @EXT_MODULE_PTRS@
Index: php4/main/internal_functions_win32.c
diff -u php4/main/internal_functions_win32.c:1.35 
php4/main/internal_functions_win32.c:1.36
--- php4/main/internal_functions_win32.c:1.35   Sat Jan 27 19:40:15 2001
+++ php4/main/internal_functions_win32.cTue Feb 13 07:58:58 2001
@@ -18,7 +18,7 @@
  */
 
 
-/* $Id: internal_functions_win32.c,v 1.35 2001/01/28 03:40:15 phanto Exp $ */
+/* $Id: internal_functions_win32.c,v 1.36 2001/02/13 15:58:58 thies Exp $ */
 
 
 #include "php.h"
@@ -60,9 +60,6 @@
 #include "ext/xml/php_xml.h"
 #include "ext/wddx/php_wddx.h"
 #include "ext/mysql/php_mysql.h"
-
-/* SNMP has to be moved to ext */
-/* #include "dl/snmp/php_snmp.h" */
 
 zend_module_entry *php_builtin_extensions[] = {
phpext_standard_ptr,



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/midgard config.m4

2001-02-13 Thread Emiliano Heyns

emile   Tue Feb 13 08:13:34 2001 EDT

  Modified files:  
/php4/ext/midgard   config.m4 
  Log:
  Misplaced if spotted by Sascha
  
  
Index: php4/ext/midgard/config.m4
diff -u php4/ext/midgard/config.m4:1.2 php4/ext/midgard/config.m4:1.3
--- php4/ext/midgard/config.m4:1.2  Tue Feb 13 03:58:34 2001
+++ php4/ext/midgard/config.m4  Tue Feb 13 08:13:34 2001
@@ -1,42 +1,42 @@
-dnl dnl $Id: config.m4,v 1.2 2001/02/13 11:58:34 sas Exp $
-dnl dnl config.m4 for extension midgard
-dnl dnl don't forget to call PHP_EXTENSION(midgard)
-dnl 
-dnl AC_PROG_YACC
-dnl AC_DECL_YYTEXT
-dnl AC_PROG_LEX
-dnl 
-dnl PHP_ARG_WITH(midgard, for midgard support,
-dnl [  --with-midgard  Include midgard 1.4 support])
-dnl 
-dnl if test "$PHP_MIDGARD" != "no"; then
-dnl   if test "$PHP_MIDGARD" != "yes"; then
-dnl AC_ADD_LIBRARY_WITH_PATH(midgard, "$PHP_MIDGARD/lib", MIDGARD_SHARED_LIBADD)
-dnl AC_ADD_INCLUDE("$PHP_MIDGARD/include")
-dnl   else
-dnl AC_ADD_LIBRARY(midgard)
-dnl   fi
-dnl   AC_DEFINE(HAVE_MIDGARD, 1, [ ])
-dnl   PHP_EXTENSION(midgard, $ext_shared)
-dnl fi
-dnl 
-dnl dnl EEH/TODO: Add checks for apache-static compilation
-dnl AC_PATH_PROG(APXS, apxs)
-dnl if test -z $APXS; then
-dnl   AC_MSG_ERROR(apxs not found.)
-dnl fi
-dnl APACHE_INCLUDES=`$APXS -q INCLUDEDIR`
-dnl AC_ADD_INCLUDE($APACHE_INCLUDES)
-dnl 
-dnl AC_PATH_PROG(GLIBCONFIG, glib-config)
-dnl dnl Ackackack... why do people do this?
-dnl if test -z $GLIBCONFIG; then
-dnl   AC_PATH_PROG(GLIBCONFIG, glib12-config)
-dnl fi
-dnl if test -z $GLIBCONFIG; then
-dnl   AC_MSG_ERROR(glib-config not found. Did you install glib?)
-dnl fi
-dnl AC_ADD_LIBRARY_WITH_PATH(`$GLIBCONFIG --libs`)
-dnl LFLAGS="-Pmgd -olex.yy.c"
-dnl 
-dnl PHP_SUBST(GLIBCONFIG)
+dnl $Id: config.m4,v 1.3 2001/02/13 16:13:34 emile Exp $
+dnl config.m4 for extension midgard
+dnl don't forget to call PHP_EXTENSION(midgard)
+
+AC_PROG_YACC
+AC_DECL_YYTEXT
+AC_PROG_LEX
+
+PHP_ARG_WITH(midgard, for midgard support,
+[  --with-midgard  Include midgard 1.4 support])
+
+if test "$PHP_MIDGARD" != "no"; then
+  if test "$PHP_MIDGARD" != "yes"; then
+AC_ADD_LIBRARY_WITH_PATH(midgard, "$PHP_MIDGARD/lib", MIDGARD_SHARED_LIBADD)
+AC_ADD_INCLUDE("$PHP_MIDGARD/include")
+  else
+AC_ADD_LIBRARY(midgard)
+  fi
+  AC_DEFINE(HAVE_MIDGARD, 1, [ ])
+  PHP_EXTENSION(midgard, $ext_shared)
+
+dnl EEH/TODO: Add checks for apache-static compilation
+  AC_PATH_PROG(APXS, apxs)
+  if test -z $APXS; then
+AC_MSG_ERROR(apxs not found.)
+  fi
+  APACHE_INCLUDES=`$APXS -q INCLUDEDIR`
+  AC_ADD_INCLUDE($APACHE_INCLUDES)
+  
+  AC_PATH_PROG(GLIBCONFIG, glib-config)
+  dnl Ackackack... why do people do this?
+  if test -z $GLIBCONFIG; then
+AC_PATH_PROG(GLIBCONFIG, glib12-config)
+  fi
+  if test -z $GLIBCONFIG; then
+AC_MSG_ERROR(glib-config not found. Did you install glib?)
+  fi
+  AC_ADD_LIBRARY_WITH_PATH(`$GLIBCONFIG --libs`)
+  LFLAGS="-Pmgd -olex.yy.c"
+  
+  PHP_SUBST(GLIBCONFIG)
+fi



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Include

2001-02-13 Thread Fabian Fabela

Hello,

I have php 4.0.3pl1.

I am trying to install phorum (phorum.org).

In a php file (index.php in admin) there is the function include for a file 
(common.php), I get the following error.

Warning: Failed opening 'common.php' for inclusion (include_path='/usr/share/php') in 
/home/web/vacagorda/jeans/htdocs/foro/administration/index.php on line 28

Why I can't include that file without putting it in the /usr/shar/php diretory?

Thank you

Fabian Fabela
[EMAIL PROTECTED]

"La informacin transmitida en el presente mensaje tiene la intencin de estar 
dirigida nicamente a la persona o entidad que se refiere y puede contener informacin 
privilegiada y/o confidencial. Cualquier, revisin, retransmisin, diseminacin o 
cualquier uso impropio o relacionado con dicha informacin por persona alguna distinta 
a la que fue dirigido este mensaje queda estrictamente prohibido. Si Usted ha recibido 
 este mensaje o sus anexos por error, favor de contactar al remitente y elimine el 
material de cualquier computadora."

"The information transmitted is intended only for the person or entity to which it is 
addressed and may contain confidential and/or privileged material.  Any review, 
retransmission, dissemination or other use of, or taking of any action in reliance 
upon, this information by persons or entities other than the intended recipient is 
prohibited.   If you received this in error, please contact the sender and delete the 
material from any computer."



Re: [PHP] foo[bar] _or_ foo['bar'] ?

2001-02-13 Thread Derek Sivers


I'd really appreciate a clear statement whether to use better
$foo = array('bar' = 'boing');
 doWhatSoEver($foo[bar]);
or
$foo = array('bar' = 'boing');
 doWhatSoEver($foo['bar']);


I had heard someone on the list say that it's always best to use quotes, 
for the same reason as XHTML, where every value MUST have quotes.

But honestly I've been using only NO-quotes all year and find it much 
easier to read.  And NEVER any problem!

Also makes it easier when you need to use an array variable inside a quoted 
string:

print "Hello there $client[name]";



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/pgsql pgsql.c

2001-02-13 Thread Thies C. Arntzen

thies   Tue Feb 13 08:54:48 2001 EDT

  Modified files:  
/php4/ext/pgsql pgsql.c 
  Log:
  @- fixes PostgeSQL pg_connect() bug. We would sometimes close the default
  @  link by acciedent. (Patch by: [EMAIL PROTECTED])
  
  
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.85 php4/ext/pgsql/pgsql.c:1.86
--- php4/ext/pgsql/pgsql.c:1.85 Wed Jan 31 13:53:29 2001
+++ php4/ext/pgsql/pgsql.c  Tue Feb 13 08:54:48 2001
@@ -17,7 +17,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.85 2001/01/31 21:53:29 andi Exp $ */
+/* $Id: pgsql.c,v 1.86 2001/02/13 16:54:48 thies Exp $ */
 
 #include stdlib.h
 
@@ -114,9 +114,10 @@
 {   
PGLS_FETCH();
 
-if (PGG(default_link)!=-1) {
+if ((PGG(default_link) != -1)  (PGG(default_link) != id)) {
 zend_list_delete(PGG(default_link));
 }
+
 if (PGG(default_link) != id) {
 PGG(default_link) = id;
 zend_list_addref(id);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Return ODBC Results to an array

2001-02-13 Thread Karl J. Stubsjoen

Is there a way to return the results of a query straight into an array?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Problems with date() - what have I missed?

2001-02-13 Thread Jon Haworth

Don't worry. False alarm. My bad. (etc)

Hint for people experiencing a problem like this in the future: when passing
variables to mktime(), ensure $cmonth=3 and not $cmonth="March", I find it
helps a *lot* :-)

Moral to the story: when having difficulties, echo your variables to the
screen

Cheers
Jon


-Original Message-
From: Jon Haworth [mailto:[EMAIL PROTECTED]]
Sent: 13 February 2001 14:38
To: '[EMAIL PROTECTED]'
Subject: [PHP] Problems with date() - what have I missed?


Hi list.

I have a strange problem with a PHP script (WinNT/Apache/PHP4/MySQL).

The line of code

$dayname = date("D", mktime(0,0,0,$cmonth,$eventdate,$cyear));

should, if I understand it correctly, fill the variable $dayname with the
three-letter abbreviation of the day of the week for the date I supply.

I have $cmonth=3, $eventdate=26, and $cyear=2001. I would expect this to put
"Mon" in $dayname, given that March 26th 2001 is a Monday. However, my
script displays "Tue" which is a bit peculiar.

As if that weren't enough, it isn't consistent in getting the days wrong.
For example:

November 30th 2000 was a Thursday. It gets this right.
December 14th 2000 was a Thursday. It says it was a Tuesday.
January 11th 2001 was a Thursday. It says it was a Monday.
February 11th 2001 was a Sunday. It says it was a Monday.
March 26th 2001 is a Monday. It says it is a Tuesday.

What am I doing wrong? Is it something to do with last year (officially it
wasn't a leap year but as 2000 is divisible by 4, many people thought it
should be)? I'm in GMT so unless it's a BST thing I'm not being affected by
a local time zone.

All help gratefully appreciated

Cheers
Jon


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Fw: [PHP] Include

2001-02-13 Thread Fabian Fabela

Well

The file is not in the same dir, but the php file that is calling it is
using the chdir function to go to that dir, even if I put the file in the
same dir I can't include it.

Thank you.


Fabian Fabela
[EMAIL PROTECTED]
www.vacagorda.com

- Original Message -
From: "Fabian Fabela" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 11:38 AM
Subject: [PHP] Include


Hello,

I have php 4.0.3pl1.

I am trying to install phorum (phorum.org).

In a php file (index.php in admin) there is the function include for a file
(common.php), I get the following error.

Warning: Failed opening 'common.php' for inclusion
(include_path='/usr/share/php') in
/home/web/vacagorda/jeans/htdocs/foro/administration/index.php on line 28

Why I can't include that file without putting it in the /usr/shar/php
diretory?

Thank you

Fabian Fabela
[EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Netscape not resolving $PHPSELF ??

2001-02-13 Thread John Vanderbeck

I'm having a problemin Netscape, any of my echo statements that use
$PHPSELF, netscape isn't resolving $PHPSELF, but properly resolving all the
other vars.  There are several different types of echo statements, but here
is a sample:

echo 'BRA HREF="', $PHPSELF, '?mode=sub_categorycategory=',
$category, 'sub_category=', urlencode($subcategories[$index]), '"',
$subcategories[$index], '/A';

and:

   echo "P CLASS=NormalA
HREF=$PHPSELF?mode=indexcategory=rootMain/A - $category/P";


Any ideas? This works FINE in Internet Explorer. And all the other vars in
those echo statements are properly resoved into value.

- John Vanderbeck
- Admin, GameDesign


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] help: Mysql locking tables and persistent connections..

2001-02-13 Thread Eduardo Dominguez

I am trying to avoid some concurrency problems by using
locking tables in mysql. Problem is, I already locked
the tables and still had a concurrency problem.

Our first guess is that since we are accesing the
table with the same user, then when it ignores the
log since it is the same user. But this cant be
the way it works. I imagine its per process, not
per user. But then, we are using persistent connections.
Does this influence table locking ??

any ideas or thoughts on this are greatly appreciated...
I know I am missing something here.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Netscape not resolving $PHPSELF ??

2001-02-13 Thread Jon Haworth

Is the script in the root? I seem to remember reading about problems with
this and Netscape (although that sounds so strange I'm doubting myself here
:-)

Try shoving it in a subdirectory and see what happens. It's got to be worth
30 seconds to find out - I'd do it right now only I don't have Netscape at
work

HTH
Jon



-Original Message-
From: John Vanderbeck [mailto:[EMAIL PROTECTED]]
Sent: 13 February 2001 17:42
To: [EMAIL PROTECTED]
Subject: [PHP] Netscape not resolving $PHPSELF ??


I'm having a problemin Netscape, any of my echo statements that use
$PHPSELF, netscape isn't resolving $PHPSELF, but properly resolving all the
other vars.  There are several different types of echo statements, but here
is a sample:

echo 'BRA HREF="', $PHPSELF, '?mode=sub_categorycategory=',
$category, 'sub_category=', urlencode($subcategories[$index]), '"',
$subcategories[$index], '/A';

and:

   echo "P CLASS=NormalA
HREF=$PHPSELF?mode=indexcategory=rootMain/A - $category/P";


Any ideas? This works FINE in Internet Explorer. And all the other vars in
those echo statements are properly resoved into value.

- John Vanderbeck
- Admin, GameDesign


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Netscape not resolving $PHPSELF ??

2001-02-13 Thread Pavel Jartsev

John Vanderbeck wrote:
 
 I'm having a problemin Netscape, any of my echo statements that use
 $PHPSELF, netscape isn't resolving $PHPSELF, but properly resolving all the
 other vars.  There are several different types of echo statements, but here
 is a sample:
 
 echo 'BRA HREF="', $PHPSELF, '?mode=sub_categorycategory=',
 $category, 'sub_category=', urlencode($subcategories[$index]), '"',
 $subcategories[$index], '/A';
 
 and:
 
echo "P CLASS=NormalA
 HREF=$PHPSELF?mode=indexcategory=rootMain/A - $category/P";
 
 Any ideas? This works FINE in Internet Explorer. And all the other vars in
 those echo statements are properly resoved into value.
 

Try $PHP_SELF.

-- 
Pavel a.k.a. Papi

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Netscape not resolving $PHPSELF ??

2001-02-13 Thread John Vanderbeck

Well, yes the script was in the root (root of the URL not root of the
server).  I threw it into a subdirectory, but no go.  Same problem.

Very strange.

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "Jon Haworth" [EMAIL PROTECTED]
To: "'John Vanderbeck'" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 12:46 PM
Subject: RE: [PHP] Netscape not resolving $PHPSELF ??


 Is the script in the root? I seem to remember reading about problems with
 this and Netscape (although that sounds so strange I'm doubting myself
here
 :-)

 Try shoving it in a subdirectory and see what happens. It's got to be
worth
 30 seconds to find out - I'd do it right now only I don't have Netscape at
 work

 HTH
 Jon



 -Original Message-
 From: John Vanderbeck [mailto:[EMAIL PROTECTED]]
 Sent: 13 February 2001 17:42
 To: [EMAIL PROTECTED]
 Subject: [PHP] Netscape not resolving $PHPSELF ??


 I'm having a problemin Netscape, any of my echo statements that use
 $PHPSELF, netscape isn't resolving $PHPSELF, but properly resolving all
the
 other vars.  There are several different types of echo statements, but
here
 is a sample:

 echo 'BRA HREF="', $PHPSELF, '?mode=sub_categorycategory=',
 $category, 'sub_category=', urlencode($subcategories[$index]), '"',
 $subcategories[$index], '/A';

 and:

echo "P CLASS=NormalA
 HREF=$PHPSELF?mode=indexcategory=rootMain/A - $category/P";


 Any ideas? This works FINE in Internet Explorer. And all the other vars in
 those echo statements are properly resoved into value.

 - John Vanderbeck
 - Admin, GameDesign


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] foo[bar] _or_ foo['bar'] ?

2001-02-13 Thread Phil Driscoll

Bad practice alert!!!

Derek Sivers wrote:
I had heard someone on the list say that it's always best to use quotes,
for the same reason as XHTML, where every value MUST have quotes.

But honestly I've been using only NO-quotes all year and find it much
easier to read.  And NEVER any problem!

Also makes it easier when you need to use an array variable inside a quoted
string:

print "Hello there $client[name]";

If your php error reporting level is set to show warnings (which it should
be on your development machines) then referring to
$foo[bar]
will give
Warning: Use of undefined constant bar - assumed 'bar' in
whatever/yourscript.php on line n

So php only works in this case because it couldn't find bar in it's list of
constants, and guessed at the mistake you made. This just slows things down.

I can't see any advantage at all to missing the quotes out.

Your example could be written

print "Hello there {$client['name']}";

Sorry to sound stroppy :)

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org


-Original Message-
From: Derek Sivers [EMAIL PROTECTED]
To: Matthias Krehl [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Tuesday, February 13, 2001 5:34 PM
Subject: Re: [PHP] foo[bar] _or_ foo['bar'] ?



I'd really appreciate a clear statement whether to use better
$foo = array('bar' = 'boing');
 doWhatSoEver($foo[bar]);
or
$foo = array('bar' = 'boing');
 doWhatSoEver($foo['bar']);





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP vs JSP

2001-02-13 Thread Pavel Jartsev

[EMAIL PROTECTED] wrote:
 
 Hi,
 
 Just wondering if anyone knows of any links to information relating to PHP vs
 JSP where PHP is my language of choice and another developer is recommending
 JSP but I know nothing about JSP to help me convince the buyer that PHP is a
 better choice.
 ...

Here's something:
http://php.weblogs.com/jsp


Maybe it helps a little. :)

-- 
Pavel a.k.a. Papi

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PARANOID PERMISSIONS for apache?

2001-02-13 Thread Derek Sivers

Can anyone think of any downside to this idea?

Set Apache to run as user/group "www:www"

Set ownership of PHP files and folders to "www:www"
And set permissions to 700
So that ONLY Apache can read them.

Now - even if I give someone shell access to my box, or someone finds my 
personal login password, they still can't read my PHP passwords to MySQL.

(Of course I'd have to be user "www" when uploading changes/files to the 
website.)

Any other paranoid people tried this?
Any downside to it?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP vs JSP

2001-02-13 Thread Philip Olson

The general php mailing list discusses this every so often, here are a few
threads : 

  http://marc.theaimsgroup.com/?l=php-generalm=97948720824237w=2 

  http://marc.theaimsgroup.com/?l=php-generalm=97621741324759w=2 

  http://marc.theaimsgroup.com/?l=php-generalm=97413389003820w=2 

Can find more here : 

  http://marc.theaimsgroup.com/?l=php-generalr=1w=2q=bs=jsp

Regards,


Philip Olson
http://www.cornado.com/

On Tue, 13 Feb 2001 [EMAIL PROTECTED] wrote:

 Hi,
 
 Just wondering if anyone knows of any links to information relating to PHP vs 
 JSP where PHP is my language of choice and another developer is recommending 
 JSP but I know nothing about JSP to help me convince the buyer that PHP is a 
 better choice.
 
 A question that was raised is that PHP cannot be integrated with C++ for 
 large functions etc.
 
 My response was that I haven`t found a function that PHP cannot handle 
 therefor integration was not a requirement
 
 Anyone else have any valid upside or downsides to the languages which could 
 help
 
 Thanks
 Ade
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Return ODBC Results to an array

2001-02-13 Thread Ifrim Sorin

You can use mysql_fetch_array() for each row returned in the cursor.

Sorin Ifrim


- Original Message - 
From: Karl J. Stubsjoen [EMAIL PROTECTED]
To: PHP Mailing List [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 7:32 PM
Subject: [PHP] Return ODBC Results to an array


 Is there a way to return the results of a query straight into an array?
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Netscape not resolving $PHPSELF ??

2001-02-13 Thread John Vanderbeck


- Original Message -
From: "Pavel Jartsev" [EMAIL PROTECTED]
To: "John Vanderbeck" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 12:49 PM
Subject: Re: [PHP] Netscape not resolving $PHPSELF ??



 Try $PHP_SELF.

 --
 Pavel a.k.a. Papi


Thanks that fixed it.  I didn't realize there were two version of this
variable.  Why? Hmm, strange that the other one worked fine with IE but not
Netscape.  I thought all thi was done server side, so what the heck does the
browser have to do with it?

- John Vanderbeck
- Admin, GameDesign


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Return ODBC Results to an array

2001-02-13 Thread Ifrim Sorin

For ODBC, the function is odbc_fetch_into().

Sorin Ifrim

- Original Message - 
From: Karl J. Stubsjoen [EMAIL PROTECTED]
To: PHP Mailing List [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 7:32 PM
Subject: [PHP] Return ODBC Results to an array


 Is there a way to return the results of a query straight into an array?
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PARANOID PERMISSIONS for apache?

2001-02-13 Thread Steve Smith

On Tue, 13 Feb 2001, Derek Sivers wrote:

 Can anyone think of any downside to this idea?

 Set Apache to run as user/group "www:www"
 
 Set ownership of PHP files and folders to "www:www"
 And set permissions to 700
 So that ONLY Apache can read them.
 
 Now - even if I give someone shell access to my box, or someone finds my 
 personal login password, they still can't read my PHP passwords to MySQL.
 
 (Of course I'd have to be user "www" when uploading changes/files to the 
 website.)
 
 Any other paranoid people tried this?
 Any downside to it?


Yeah ... I can create a .php script to read anything that is www
owned, and then just run that using a webbrowser... It'll have www
permissions just like your programs do. 

Unfortunatly in a multi-user, php-module mode enviroment, making
.php files secured from other users on the box is a near impossibility.
Your best bet is to run php as a CGI program and use Apache's suExec
functionality.  This way you can keep all your php files under your login
id's ownership.


--Steve


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Bad Practices

2001-02-13 Thread Jeff Oien

Would people like to list bad practices and also point us
newbies to any articles online dealing with syntax, correct
use of single and double quotes etc.? 

I would like to get a good handle on these issues right
from the beginning. As a Web designer I like to use 
standard HTML and do everything correctly even if the
browser is forgiving. I notice that a LOT of programmers
write bad HTML and I would imagine many of the publicly
available PHP scripts aren't exactly kosher either. What are 
some of the most objectionable things you see? Thanks.
Jeff Oien

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Bad Practices

2001-02-13 Thread Benjamin Munoz

Three good articles by the author of PHP Developer's Cookbook.

Top 21 PHP progamming mistakes 
By Sterling Hughes 

http://zend.com/zend/art/mistake.php

http://zend.com/zend/art/mistake1.php

http://zend.com/zend/art/mistake2.php

-Ben Munoz

-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 10:11 AM
To: PHP
Subject: [PHP] Bad Practices


Would people like to list bad practices and also point us
newbies to any articles online dealing with syntax, correct
use of single and double quotes etc.? 

I would like to get a good handle on these issues right
from the beginning. As a Web designer I like to use 
standard HTML and do everything correctly even if the
browser is forgiving. I notice that a LOT of programmers
write bad HTML and I would imagine many of the publicly
available PHP scripts aren't exactly kosher either. What are 
some of the most objectionable things you see? Thanks.
Jeff Oien

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Bad Practices

2001-02-13 Thread Philip Olson


Be sure to check this out :

Using Strings :
---
http://www.zend.com/zend/tut/using-strings.php

Don't put large blocks of HTML within echo or print, don't be afraid
to escape out of PHP for that.   Also, check out this three part series,
here's the first :

Top 21 PHP progamming mistakes - Part 1 of 3  :
---
http://zend.com/zend/art/mistake.php

They're very useful.  Also, regarding SQL, don't do "SELECT * ..." all the
time as it's overkill if not all fields are being used.

Regards,


Philip Olson
http://www.cornado.com/

On Tue, 13 Feb 2001, Jeff Oien wrote:

 Would people like to list bad practices and also point us
 newbies to any articles online dealing with syntax, correct
 use of single and double quotes etc.? 
 
 I would like to get a good handle on these issues right
 from the beginning. As a Web designer I like to use 
 standard HTML and do everything correctly even if the
 browser is forgiving. I notice that a LOT of programmers
 write bad HTML and I would imagine many of the publicly
 available PHP scripts aren't exactly kosher either. What are 
 some of the most objectionable things you see? Thanks.
 Jeff Oien
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] locating the actual php executable

2001-02-13 Thread Brandon Orther

Hello,

I am trying to locate the php executable on my server.  Is there an easy way
to do this?

Thank you,


Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Pay for help

2001-02-13 Thread rbradley

Thankyou Boaz, I'm sorry, I just needed help. I didn't care if I had to
pay or got free assistance.  I also realize that paying for Open Source
software help may not be etiquette either. Please forgive me I'll post
this in the places

Boaz Yahav wrote:
 
 Hi
 
 A good place to put this would be either in the projects area
 of weberdev (http://www.weberdev.com/index.php3?GoTo=jobmatching/about.php3)
 
 or the jobs area (http://www.weberjob.com).
 
 Sincerely
 
   berber
 
 Visit http://www.weberdev.com Today!!!
 To see where PHP might take you tomorrow.
 
 
 -Original Message-
 From: rbradley [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, February 13, 2001 3:43 AM
 To: PHP
 Subject: [PHP] Pay for help
 
 My company is willing to pay for some assistance in helping us install:
 
 PHP apache mod with oracle 8i functions on a Solaris 8 box.
 
 Are there any takers?
 
 --
 Richard Bradley
 CTO YourLink, inc.
 (321) 452-6699
 IM lagoonr
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
Richard Bradley
CTO YourLink, inc.
(321) 452-6699
IM lagoonr

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] locating the actual php executable

2001-02-13 Thread Brian Clark


Hi Brandon,

@ 1:36:32 PM on 2/13/2001, [EMAIL PROTECTED] wrote:

 I am trying to locate the php executable on my server. Is there an
 easy way to do this?

Linux, I assume?

 shell su
 shell updatedb
 shell locate php | grep bin

May find it.

-Brian



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Return ODBC Results to an array

2001-02-13 Thread Andrew Hill

Karl,


http://www.php.net/manual/en/function.odbc-fetch-into.php

Best regards,
Andrew
--
Andrew Hill - OpenLink Software
Director Technology Evangelism
eBusiness Infrastructure Technology 
http://www.openlinksw.com

 -Original Message-
 From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, February 13, 2001 12:33 PM
 To: PHP Mailing List
 Subject: [PHP] Return ODBC Results to an array
 
 
 Is there a way to return the results of a query straight into an array?
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Netscape not resolving $PHPSELF ??

2001-02-13 Thread Jason Stechschulte

 Thanks that fixed it.  I didn't realize there were two version of this
 variable.  Why? Hmm, strange that the other one worked fine with IE but not
 Netscape.  I thought all thi was done server side, so what the heck does the
 browser have to do with it?

As far as I know, $PHP_SELF is the variable and NOT $PHPSELF.  It works
in IE because if no page is printed in the tag, it just reloads the same
page anyway.  If you look at your html source while using $PHPSELF, you
will probably see something like this:

a href=This is the link/a

Netscape realizes this is invalid html and complains, IE simply reloads
the current page.  

-- 
Jason Stechschulte
[EMAIL PROTECTED]
--
But you have to allow a little for the desire to evangelize when you
think you have good news.
 -- Larry Wall in [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Knowledgebase HelpDesk

2001-02-13 Thread Ashwin Kutty

Anyone know of any project in the works right now that is a HelpDesk and
Knowledgebase combined?

Thanks..


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Knowledgebase HelpDesk

2001-02-13 Thread Albrecht Guenther

Hello Ashwin,

 Anyone know of any project in the works right now that is a HelpDesk and
 Knowledgebase combined?

The groupware PHProjekt ( www.PHProjekt.de/en )
has a request tracker (same as help desk) and
the searchable knowledge base is basically the sum
of all solved request with the status 'open to public'.
Open source, requires PHP4 and MySQL.

greetings
Albrecht




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Netscape not resolving $PHPSELF ??

2001-02-13 Thread John Vanderbeck

  Thanks that fixed it.  I didn't realize there were two version of this
  variable.  Why? Hmm, strange that the other one worked fine with IE but
not
  Netscape.  I thought all thi was done server side, so what the heck does
the
  browser have to do with it?

 As far as I know, $PHP_SELF is the variable and NOT $PHPSELF.  It works
 in IE because if no page is printed in the tag, it just reloads the same
 page anyway.  If you look at your html source while using $PHPSELF, you
 will probably see something like this:

 a href=This is the link/a

 Netscape realizes this is invalid html and complains, IE simply reloads
 the current page.


No, that can't be it, because it actually gets resolvedI have echo'd it
out to the screen to verify, and it DOES get resolved in IE.

- John Vanderbeck
- Admin, GameDesign

 --
 Jason Stechschulte
 [EMAIL PROTECTED]
 --
 But you have to allow a little for the desire to evangelize when you
 think you have good news.
  -- Larry Wall in [EMAIL PROTECTED]

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] foo[bar] _or_ foo['bar'] ?

2001-02-13 Thread php3

Addressed to: Derek Sivers [EMAIL PROTECTED]
  "Matthias Krehl" [EMAIL PROTECTED]
  [EMAIL PROTECTED]

** Reply to note from Derek Sivers [EMAIL PROTECTED] Tue, 13 Feb 2001 09:31:29 -0800


 I'd really appreciate a clear statement whether to use better
 $foo = array('bar' = 'boing');
  doWhatSoEver($foo[bar]);
 or
 $foo = array('bar' = 'boing');
  doWhatSoEver($foo['bar']);


 I had heard someone on the list say that it's always best to use quotes,
 for the same reason as XHTML, where every value MUST have quotes.

 But honestly I've been using only NO-quotes all year and find it much
 easier to read.  And NEVER any problem!

 Also makes it easier when you need to use an array variable inside a quoted
 string:

 print "Hello there $client[name]";

Several people have mentioned that this is a bad practice, but no one
has mentioned why...

There are two gotchas you have to look out for, that quotes will
prevent.  First, if you are using some_word as an array index and
someone decides that it would be a good name for a built in function,
constant, or statement all of a sudden all of your programs will break.

Second, take one of your programs that uses some_word all over it, and
add:

define( 'some_word', 'something_else' );

into one of your include files, now life gets very interesting:


$X[ 'some_word' ] = 'foo';
$X[ 'something_else' ] = 'bar';

echo $X[ some_word ];  // prints  bar

echo $X[ 'some_word' ];  // always works as expected.




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] foo[bar] _or_ foo['bar'] ?

2001-02-13 Thread Andi Gutmans

$foo[bar] only works for backwards compatibility. In fact writing bar 
without '' means that it's a constant and if that constant value is defined 
it will be substituted instead of the bar. If it's not defined it defaults 
to the string 'bar'.
So if you want to do it right (and faster) do $foo['bar']

Andi

At 05:48 PM 2/13/2001 +, Phil Driscoll wrote:
Bad practice alert!!!

Derek Sivers wrote:
 I had heard someone on the list say that it's always best to use quotes,
 for the same reason as XHTML, where every value MUST have quotes.
 
 But honestly I've been using only NO-quotes all year and find it much
 easier to read.  And NEVER any problem!
 
 Also makes it easier when you need to use an array variable inside a quoted
 string:
 
 print "Hello there $client[name]";

If your php error reporting level is set to show warnings (which it should
be on your development machines) then referring to
$foo[bar]
will give
Warning: Use of undefined constant bar - assumed 'bar' in
whatever/yourscript.php on line n

So php only works in this case because it couldn't find bar in it's list of
constants, and guessed at the mistake you made. This just slows things down.

I can't see any advantage at all to missing the quotes out.

Your example could be written

print "Hello there {$client['name']}";

Sorry to sound stroppy :)

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org


-Original Message-
From: Derek Sivers [EMAIL PROTECTED]
To: Matthias Krehl [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Tuesday, February 13, 2001 5:34 PM
Subject: Re: [PHP] foo[bar] _or_ foo['bar'] ?


 
 I'd really appreciate a clear statement whether to use better
 $foo = array('bar' = 'boing');
  doWhatSoEver($foo[bar]);
 or
 $foo = array('bar' = 'boing');
  doWhatSoEver($foo['bar']);
 
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




FW: [PHP] Here you have, ;o)

2001-02-13 Thread Thor M. Steindorsson


or simpler yet, REMOVE WINDOWS SCRIPTING HOST!

It does nothing useful (or at least the few useful things it does are things
we can easily live without).

All it does is open every possible door on a windows box to viruses and
hackers.

Without the WSH, none of these worms will work.

cheers,
Thor.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Jonatan Bagge
Sent: Tuesday, February 13, 2001 1:15 AM
To: ajay arora
Cc: php general
Subject: Re: [PHP] Here you have, ;o)


You guys should really stop using outlook.


ajay arora wrote:

 Hi:
 Check This!

   
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/pgsql pgsql.c php_pgsql.h

2001-02-13 Thread Thies C. Arntzen

thies   Tue Feb 13 10:28:25 2001 EDT

  Modified files:  
/php4/ext/pgsql pgsql.c php_pgsql.h 
  Log:
  @- PostgreSQL now does a rollback at the end of a request on every 
  @  persistent connection. This is done by doing an "empty" transaction
  @  on the connection (This was advised by someone from the PostgreSQL
  @  core-team). If you leave transactions open on your page you will see a
  @  "NOTICE:  BEGIN: already a transaction in progress" message in your 
  @  apache error_log. This message is created by the PostgreSQL libs - we can
  @  do nothing about it. (Thies)
  
  
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.86 php4/ext/pgsql/pgsql.c:1.87
--- php4/ext/pgsql/pgsql.c:1.86 Tue Feb 13 08:54:48 2001
+++ php4/ext/pgsql/pgsql.c  Tue Feb 13 10:28:24 2001
@@ -17,7 +17,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.86 2001/02/13 16:54:48 thies Exp $ */
+/* $Id: pgsql.c,v 1.87 2001/02/13 18:28:24 thies Exp $ */
 
 #include stdlib.h
 
@@ -93,7 +93,7 @@
PHP_MINIT(pgsql),
PHP_MSHUTDOWN(pgsql),
PHP_RINIT(pgsql),
-   NULL,
+   PHP_RSHUTDOWN(pgsql),
PHP_MINFO(pgsql),
STANDARD_MODULE_PROPERTIES
 };
@@ -145,7 +145,30 @@
PGG(num_links)--;
 }
 
+static int _rollback_transactions(zend_rsrc_list_entry *rsrc)
+{
+   PGconn *link = (PGconn *)rsrc-ptr;
+   /*
+   PGresult *pg_result;
+   ExecStatusType status;
+   */
+
+   PQexec(link,"BEGIN;ROLLBACK;");
+
+   /* maybe do error handling later
+   pg_result = PQexec(link,"BEGIN;ROLLBACK;");
+   
+   if (pg_result) {
+   status = PQresultStatus(pg_result);
+   } else {
+   status = (ExecStatusType) PQstatus(link);
+   }
+   */
+
+   return 0;
+}
 
+
 static void _free_ptr(zend_rsrc_list_entry *rsrc)
 {
pgLofp *lofp = (pgLofp *)rsrc-ptr;
@@ -213,7 +236,15 @@
return SUCCESS;
 }
 
+PHP_RSHUTDOWN_FUNCTION(pgsql)
+{
+   zend_hash_apply(EG(persistent_list),_rollback_transactions);
+
+   return SUCCESS;
+}
+
 
+
 PHP_MINFO_FUNCTION(pgsql)
 {
char buf[32];
@@ -490,6 +521,8 @@
}

ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", 
le_link, le_plink);
+
+   printf("\npg_close %d\n",id);
 
if (id==-1) { /* explicit resource number */
zend_list_delete(Z_RESVAL_PP(pgsql_link));
Index: php4/ext/pgsql/php_pgsql.h
diff -u php4/ext/pgsql/php_pgsql.h:1.24 php4/ext/pgsql/php_pgsql.h:1.25
--- php4/ext/pgsql/php_pgsql.h:1.24 Thu Jan 18 14:17:05 2001
+++ php4/ext/pgsql/php_pgsql.h  Tue Feb 13 10:28:24 2001
@@ -17,7 +17,7 @@
+--+
  */
  
-/* $Id: php_pgsql.h,v 1.24 2001/01/18 22:17:05 derick Exp $ */
+/* $Id: php_pgsql.h,v 1.25 2001/02/13 18:28:24 thies Exp $ */
 
 #ifndef PHP_PGSQL_H
 #define PHP_PGSQL_H
@@ -48,6 +48,7 @@
 PHP_MINIT_FUNCTION(pgsql);
 PHP_MSHUTDOWN_FUNCTION(pgsql);
 PHP_RINIT_FUNCTION(pgsql);
+PHP_RSHUTDOWN_FUNCTION(pgsql);
 PHP_MINFO_FUNCTION(pgsql);
 PHP_FUNCTION(pg_connect);
 PHP_FUNCTION(pg_pconnect);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] XML Parsing through Proxy

2001-02-13 Thread Steve Haemelinck

Hi Anybody got an idea?

I am sitting behind a proxy and I want to able to parse an XML.
So I have to use fsockopen() to get through my firewall and get the page.
So far, everything goes wel, but I am not able to parse the file, because I
think it is not in XML format if I use "GET http:// "
Does anyone has an idea how I can solve this?

My code so far (bits and pieces of anywhere :) )


Steve


?php

#
#   Parse XML through Proxy   #
#

// Define Variables

# Proxy Settings
$proxy_ip="proxy.server.be";
$proxy_port=8080;

# XML Mapping
$map_array = array(
"NASDAQAMEX-DOT-COM" = "HEADER_TAG",
"ISSUE-NAME" = "STOCK_NAME",
"LAST-SALE-PRICE" = "LAST_SALE",
"PREVIOUS-CLOSE-PRICE" = "PREVIOUS_SALE",
"NET-CHANGE-PRICE" = "CHANGE",
"NET-CHANGE-PCT" = "CHANGE_PCT",
"TODAYS-HIGH-PRICE" = "TODAYS_HIGH",
"TODAYS-LOW-PRICE" = "TODAYS_LOW",
);

# XML File to Parse
$xmlFile_Location="http://quotes.nasdaq.com/quote.dll?page=xmlmode=stocksy
mbol=NETA";


// Functions

# StartElement Of Parser
function startElement($parser, $name, $attrs=''){
global $map_array, $temp, $current_tag;

$current_tag = $name;
if ($format = $map_array[$name]){
switch($name){
case 'NASDAQAMEX-DOT-COM':
//echo $HTTP_GET_VARS['ticker'];
break;
default:
break;
}
}
}

# EndElement Of Parser
function endElement($parser, $name, $attrs=''){
global $map_array, $temp, $current_tag;

if ($format = $map_array[$name]){
switch($name){
case 'NASDAQAMEX-DOT-COM':
return_page($temp);
$temp = '';
break;
default:
break;
}
}
}

# Process the Data between XML-Tags
function characterData($parser, $data){
global $current_tag, $temp, $catID;

switch($current_tag){
case 'ISSUE-NAME':
$temp['STOCK_NAME'] = $data;
$current_tag = '';
break;
case 'LAST-SALE-PRICE':
$temp['LAST_SALE'] = $data;
$current_tag = '';
break;
default:
break;
}
}

# Create the XML Parser and set options
$type="UTF-8";
$xml_parser = xml_parser_create($type);
xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true);
xml_set_element_handler($xml_parser, 'startElement','endElement');
xml_set_character_data_handler($xml_parser, 'characterData');

/* Open a connection through Proxy with Nasdaq and start parsing */
$sockPointer = fsockopen($proxy_ip,$proxy_port, $errNo, $errStr,30);
//Connect to Proxy

if( !$sockPointer ){
echo "$errStr Proxy not Available \n\n";
exit();
}
else{
fputs($sockPointer,"GET $xmlFile_Location/ ?xml version=\"1.0\"
?\n\n");
while (!feof($sockPointer)){
$Data = fgets($sockPointer, 10);
$tag= "?xml version=\"1.0\" ?\n\n";
if( eregi("xml version",$Data) ){
$Parse=1;
}
if($Parse==1){
if (!($Data = utf8_encode($Data))){
echo 'ERROR'."\n";
}
if (!xml_parse($xml_parser, $Data, feof($sockPointer))){
die(sprintf( "XML error: %s at line %d\n\n",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
}
}
fclose($sockPointer);
}

xml_parser_free($xml_parser);

?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] OOP in web development

2001-02-13 Thread Kath

I find the ability to write something once (say a mysql_connect();
statement) and be able to run it on any page just with $db-connect(); is
pretty cool.

While that may not seem cool, if you some day change a a PHP statement that
exists on many pages, this lets you change it in one place, instead of
having to copy it to dozens of other places.

Also, what happens if you change your database password and now need to
change a bunch of pages to have the new password?

Problem solved in OOP, because the vars are all in the same file.

- Kath, a recent converter to OOP, but enjoying every minute of it!

- Original Message -
From: "Joe Sheble (Wizaerd)" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 11:41 AM
Subject: [PHP] OOP in web development


 I've been using PHP for over a year now and have been successfully running
 three different websites developed with PHP, but I've never done anything
 with classes or objects.  Even when returning data from a mySQL database,
I
 use mysql_fetch_array() instead of mysql_fetch_object().

 What am I missing by not using objects and classes, other than
 reusability?  What are the real benefits to using OOPs in PHP?


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] parse speed vs require speed

2001-02-13 Thread Soma Interesting


I'm wondering if I should organize the functions for my project into a 
single large file and have only one include/require, or break the code out 
into separate function library files and use a number of includes/requires.

With a single large function library I'm guessing PHP would parse this 
every time a page is called. So I could loose some overhead by separating 
my database functions into one file, my administration functions into 
another, my presentation functions into another, etc... then only including 
the function pages necessary - likely cutting the amount of code being 
parsed in half for any given page.

But then I begin wondering about the speed of making a require() to each of 
these files. maybe three to five requires per page.

Lastly, what about caching or compiling the function libraries so they're 
not being parsed each time?

Any advice on this?


-  -  -  -  -  -  - 
  -  -  -  -
WARNING: Some experts believe that use of any keyboard may cause
serious injury. Consult Users Guide.
   
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] OOP in web development

2001-02-13 Thread Mark Maggelet

On Tue, 13 Feb 2001 15:11:46 -0500, Kath ([EMAIL PROTECTED]) wrote:
I find the ability to write something once (say a mysql_connect();
statement) and be able to run it on any page just with $db-
connect(); is
pretty cool.

While that may not seem cool, if you some day change a a PHP
statement that
exists on many pages, this lets you change it in one place, instead
of
having to copy it to dozens of other places.

Also, what happens if you change your database password and now need
to
change a bunch of pages to have the new password?

Problem solved in OOP, because the vars are all in the same file.

You don't need OOP to keep your database connections in a separate
file.  You can either use classes or not but it's really just about
style.




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Image in a Template

2001-02-13 Thread Gary

Hi All,
  I am writing a catalog and shopping cart. Our clients want a image on 
the page for the product. The page is a template generated on the fly. I 
could put the images in the db and call it from there, but I don't like 
doing that. Is there another  way to put the pic on the page?

TIA
Gary


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Image in a Template

2001-02-13 Thread Andrew

Gary,

Put the path to the pic in the database, and the pic in the filesystem.

Ususally much faster, unless you have a very large number of pics in a
folder.

regards,
andrew


 -Original Message-
 From: Gary [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, February 13, 2001 3:25 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Image in a Template


 Hi All,
   I am writing a catalog and shopping cart. Our clients want a image on
 the page for the product. The page is a template generated on the fly. I
 could put the images in the db and call it from there, but I don't like
 doing that. Is there another  way to put the pic on the page?

 TIA
 Gary


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Image in a Template

2001-02-13 Thread John Huggins

In my humble opinion, I would place the actual images in your web directory
and put the file names into the database so build your image tags.

Sure the db can store the actual image data, but I really believe that the
filesystem is the better medium for the raw files.

Name the image relating to the product ID to keep the many files organized
and unique.

My two cents.

 -Original Message-
 From: Gary [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, February 13, 2001 3:25 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Image in a Template


 Hi All,
   I am writing a catalog and shopping cart. Our clients want a image on
 the page for the product. The page is a template generated on the fly. I
 could put the images in the db and call it from there, but I don't like
 doing that. Is there another  way to put the pic on the page?

 TIA
 Gary


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   3   >