php-general Digest 3 Apr 2001 10:12:44 -0000 Issue 605 Topics (messages 46688 through 46793): Re: HTTP Upload Problem 46688 by: Phillip Bow 46689 by: Yev 46691 by: Yev Re: Porting ASP code to PHP 46690 by: Lindsay Adams 46712 by: Michael Stearne Moderated Guestbook 46692 by: John Monfort Re: uploading 46693 by: Yev Re: nl2br 46694 by: Dan Lowe 46793 by: Christian Reiniger newbie@session - please help! 46695 by: David Tandberg-Johansen Re: [PHP-DB] help with compiling ODBC into PHP4 46696 by: Daevid Vincent 46698 by: Andrew Hill How to limit a WHILE statement? 46697 by: Bob Stone 46699 by: Johnson, Kirk 46700 by: Jerry Lake 46701 by: Lindsay Adams 46702 by: Jason Lotito 46703 by: CC Zona 46713 by: Stephan Ahonen Metabase Opinions 46704 by: Jason Lotito changing image size 46705 by: Joseph Bannon 46707 by: Rasmus Lerdorf PHP, MYSQL & multiple records 46706 by: Curtis 46710 by: Lindsay Adams Help running PHP on Apache and Windows 98 46708 by: Dimonekene Ditutala 46709 by: Julie Meloni Warning: 1 is not a valid File-Handle resource 46711 by: Richard Kurth 46714 by: Lindsay Adams 46740 by: Richard Kurth 46753 by: WK 46754 by: WK making cgi and apache module simultaneously? 46715 by: Daevid Vincent Hosting for FREE?? 46716 by: Frank K 46733 by: Richard Lynch 46735 by: Andrew Halliday problems with session_register()... 46717 by: Christian Dechery using system() on NT/2K 46718 by: Christian Dechery Re: fopen with URL gives me a problem 46719 by: Richard Lynch Re: Let the Server do the downloading 46720 by: Richard Lynch 46736 by: Lindsay Adams Re: How to jump 7 rows in array 46721 by: Richard Lynch Re: PHP and MySQL insert problem 46722 by: Richard Lynch Re: Finding linefeeds in Strings 46723 by: Richard Lynch Re: environment variable, why does it not work? 46724 by: Richard Lynch Re: renaming form posted variable names 46725 by: Richard Lynch 46761 by: David Minor Re: urgent,configure-problems 46726 by: Richard Lynch Re: strip_tags() 46727 by: Richard Lynch Re: Error during session_start - is this a bug? 46728 by: Richard Lynch Re: How to eliminate bad fields from a mysql query? 46729 by: Richard Lynch Re: mail() and a Data format error 46730 by: Richard Lynch Re: suppressing error messages 46731 by: Richard Lynch Re: libphp3.so 46732 by: Richard Lynch Re: why some dll's don't work 46734 by: Richard Lynch Re: Why does it work this way? 46737 by: Yasuo Ohgaki PHP, MYSQL and Multiple Records revisited 46738 by: Curtis 46758 by: Lindsay Adams SQL : multiple SELECT and missing rows. 46739 by: Maxim Maletsky 46743 by: Steve Werby Re: is this syntax correct? 46741 by: Yasuo Ohgaki socket functions 46742 by: Joseph Blythe Re: multiple SELECT and missing rows. 46744 by: Rolf Hopkins PHP4.0.4 segfaults with odbc_pconnect 46745 by: Daevid Vincent Please Help! 46746 by: E K L 46747 by: KPortsmout.aol.com 46748 by: Steve Werby 46749 by: Samantha Savvakis Re: [PHP-DB] PHP4.0.4 segfaults with odbc_pconnect 46750 by: Andrew Hill Re: mod_auth_mysql 2.20 won't compile with newer Apache and alloc.h vs ap_alloc.h 46751 by: Dennis Moore 46752 by: Daevid Vincent hosting - key issues 46755 by: Michael Roark 46776 by: B. van Ouwerkerk form-based search 46756 by: Joao Monteiro 46777 by: B. van Ouwerkerk updating values in a while statement 46757 by: Peter Houchin 46760 by: Lindsay Adams Re: libpng error 46759 by: nicuc.ac.jp Safety with PHP. 46762 by: Marthe Kristiansen 46763 by: Rasmus Lerdorf 46764 by: Jack Dempsey 46765 by: Marthe Kristiansen 46766 by: Rasmus Lerdorf 46767 by: Jason Lotito 46768 by: Marthe Kristiansen 46769 by: Jason Lotito 46770 by: Brian Clark 46771 by: Les Neste 46783 by: nicuc.ac.jp ctype_alpha etc 46772 by: Les Neste 46773 by: Brian Clark Informix 46774 by: Roman foreach in Apache 46775 by: the clansman 46778 by: Jason Murray redirecting without headers or meta tags or javascript 46779 by: Justin French 46781 by: Jack Dempsey Re: array_diff usage 46780 by: Stig Venaas Re: File upload via HTML forms 46782 by: \[Intent A/S\] Tais M. Hansen 46784 by: \[Intent A/S\] Tais M. Hansen Validation Email in PHP programs 46785 by: Sharat Hegde working with jpegs 46786 by: J.R. Lillard Re: known problems with session_register()? 46787 by: Yasuo Ohgaki 46790 by: Felix Kronlage 46791 by: Yasuo Ohgaki Cobalt RaQ XTR(slightly OT) 46788 by: Phil Driscoll Re: PHP3 - Instalation 46789 by: David Robley Re: Can php read and than print file like it is 46792 by: Christian Reiniger Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
I suspect there is a limit on the MAX_FILE_SIZE. You might want to check the RFC, but I suspect you should set the value to be 2gb or less(I think that is the limit). -- phill "Yev" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > OK, here's my problem > I wrote a simple upload script: > > <? > print_r($HTTP_POST_FILES); > ?> > > <FORM ENCTYPE="multipart/form-data" ACTION="" METHOD=POST> > <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="100000000000000000"> > File: <INPUT TYPE=file name=filename size=30> > <INPUT TYPE="submit" VALUE="submit"> > </FORM> > > > I purposely specified MAX_FILE_SIZE to be big since I heard it causes > problems if it's too small: ie files get rejected no matter what. > > If I input any file, the $HTTP_POST_FILES shows the proper stuff, but > the file doesn't exist in "/tmp" (which is set in php.ini), if I leave > the file field empty, then a /tmp/phpXXXXXX file is created with a 0 > byte size. > > What can be the problem? It's not permissions.. > > Yev > > __________________________________________________ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.yahoo.com/?.refer=text > > -- > 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] >
Just set it to 100000, and same thing.. in my php.ini file it's set to 2M upload_max_filesize = 2M still clueless, Yev --- Phillip Bow <[EMAIL PROTECTED]> wrote: > I suspect there is a limit on the MAX_FILE_SIZE. You might want to > check > the RFC, but I suspect you should set the value to be 2gb or less(I > think > that is the limit). > -- > phill > > "Yev" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > OK, here's my problem > > I wrote a simple upload script: > > > > <? > > print_r($HTTP_POST_FILES); > > ?> > > > > <FORM ENCTYPE="multipart/form-data" ACTION="" METHOD=POST> > > <INPUT TYPE="hidden" name="MAX_FILE_SIZE" > value="100000000000000000"> > > File: <INPUT TYPE=file name=filename size=30> > > <INPUT TYPE="submit" VALUE="submit"> > > </FORM> > > > > > > I purposely specified MAX_FILE_SIZE to be big since I heard it > causes > > problems if it's too small: ie files get rejected no matter what. > > > > If I input any file, the $HTTP_POST_FILES shows the proper stuff, > but > > the file doesn't exist in "/tmp" (which is set in php.ini), if I > leave > > the file field empty, then a /tmp/phpXXXXXX file is created with a > 0 > > byte size. > > > > What can be the problem? It's not permissions.. > > > > Yev > > > > __________________________________________________ > > Do You Yahoo!? > > Get email at your own domain with Yahoo! Mail. > > http://personal.mail.yahoo.com/?.refer=text > > > > -- > > 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] > __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/?.refer=text
Josh, Thanks, but still no luck.. Same problems Yev --- Josh <[EMAIL PROTECTED]> wrote: > Change upload_max_filesize in php.ini to 2048000 (which is 2 megs). > PHP > does not understand 2M. > > Josh > > -----Original Message----- > From: Yev [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 02, 2001 6:02 PM > To: Phillip Bow; [EMAIL PROTECTED] > Subject: Re: [PHP] HTTP Upload Problem > > > Just set it to 100000, and same thing.. > in my php.ini file it's set to 2M > > upload_max_filesize = 2M > > still clueless, > Yev > > --- Phillip Bow <[EMAIL PROTECTED]> wrote: > > I suspect there is a limit on the MAX_FILE_SIZE. You might want to > > check > > the RFC, but I suspect you should set the value to be 2gb or less(I > > think > > that is the limit). > > -- > > phill > > > > "Yev" <[EMAIL PROTECTED]> wrote in message > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > OK, here's my problem > > > I wrote a simple upload script: > > > > > > <? > > > print_r($HTTP_POST_FILES); > > > ?> > > > > > > <FORM ENCTYPE="multipart/form-data" ACTION="" METHOD=POST> > > > <INPUT TYPE="hidden" name="MAX_FILE_SIZE" > > value="100000000000000000"> > > > File: <INPUT TYPE=file name=filename size=30> > > > <INPUT TYPE="submit" VALUE="submit"> > > > </FORM> > > > > > > > > > I purposely specified MAX_FILE_SIZE to be big since I heard it > > causes > > > problems if it's too small: ie files get rejected no matter what. > > > > > > If I input any file, the $HTTP_POST_FILES shows the proper stuff, > > but > > > the file doesn't exist in "/tmp" (which is set in php.ini), if I > > leave > > > the file field empty, then a /tmp/phpXXXXXX file is created with > a > > 0 > > > byte size. > > > > > > What can be the problem? It's not permissions.. > > > > > > Yev > > > > > > __________________________________________________ > > > Do You Yahoo!? > > > Get email at your own domain with Yahoo! Mail. > > > http://personal.mail.yahoo.com/?.refer=text > > > > > > -- > > > 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] > > > > > __________________________________________________ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.yahoo.com/?.refer=text > > -- > 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] > > __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/?.refer=text
And, to get you started (and maybe done in no time flat) in your port, check out this! http://freshmeat.net/projects/asp2php/ No, didn't write, but I used it on a small web app once. Worked like a charm. Your mileage may vary, depending on complexity. But as long as you back up all your code, what could it hurt? On 4/2/01 2:03 PM, "Michael Stearne" <[EMAIL PROTECTED]> wrote: > > The thing that will make PHP look the best right now is to get the > application running in it as soon as possible. If it's quickest to move > the variables to $variables and leave all the business logic how it was > under ASP, then that will help your PHP case the most. Once the code is > simply converted to PHP you will probably see no great increase or > decrease in performance, but the code will be in PHP and you will be > using the "platform". At that point you can start using PHP's abilities > and functions in a better way to continually increase the performance of > the app. If this application was well designed in the first place, it > will run fine in PHP. > > On Monday, April 2, 2001, at 04:37 PM, Mike King wrote: >> >> a) produce a much better application > > The application that is running and showing results to the managers is > the best application. You could write the tightest code in the world, > but if no one can use it, it's not the best. Mozilla is an > extraordinary program, but until people can get a stable version in > their hands, IE continues to gain market share. > > Your PHP app may be amazing when it is finished, but they already had an > ASP version that was finished and performing adequately. This will make > PHP look worse as time goes on. > >> b) take less development time > > If you're starting with a decently designed app already, I can't see how > starting from scratch could be faster. > >> c) cause less bugs > > Maybe, but that's what version 2.0 is for! > >> d) create a more efficient system >> > > Again that can come over time, get it to PHP first and then make it run > better, > > Michael >
On Monday, April 2, 2001, at 05:53 PM, Mike King wrote: > > > Michael Stearne wrote: >> >> get the application running in it as soon as possible. >> >> Maybe, but that's what version 2.0 is for! >> >> >> Again that can come over time, get it to PHP first and then make it run >> better, > > So your solution is to write/port a crappy application, I said a couple of times that I assumed that the application was designed well. The "crappyness" of an application has nothing to do with the language it is in. Is it a good application or not? If you have the same people that wrote the application write it again in a "better" language and the design was crap, the application will still be crap. > then spend time > fixing/supporting it? What you think you won't be fixing and supporting a PHP application if it is design poorly? > I hate developers who take this philosophy. > Do you want to use PHP or not? What is more important, to use PHP or re-write the application? If it is more important to re-write the app with a cleaner implementation then I have a feeling your senior programmer (who has NO PHP experience) would just assume go make a version 2 in ASP because that is what he is familiar with. I doubt you will get PHP and a complete rewrite. Choose your battles. Michael
Hello everyone, I'm looking for a guestbook script that lets you moderate the new entries, before they are posted. Do you know any? PHP or Perl. Please let me know. __________John Monfort_________________ _+-----------------------------------+_ P E P I E D E S I G N S www.pepiedesigns.com "The world is waiting, are you ready?" -+___________________________________+-
Thank you!!! That fixed it. Best Regards, Yev --- Bill Rausch <[EMAIL PROTECTED]> wrote: > I think your script (where you have the print_r() call) has to copy > or move > the file to a permanent location as Apache and/or PHP discards it > once your > script exits. > > --- > Bill Rausch, Software Development, Unix, Mac, Windows > Numerical Applications, Inc. 509-943-0861 [EMAIL PROTECTED] __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/?.refer=text
Previously, Boget, Chris said: > > In PHP there is an instruction : nl2br . > > Does anybody know if there is something similar in Perl??? > > I think this syntax is correct... it's been a while... > $string =~ /\\n/\<br\>/g That would match a backslash followed by the letter 'n'... also the leading 's' operator is missing. $string =~ s/\n/<br>/g; Quoting the < and > is not necessary, although it doesn't make a difference in this case. I didn't quote them because there wasn't a need to. -dan -- Dan Lowe <[EMAIL PROTECTED]> http://tangledhelix.com/ Politics is the art of looking for trouble, finding it whether it exists or not, and applying the wrong remedy. -Ernest Benn
On Tuesday 03 April 2001 01:42, you wrote: > Hello > > In PHP there is an instruction : nl2br . > Does anybody know if there is something similar in Perl??? Well, you'd think Perl experts would know this a bit better that PHP experts, hm? -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Never doubt that a small group of thoughtful, committed people can change the world... Indeed, it's the only thing that ever has." - Margaret Mead
Hello! After confering with the this group earlier I got some hints on where to find som tutorials on sessions. But I am still confused about some things. Have I under stood it right: #session.php <? if (!$PHPSESSID) { session_start(); #Then if some variables to register session_register(lang); session_register(name); setcookie (PHPSESSID, $PHPSESSID,time()+3600); setcookie (lang, $lang,time()+3600); setcookie (name, $name,time()+3600); } elseif ($PHPSESSID) { #I DON'T HAVE A CLUE TODO HERE, ANY HINTS? } ?> #END session.php And then I include the session.php in all the files I need to use session in? And I can get the variables from the cookie? David
Okay, don't ask me how, but for whatever reason, this "partially worked": "./configure --with-openlink=/usr/local/openlink/odbcsdk --with-mysql=/usr/l ocal --with-apache=../apache" however, now I get a different error: In file included from internal_functions.c:38: /usr/src/WT_Apache_Setup/php/ext/odbc/php_odbc.h:125: iodbc.h: No such file or directory In file included from internal_functions.c:38: /usr/src/WT_Apache_Setup/php/ext/odbc/php_odbc.h:128: udbcext.h: No such file or directory make[2]: *** [internal_functions.lo] Error 1 make[2]: Leaving directory `/data/usr/src/WT_Apache_Setup/php-4.0.4/main' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/data/usr/src/WT_Apache_Setup/php-4.0.4/main' make: *** [all-recursive] Error 1 I've done a 'locate iodbc.h' and don't have one. [root=pts/1]3:34pm@content:{/usr/src/WT_Apache_Setup/php}> locate udbcext.h /usr/local/openlink/odbcsdk/include/udbcext.h /usr/local/openlink/udbcsdk/include/udbc/udbcext.h does however exist despite that error message. just for fun I tried: "./configure --with-openlink=/usr/local/openlink --with-mysql=/usr/local --w ith-apache=../apache" (notice the 'odbcsdk' is not in the path) and get a simmilar error: In file included from internal_functions.c:38: /usr/src/WT_Apache_Setup/php/ext/odbc/php_odbc.h:125: iodbc.h: No such file or directory In file included from /usr/src/WT_Apache_Setup/php/ext/odbc/php_odbc.h:128, from internal_functions.c:38: /usr/local/openlink/odbcsdk/include/udbcext.h:47: warning: `SQL_LEN_DATA_AT_EXEC' redefined /usr/local/openlink/odbcsdk/include/sqlext.h:250: warning: this is the location of the previous definition make[2]: *** [internal_functions.lo] Error 1 make[2]: Leaving directory `/data/usr/src/WT_Apache_Setup/php-4.0.4/main' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/data/usr/src/WT_Apache_Setup/php-4.0.4/main' make: *** [all-recursive] Error 1 thank you for your continued help. > -----Original Message----- > From: Daevid Vincent [mailto:[EMAIL PROTECTED]] > Sent: Saturday, March 31, 2001 12:56 PM > To: Andrew Hill; [EMAIL PROTECTED]; PHP General > Subject: RE: [PHP-DB] RE: [PHP] RE: what exactly are /path/to/blah > lookingfor? .h? .so? .a? what?! > > > I get the "No such file or directory" right after the "license > box" shows up > in the PHP4 compile. Like this (no matter what directory I've > tried in that > big old list so far): > > ./WTConfigure: --with-openlink=/usr/local/openlink/lib: No such file or > directory > > "./WTConfigure" is just a shell script with make clean, all my --options, > make, make install, since I have to compile in mysql, and some > other stuff. > > > -----Original Message----- > > From: Andrew Hill [mailto:[EMAIL PROTECTED]] > > Sent: Friday, March 30, 2001 4:00 PM > > To: Daevid Vincent; [EMAIL PROTECTED]; PHP General > > Subject: Re: [PHP-DB] RE: [PHP] RE: what exactly are /path/to/blah > > lookingfor? .h? .so? .a? what?! > > > > > > Daevid, > > > > just --with-iodbc or --with-openlink is fine. > > > > you should be using either: > > > > --with-iodbc=/usr/local/openlink/odbcsdk \ > > or > > --with-openlink=/usr/local/openlink/lib \ > > > > depending on which you use and where you installed the sdk. > > what error are you getting? > > > > Best regards, > > Andrew > > > > > > On 3/30/01 6:54 PM, "Daevid Vincent" <[EMAIL PROTECTED]> wrote: > > > > > thanks for replying Andrew, but that's not working for me either. > > > > > > Also, do I need both "--with-iodbc" and "--with-openlink" or do > > I just need > > > one of them? > > > > > > These are the instructions I've been following: > > > http://www.iodbc.org/odbc-phpHOWTO.html > > > > > > so now I've tried: > > > > > > #--with-iodbc=/usr/local/openlink/odbcsdk/lib \ > > > #--with-iodbc=/usr/local/openlink/odbcsdk \ > > > #--with-iodbc=/usr/local/openlink/lib \ > > > #--with-iodbc=/usr/local/bin \ > > > #--with-iodbc=/usr/local \ > > > #--with-iodbc=/usr/local/include \ > > > #--with-iodbc=../libiodbc \ > > > #--with-openlink=/usr/local/openlink/odbcsdk/lib \ > > > #--with-openlink=/usr/local/openlink/odbcsdk \ > > > #--with-openlink=/usr/local/openlink \ > > > #--with-openlink=/usr/local/openlink/lib \ > > > > > > here is my dir structure: > > > the files are there, why won't PHP see them? In fact I have the > > > "libiodbc.so" library in TWO places I see: "openlink/lib/" and > > > "openlink/odbcsdk/lib/" > > > > > > [root=pts/1]3:45pm@content:{/usr/local/openlink}> ll -r > > > /usr/local/openlink/* > > > -rw-rw-rw- 1 nobody html 0 Mar 29 20:20 > > > /usr/local/openlink/oplrqb.ini > > > -rwxr-xr-x 1 nobody html 707 Mar 30 15:16 > > > /usr/local/openlink/openlink.sh* > > > -rwxr-xr-x 1 nobody html 619 Mar 30 15:16 > > > /usr/local/openlink/openlink.csh* > > > -rw-rw-rw- 1 nobody html 180 Mar 29 20:21 > > > /usr/local/openlink/odbcinst.ini > > > -rw-rw-rw- 1 nobody html 541 Mar 30 13:51 > > > /usr/local/openlink/odbc.ini > > > -rw-rw-rw- 1 nobody html 196347 Mar 29 17:54 > > > /usr/local/openlink/l2oczzzz.taz > > > -rw-rw-rw- 1 nobody html 364085 Mar 30 15:16 > > > /usr/local/openlink/l2kuzzzz.taz > > > -rw-rw-rw- 1 nobody html 512218 Mar 30 15:16 > > > /usr/local/openlink/l2kozzzz.taz > > > -rwxrwxrwx 1 nobody html 16137 Mar 30 15:16 > > > /usr/local/openlink/install.sh* > > > > > > /usr/local/openlink/udbcsdk: > > > total 16 > > > drwxr-xr-x 2 nobody html 4096 Mar 7 14:44 lib/ > > > drwxr-xr-x 3 nobody html 4096 Mar 7 14:44 include/ > > > drwxr-xr-x 2 nobody html 4096 Mar 7 14:44 examples/ > > > drwxr-xr-x 2 nobody html 4096 Mar 7 14:44 doc/ > > > > > > /usr/local/openlink/lib: > > > total 400 > > > -rw-r--r-- 1 nobody html 272057 Mar 7 14:43 > oplodbc.so.1.0.0 > > > lrwxrwxrwx 1 nobody html 16 Mar 30 15:16 > oplodbc.so.1 -> > > > oplodbc.so.1.0.0 > > > lrwxrwxrwx 1 nobody html 16 Mar 30 15:16 oplodbc.so -> > > > oplodbc.so.1.0.0 > > > -rw-r--r-- 1 nobody html 678 Mar 7 14:43 oplodbc.la > > > lrwxrwxrwx 1 nobody html 17 Mar 30 15:16 libodbc.so -> > > > libiodbc.so.2.1.2* > > > -rwxr-xr-x 1 nobody html 117877 Mar 7 14:43 > > libiodbc.so.2.1.2* > > > lrwxrwxrwx 1 nobody html 17 Mar 30 15:16 > libiodbc.so.2 -> > > > libiodbc.so.2.1.2* > > > lrwxrwxrwx 1 nobody html 17 Mar 30 15:16 libiodbc.so -> > > > libiodbc.so.2.1.2* > > > -rwxr-xr-x 1 nobody html 669 Mar 7 14:43 libiodbc.la* > > > > > > /usr/local/openlink/bin: > > > total 140 > > > -rw------- 1 nobody html 29 Mar 30 15:16 oplrqb.ini > > > -rwxr-xr-x 1 nobody html 92225 Mar 7 14:43 odbctest* > > > -rw-r--r-- 1 nobody html 170 Mar 7 14:43 > > odbcinst.ini.sample > > > -rw-r--r-- 1 nobody html 170 Mar 7 14:43 odbcinst.ini > > > -rw-r--r-- 1 nobody html 473 Mar 7 14:43 > odbc.ini.sample > > > -rw-r--r-- 1 nobody html 473 Mar 7 14:43 odbc.ini > > > -rwxr--r-- 1 nobody html 23260 Mar 7 14:43 inifile* > > > > > > /usr/local/openlink/odbcsdk: > > > total 20 > > > drwxr-xr-x 2 nobody html 4096 Mar 30 15:16 lib/ > > > drwxr-xr-x 2 nobody html 4096 Mar 30 15:16 include/ > > > drwxr-xr-x 2 nobody html 4096 Mar 30 15:16 examples/ > > > drwxr-xr-x 2 nobody html 4096 Mar 30 15:16 driver/ > > > drwxr-xr-x 2 nobody html 4096 Mar 30 15:16 doc/ > > > > > > and then here is the odbcsdk directory tree: > > > > > > [root=pts/1]3:51pm@content:{/usr/local/openlink}> ll -r odbcsdk/* > > > odbcsdk/lib: > > > total 976 > > > -rw-r--r-- 1 nobody html 272057 Mar 7 14:42 > oplodbc.so.1.0.0 > > > lrwxrwxrwx 1 nobody html 16 Mar 30 15:16 > oplodbc.so.1 -> > > > oplodbc.so.1.0.0 > > > lrwxrwxrwx 1 nobody html 16 Mar 30 15:16 oplodbc.so -> > > > oplodbc.so.1.0.0 > > > -rw-r--r-- 1 nobody html 678 Mar 7 14:42 oplodbc.la > > > -rw-r--r-- 1 nobody html 431992 Mar 7 14:42 oplodbc.a > > > -rwxr-xr-x 1 nobody html 117877 Mar 7 14:42 > > libiodbc.so.2.1.2* > > > lrwxrwxrwx 1 nobody html 17 Mar 30 15:16 > libiodbc.so.2 -> > > > libiodbc.so.2.1.2* > > > lrwxrwxrwx 1 nobody html 17 Mar 30 15:16 libiodbc.so -> > > > libiodbc.so.2.1.2* > > > -rwxr-xr-x 1 nobody html 669 Mar 7 14:42 libiodbc.la* > > > -rw-r--r-- 1 nobody html 143692 Mar 7 14:42 libiodbc.a > > > > > > odbcsdk/include: > > > total 136 > > > -rw-r--r-- 1 nobody html 11973 Mar 7 14:42 udbcext.h > > > -rw-r--r-- 1 nobody html 6362 Mar 7 14:42 sqltypes.h > > > -rw-r--r-- 1 nobody html 67955 Mar 7 14:42 sqlext.h > > > -rw-r--r-- 1 nobody html 28728 Mar 7 14:42 sql.h > > > -rw-r--r-- 1 nobody html 1161 Mar 7 14:42 isqltypes.h > > > -rw-r--r-- 1 nobody html 1158 Mar 7 14:42 isqlext.h > > > -rw-r--r-- 1 nobody html 1140 Mar 7 14:42 isql.h > > > > > > odbcsdk/examples: > > > total 112 > > > -rw-r--r-- 1 nobody html 10321 Mar 7 14:42 odbctest.c > > > -rwxr-xr-x 1 nobody html 92225 Mar 7 14:42 odbctest* > > > -rw-r--r-- 1 nobody html 3460 Mar 7 14:42 Makefile > > > > > > odbcsdk/driver: > > > total 124 > > > -rw-r--r-- 1 nobody html 119187 Mar 7 14:42 odbc_src.taz > > > > > > odbcsdk/doc: > > > total 16 > > > -rw-r--r-- 1 nobody html 773 Mar 7 14:42 odbcinst.ini > > > -rw-r--r-- 1 nobody html 1010 Mar 7 14:42 odbc.ini > > > -rw-r--r-- 1 nobody html 5127 Mar 7 14:42 odbc.doc > > > > > > > > >> -----Original Message----- > > >> From: Andrew Hill [mailto:[EMAIL PROTECTED]] > > >> Sent: Friday, March 30, 2001 2:57 PM > > >> To: Daevid Vincent; [EMAIL PROTECTED]; PHP General > > >> Subject: [PHP] RE: what exactly are /path/to/blah looking > for? .h? .so? > > >> .a? what?! > > >> > > >> > > >> Daevid, > > >> > > >> It's the path/to/odbcsdk > > >> It's looking for libiodbc.so > > >> > > >> :) > > >> > > >> Best regards, > > >> Andrew > > > > > > > > -- > PHP Database 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] >
Daevid, You shouldn't need iodbc.h, just odbc.h - until I can compare what is each SDK distribution, just create a symbolic link of iodbc.h pointing to odbc.h udbcext.h is in our iODBC SDK - you should have that. Here is the linux glibc2.1.1 version: http://www.openlinksw.com/software/open40/l3kozzzz.taz (also available from iODBC.org). If you need other platforms, go to: http://www.iodbc.org/opliodbc.htm (iODBC) or http://www.openlinksw.com/main/softdld.htm (OpenLink) Best regards, Andrew --------------------------------------- Andrew Hill - OpenLink Software Director Technology Evangelism eBusiness Infrastructure Technology http://www.openlinksw.com On 4/2/01 6:39 PM, "Daevid Vincent" <[EMAIL PROTECTED]> wrote: > Okay, don't ask me how, but for whatever reason, this "partially worked": > > "./configure --with-openlink=/usr/local/openlink/odbcsdk --with-mysql=/usr/l > ocal --with-apache=../apache" > > however, now I get a different error: > > In file included from internal_functions.c:38: > /usr/src/WT_Apache_Setup/php/ext/odbc/php_odbc.h:125: iodbc.h: No such file > or directory > In file included from internal_functions.c:38: > /usr/src/WT_Apache_Setup/php/ext/odbc/php_odbc.h:128: udbcext.h: No such > file or directory > make[2]: *** [internal_functions.lo] Error 1 > make[2]: Leaving directory `/data/usr/src/WT_Apache_Setup/php-4.0.4/main' > make[1]: *** [all-recursive] Error 1 > make[1]: Leaving directory `/data/usr/src/WT_Apache_Setup/php-4.0.4/main' > make: *** [all-recursive] Error 1 > > I've done a 'locate iodbc.h' and don't have one. > > [root=pts/1]3:34pm@content:{/usr/src/WT_Apache_Setup/php}> locate udbcext.h > /usr/local/openlink/odbcsdk/include/udbcext.h > /usr/local/openlink/udbcsdk/include/udbc/udbcext.h > > does however exist despite that error message. > > just for fun I tried: > > "./configure --with-openlink=/usr/local/openlink --with-mysql=/usr/local --w > ith-apache=../apache" (notice the 'odbcsdk' is not in the path) > > and get a simmilar error: > > In file included from internal_functions.c:38: > /usr/src/WT_Apache_Setup/php/ext/odbc/php_odbc.h:125: iodbc.h: No such file > or directory > In file included from /usr/src/WT_Apache_Setup/php/ext/odbc/php_odbc.h:128, > from internal_functions.c:38: > /usr/local/openlink/odbcsdk/include/udbcext.h:47: warning: > `SQL_LEN_DATA_AT_EXEC' redefined > /usr/local/openlink/odbcsdk/include/sqlext.h:250: warning: this is the > location of the previous definition > make[2]: *** [internal_functions.lo] Error 1 > make[2]: Leaving directory `/data/usr/src/WT_Apache_Setup/php-4.0.4/main' > make[1]: *** [all-recursive] Error 1 > make[1]: Leaving directory `/data/usr/src/WT_Apache_Setup/php-4.0.4/main' > make: *** [all-recursive] Error 1 > > thank you for your continued help. > >> -----Original Message----- >> From: Daevid Vincent [mailto:[EMAIL PROTECTED]] >> Sent: Saturday, March 31, 2001 12:56 PM >> To: Andrew Hill; [EMAIL PROTECTED]; PHP General >> Subject: RE: [PHP-DB] RE: [PHP] RE: what exactly are /path/to/blah >> lookingfor? .h? .so? .a? what?! >> >> >> I get the "No such file or directory" right after the "license >> box" shows up >> in the PHP4 compile. Like this (no matter what directory I've >> tried in that >> big old list so far): >> >> ./WTConfigure: --with-openlink=/usr/local/openlink/lib: No such file or >> directory >> >> "./WTConfigure" is just a shell script with make clean, all my --options, >> make, make install, since I have to compile in mysql, and some >> other stuff. >> >>> -----Original Message----- >>> From: Andrew Hill [mailto:[EMAIL PROTECTED]] >>> Sent: Friday, March 30, 2001 4:00 PM >>> To: Daevid Vincent; [EMAIL PROTECTED]; PHP General >>> Subject: Re: [PHP-DB] RE: [PHP] RE: what exactly are /path/to/blah >>> lookingfor? .h? .so? .a? what?! >>> >>> >>> Daevid, >>> >>> just --with-iodbc or --with-openlink is fine. >>> >>> you should be using either: >>> >>> --with-iodbc=/usr/local/openlink/odbcsdk \ >>> or >>> --with-openlink=/usr/local/openlink/lib \ >>> >>> depending on which you use and where you installed the sdk. >>> what error are you getting? >>> >>> Best regards, >>> Andrew >>> >>> >>> On 3/30/01 6:54 PM, "Daevid Vincent" <[EMAIL PROTECTED]> wrote: >>> >>>> thanks for replying Andrew, but that's not working for me either. >>>> >>>> Also, do I need both "--with-iodbc" and "--with-openlink" or do >>> I just need >>>> one of them? >>>> >>>> These are the instructions I've been following: >>>> http://www.iodbc.org/odbc-phpHOWTO.html >>>> >>>> so now I've tried: >>>> >>>> #--with-iodbc=/usr/local/openlink/odbcsdk/lib \ >>>> #--with-iodbc=/usr/local/openlink/odbcsdk \ >>>> #--with-iodbc=/usr/local/openlink/lib \ >>>> #--with-iodbc=/usr/local/bin \ >>>> #--with-iodbc=/usr/local \ >>>> #--with-iodbc=/usr/local/include \ >>>> #--with-iodbc=../libiodbc \ >>>> #--with-openlink=/usr/local/openlink/odbcsdk/lib \ >>>> #--with-openlink=/usr/local/openlink/odbcsdk \ >>>> #--with-openlink=/usr/local/openlink \ >>>> #--with-openlink=/usr/local/openlink/lib \ >>>> >>>> here is my dir structure: >>>> the files are there, why won't PHP see them? In fact I have the >>>> "libiodbc.so" library in TWO places I see: "openlink/lib/" and >>>> "openlink/odbcsdk/lib/" >>>> >>>> [root=pts/1]3:45pm@content:{/usr/local/openlink}> ll -r >>>> /usr/local/openlink/* >>>> -rw-rw-rw- 1 nobody html 0 Mar 29 20:20 >>>> /usr/local/openlink/oplrqb.ini >>>> -rwxr-xr-x 1 nobody html 707 Mar 30 15:16 >>>> /usr/local/openlink/openlink.sh* >>>> -rwxr-xr-x 1 nobody html 619 Mar 30 15:16 >>>> /usr/local/openlink/openlink.csh* >>>> -rw-rw-rw- 1 nobody html 180 Mar 29 20:21 >>>> /usr/local/openlink/odbcinst.ini >>>> -rw-rw-rw- 1 nobody html 541 Mar 30 13:51 >>>> /usr/local/openlink/odbc.ini >>>> -rw-rw-rw- 1 nobody html 196347 Mar 29 17:54 >>>> /usr/local/openlink/l2oczzzz.taz >>>> -rw-rw-rw- 1 nobody html 364085 Mar 30 15:16 >>>> /usr/local/openlink/l2kuzzzz.taz >>>> -rw-rw-rw- 1 nobody html 512218 Mar 30 15:16 >>>> /usr/local/openlink/l2kozzzz.taz >>>> -rwxrwxrwx 1 nobody html 16137 Mar 30 15:16 >>>> /usr/local/openlink/install.sh* >>>> >>>> /usr/local/openlink/udbcsdk: >>>> total 16 >>>> drwxr-xr-x 2 nobody html 4096 Mar 7 14:44 lib/ >>>> drwxr-xr-x 3 nobody html 4096 Mar 7 14:44 include/ >>>> drwxr-xr-x 2 nobody html 4096 Mar 7 14:44 examples/ >>>> drwxr-xr-x 2 nobody html 4096 Mar 7 14:44 doc/ >>>> >>>> /usr/local/openlink/lib: >>>> total 400 >>>> -rw-r--r-- 1 nobody html 272057 Mar 7 14:43 >> oplodbc.so.1.0.0 >>>> lrwxrwxrwx 1 nobody html 16 Mar 30 15:16 >> oplodbc.so.1 -> >>>> oplodbc.so.1.0.0 >>>> lrwxrwxrwx 1 nobody html 16 Mar 30 15:16 oplodbc.so -> >>>> oplodbc.so.1.0.0 >>>> -rw-r--r-- 1 nobody html 678 Mar 7 14:43 oplodbc.la >>>> lrwxrwxrwx 1 nobody html 17 Mar 30 15:16 libodbc.so -> >>>> libiodbc.so.2.1.2* >>>> -rwxr-xr-x 1 nobody html 117877 Mar 7 14:43 >>> libiodbc.so.2.1.2* >>>> lrwxrwxrwx 1 nobody html 17 Mar 30 15:16 >> libiodbc.so.2 -> >>>> libiodbc.so.2.1.2* >>>> lrwxrwxrwx 1 nobody html 17 Mar 30 15:16 libiodbc.so -> >>>> libiodbc.so.2.1.2* >>>> -rwxr-xr-x 1 nobody html 669 Mar 7 14:43 libiodbc.la* >>>> >>>> /usr/local/openlink/bin: >>>> total 140 >>>> -rw------- 1 nobody html 29 Mar 30 15:16 oplrqb.ini >>>> -rwxr-xr-x 1 nobody html 92225 Mar 7 14:43 odbctest* >>>> -rw-r--r-- 1 nobody html 170 Mar 7 14:43 >>> odbcinst.ini.sample >>>> -rw-r--r-- 1 nobody html 170 Mar 7 14:43 odbcinst.ini >>>> -rw-r--r-- 1 nobody html 473 Mar 7 14:43 >> odbc.ini.sample >>>> -rw-r--r-- 1 nobody html 473 Mar 7 14:43 odbc.ini >>>> -rwxr--r-- 1 nobody html 23260 Mar 7 14:43 inifile* >>>> >>>> /usr/local/openlink/odbcsdk: >>>> total 20 >>>> drwxr-xr-x 2 nobody html 4096 Mar 30 15:16 lib/ >>>> drwxr-xr-x 2 nobody html 4096 Mar 30 15:16 include/ >>>> drwxr-xr-x 2 nobody html 4096 Mar 30 15:16 examples/ >>>> drwxr-xr-x 2 nobody html 4096 Mar 30 15:16 driver/ >>>> drwxr-xr-x 2 nobody html 4096 Mar 30 15:16 doc/ >>>> >>>> and then here is the odbcsdk directory tree: >>>> >>>> [root=pts/1]3:51pm@content:{/usr/local/openlink}> ll -r odbcsdk/* >>>> odbcsdk/lib: >>>> total 976 >>>> -rw-r--r-- 1 nobody html 272057 Mar 7 14:42 >> oplodbc.so.1.0.0 >>>> lrwxrwxrwx 1 nobody html 16 Mar 30 15:16 >> oplodbc.so.1 -> >>>> oplodbc.so.1.0.0 >>>> lrwxrwxrwx 1 nobody html 16 Mar 30 15:16 oplodbc.so -> >>>> oplodbc.so.1.0.0 >>>> -rw-r--r-- 1 nobody html 678 Mar 7 14:42 oplodbc.la >>>> -rw-r--r-- 1 nobody html 431992 Mar 7 14:42 oplodbc.a >>>> -rwxr-xr-x 1 nobody html 117877 Mar 7 14:42 >>> libiodbc.so.2.1.2* >>>> lrwxrwxrwx 1 nobody html 17 Mar 30 15:16 >> libiodbc.so.2 -> >>>> libiodbc.so.2.1.2* >>>> lrwxrwxrwx 1 nobody html 17 Mar 30 15:16 libiodbc.so -> >>>> libiodbc.so.2.1.2* >>>> -rwxr-xr-x 1 nobody html 669 Mar 7 14:42 libiodbc.la* >>>> -rw-r--r-- 1 nobody html 143692 Mar 7 14:42 libiodbc.a >>>> >>>> odbcsdk/include: >>>> total 136 >>>> -rw-r--r-- 1 nobody html 11973 Mar 7 14:42 udbcext.h >>>> -rw-r--r-- 1 nobody html 6362 Mar 7 14:42 sqltypes.h >>>> -rw-r--r-- 1 nobody html 67955 Mar 7 14:42 sqlext.h >>>> -rw-r--r-- 1 nobody html 28728 Mar 7 14:42 sql.h >>>> -rw-r--r-- 1 nobody html 1161 Mar 7 14:42 isqltypes.h >>>> -rw-r--r-- 1 nobody html 1158 Mar 7 14:42 isqlext.h >>>> -rw-r--r-- 1 nobody html 1140 Mar 7 14:42 isql.h >>>> >>>> odbcsdk/examples: >>>> total 112 >>>> -rw-r--r-- 1 nobody html 10321 Mar 7 14:42 odbctest.c >>>> -rwxr-xr-x 1 nobody html 92225 Mar 7 14:42 odbctest* >>>> -rw-r--r-- 1 nobody html 3460 Mar 7 14:42 Makefile >>>> >>>> odbcsdk/driver: >>>> total 124 >>>> -rw-r--r-- 1 nobody html 119187 Mar 7 14:42 odbc_src.taz >>>> >>>> odbcsdk/doc: >>>> total 16 >>>> -rw-r--r-- 1 nobody html 773 Mar 7 14:42 odbcinst.ini >>>> -rw-r--r-- 1 nobody html 1010 Mar 7 14:42 odbc.ini >>>> -rw-r--r-- 1 nobody html 5127 Mar 7 14:42 odbc.doc >>>> >>>> >>>>> -----Original Message----- >>>>> From: Andrew Hill [mailto:[EMAIL PROTECTED]] >>>>> Sent: Friday, March 30, 2001 2:57 PM >>>>> To: Daevid Vincent; [EMAIL PROTECTED]; PHP General >>>>> Subject: [PHP] RE: what exactly are /path/to/blah looking >> for? .h? .so? >>>>> .a? what?! >>>>> >>>>> >>>>> Daevid, >>>>> >>>>> It's the path/to/odbcsdk >>>>> It's looking for libiodbc.so >>>>> >>>>> :) >>>>> >>>>> Best regards, >>>>> Andrew >>>> >>> >> >> >> -- >> PHP Database 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] >> >
Dear PHP Helpers, What is your recommendation on limiting a while statement so that it only iterates a maximum of 20 times? Here is the code snippet: $result = mysql_query($sql, $db); while ($myrow = mysql_fetch_array($result)) { printf("Name: <b><font color=\"green\" size=\"5s\">%s %s %s %s\n<br></b></font>", $myrow["salutation"], $myrow["first_name"], $myrow["mid_name"], $myrow["user_name"]); Best regards, Bob Stone __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/?.refer=text
Probably a more efficient way to do this is to put a LIMIT qualifier on your query (see the MySQL docs). Then you won't retrieve rows you are not going to use anyway. Kirk > -----Original Message----- > From: Bob Stone [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 02, 2001 4:54 PM > To: [EMAIL PROTECTED] > Subject: [PHP] How to limit a WHILE statement? > > > Dear PHP Helpers, > > What is your recommendation on limiting a while > statement so that it only iterates a maximum of 20 > times? > > Here is the code snippet: > > $result = mysql_query($sql, $db); > > while ($myrow = mysql_fetch_array($result)) { > > printf("Name: <b><font color=\"green\" size=\"5s\">%s > %s %s %s\n<br></b></font>", $myrow["salutation"], > $myrow["first_name"], $myrow["mid_name"], > $myrow["user_name"]); > > Best regards, > > Bob Stone > > __________________________________________________ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.yahoo.com/?.refer=text > > -- > 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] >
Limit it in your query statement i.e. SELECT * FROM whatever LIMIT 1,20 Jerry Lake - [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -----Original Message----- From: Bob Stone [mailto:[EMAIL PROTECTED]] Sent: Monday, April 02, 2001 3:54 PM To: [EMAIL PROTECTED] Subject: [PHP] How to limit a WHILE statement? Dear PHP Helpers, What is your recommendation on limiting a while statement so that it only iterates a maximum of 20 times? Here is the code snippet: $result = mysql_query($sql, $db); while ($myrow = mysql_fetch_array($result)) { printf("Name: <b><font color=\"green\" size=\"5s\">%s %s %s %s\n<br></b></font>", $myrow["salutation"], $myrow["first_name"], $myrow["mid_name"], $myrow["user_name"]); Best regards, Bob Stone __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/?.refer=text -- 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]
Two ways: Do it in PHP add a counter and test for it at the end of the while loop if ==20 then break; Easier, do it in your query: tack LIMIT 20 on the end of your query, and you will only get the first 20 hits from your database. On 4/2/01 3:54 PM, "Bob Stone" <[EMAIL PROTECTED]> wrote: > Dear PHP Helpers, > > What is your recommendation on limiting a while > statement so that it only iterates a maximum of 20 > times? > > Here is the code snippet: > > $result = mysql_query($sql, $db); > > while ($myrow = mysql_fetch_array($result)) { > > printf("Name: <b><font color=\"green\" size=\"5s\">%s > %s %s %s\n<br></b></font>", $myrow["salutation"], > $myrow["first_name"], $myrow["mid_name"], > $myrow["user_name"]); > > Best regards, > > Bob Stone > > __________________________________________________ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.yahoo.com/?.refer=text
> -----Original Message----- > From: Bob Stone [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 02, 2001 3:54 PM > To: [EMAIL PROTECTED] > Subject: [PHP] How to limit a WHILE statement? > > > Dear PHP Helpers, > > What is your recommendation on limiting a while > statement so that it only iterates a maximum of 20 > times? > > Here is the code snippet: > > $result = mysql_query($sql, $db); > > while ($myrow = mysql_fetch_array($result)) { > > printf("Name: <b><font color=\"green\" size=\"5s\">%s > %s %s %s\n<br></b></font>", $myrow["salutation"], > $myrow["first_name"], $myrow["mid_name"], > $myrow["user_name"]); > > Best regards, > > Bob Stone Limit the results returned in the actual SQL to 20 results. Jason Lotito www.NewbieNetwork.net Where those who can, teach; and those who can, learn.
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Lindsay Adams) wrote: > Two ways: > Do it in PHP > add a counter and test for it at the end of the while loop > if ==20 then break; > > Easier, do it in your query: > tack LIMIT 20 on the end of your query, and you will only get the first > 20 hits from your database. > > > > On 4/2/01 3:54 PM, "Bob Stone" <[EMAIL PROTECTED]> wrote: > > > Dear PHP Helpers, > > > > What is your recommendation on limiting a while > > statement so that it only iterates a maximum of 20 > > times? Third way: use a for loop instead of the while (same concept at the first suggestion, just slightly different methology). for($i=0;$i<20;$i++) { blah } -- CC
$count = 0; while (($myrow = mysql_fetch_array($result))&&($count<20)) { do stuff $count++; } Sig for a Day Stephan Ahonen, ICQ 491101 "That's very funny Scotty, now beam down my clothes!" Come back tomorrow for a different sig! Backspace a single "s" to reply by email
Looking into Database Abstraction, and I was recommended to Metabase. I have looked over it, and found that I like it. However, I was looking to gain further insight as to other people using Metabase, and their experiences with it, good, bad, problems, no problems, etc. Thank you Jason Lotito www.NewbieNetwork.net Where those who can, teach; and those who can, learn.
Can PHP change the size of an image (gif or jpg)? J Say I'm Hot! - Post Your Picture! http://www.sayimhot.com
The imlib2 extension does a very nice job of this. On Mon, 2 Apr 2001, Joseph Bannon wrote: > Can PHP change the size of an image (gif or jpg)? > > J > > > Say I'm Hot! - Post Your Picture! > http://www.sayimhot.com > > >
Hello, I don't relly get this... can sonmeone try and explain. I have a mysql database and phtml form. I can insert information intodatabase from the form, no problem. UNTIL I have a few items I want to insert multiples of ie DATE, DESCRIPTION My table is... photoid photono photodesc photodate My form reads... PHOTO NO : DATE TAKEN: DESCRIPTION : PHOTO NO : DATE TAKEN: DESCRIPTION : PHOTO NO : DATE TAKEN: DESCRIPTION : PHOTO NO : DATE TAKEN: DESCRIPTION : PHOTO NO : DATE TAKEN: DESCRIPTION : I am using an array in my phtml, that sorta works. It will insert 5 records into my database, but if I only want 1 it still inserts 5 Is there an example anyone knows of I can look at. Thanks Curtis
Need to see your code for inserting data. But I think first, you should be naming your fields with empty[]s Ie. <input type="text" name="photo_no[]"> Etc That way, php will build an array out of the variables, and it will ONLY contain values, if values were submitted.. Then you build your insert query by looping through the arrays by index# <? // with arrays:$photo_no[], $datetak[],$photodesc[] built by PHP when form // values were parsed $query = "INSERT INTO photo (photono,photoid,photodesc,photodate) VALUES "; for($I=0;$i < count($photo_no); $I++) { if(!($I == count($photo_no) -1)) { //check to see if this is the last data set to insert if it is NOT the last, do this $query .= "('$photo_no[$I]',NULL,'$photodesc[$I]','$datetak[$I]'),"; //note the comma, to link the insert together. } else { //do this if it IS the last dataset to enter $query .= "('$photo_no[$I]',NULL,'$photodesc[$I]','$datetak[$I]')"; } } $result = mysql_query($query,$link); ?> Why the if-else? Because, we don't want that trailing comma if it is the last data set to be insert. We would get an error. This piece of code will produce a query like: INSERT INTO photo (photoid,photono,photodesc,photodate) VALUES ('photo_number_info1',NULL,'photo_description1','photo_date1'), ('photo_number_info2',NULL,'photo_description2','photo_date2'), ('photo_number_info3',NULL,'photo_description3','photo_date3') If 3 sets of data were passed in. I am making the assumption here that photoid is a unique auto_incrementing field in your database. If so, you could also leave out the null field in the query. On 4/2/01 4:14 PM, "Curtis" <[EMAIL PROTECTED]> wrote: > Hello, > I don't relly get this... can sonmeone try and explain. > I have a mysql database and phtml form. > > I can insert information intodatabase from the form, no problem. > UNTIL > I have a few items I want to insert multiples of ie DATE, DESCRIPTION > > My table is... > photoid > photono > photodesc > photodate > > My form reads... > > PHOTO NO : > DATE TAKEN: > DESCRIPTION : > PHOTO NO : > DATE TAKEN: > DESCRIPTION : > PHOTO NO : > DATE TAKEN: > DESCRIPTION : > PHOTO NO : > DATE TAKEN: > DESCRIPTION : > PHOTO NO : > DATE TAKEN: > DESCRIPTION : > > I am using an array in my phtml, that sorta works. > It will insert 5 records into my database, but if I only want 1 it still > inserts 5 > > Is there an example anyone knows of I can look at. > > Thanks > Curtis > >
Hi all, I am facing dificulties to make PHP work with Apache on Windows. I have installed Apache 1.3.19, PHP_401pl_Win32 and as indicated I put the following lines in the configuration of Apache # And for PHP 4.x, use: # ScriptAlias /php/ "C:/php/" AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps But when I try to run simples script containing phpinfo() I do not receive a message error in the log file and at the same time I receive a blank page (without the information I was waiting for). Could you help to complete the configuration of PHP if itīs necessary. Thanks. Dimas [EMAIL PROTECTED] ______________________________________________ FREE Personalized Email at Mail.com Sign up at http://www.mail.com/?sr=signup
Dimonekene Ditutala wrote: > Hi all, > > I am facing dificulties to make PHP work with Apache on > Windows. I have installed Apache 1.3.19, PHP_401pl_Win32 > and as indicated I put the following lines in the configuration of Apache > > # And for PHP 4.x, use: > # > ScriptAlias /php/ "C:/php/" > AddType application/x-httpd-php .php > AddType application/x-httpd-php-source .phps you need an Action line. Action application/x-httpd-php /php/php.exe +----------------------------------------+ | Julie Meloni ([EMAIL PROTECTED]) | | | | "PHP Essentials" and "PHP Fast & Easy" | | http://www.thickbook.com | +----------------------------------------+
What is causing this error Warning: 1 is not a valid File-Handle resource in c:/httpd/htdocs/autosetup/auto/createaccount.php on line 88 This is the cod in question $tab = chr(9); // define tabulator if(file_exists("userdata")) { $fp2=fopen ("userdata","r")or die("unable to open file ($userdata)"); flock($fp2, 2); //unless ($use_flock == 0); while ($data = fgetcsv ($fp2, 1000, $tab)) { <---this is line 88 $num = count ($data); $row++; for ($c=0; $c<$num; $c++) { }
Don't know. Code looks good, what version of PHP are you using? Module or cgi? What version of windows? These are the things the PHP/Zend guys probably need to know. On 4/2/01 4:59 PM, "Richard Kurth" <[EMAIL PROTECTED]> wrote: > What is causing this error > > > Warning: 1 is not a valid File-Handle resource in > c:/httpd/htdocs/autosetup/auto/createaccount.php on line 88 > > This is the cod in question > > $tab = chr(9); // define tabulator > if(file_exists("userdata")) { > $fp2=fopen ("userdata","r")or die("unable to open file ($userdata)"); > flock($fp2, 2); //unless ($use_flock == 0); > while ($data = fgetcsv ($fp2, 1000, $tab)) { <---this is line 88 > $num = count ($data); > $row++; > for ($c=0; $c<$num; $c++) { > > } >
I am using the newest ver of PHP and newest ver of apache on win98 just installed new php and apache yesterday set php up as a module > Don't know. Code looks good, what version of PHP are you using? Module or > cgi? What version of windows? These are the things the PHP/Zend guys > probably need to know. > > On 4/2/01 4:59 PM, "Richard Kurth" <[EMAIL PROTECTED]> wrote: > > > What is causing this error > > > > > > Warning: 1 is not a valid File-Handle resource in > > c:/httpd/htdocs/autosetup/auto/createaccount.php on line 88 > > > > This is the cod in question > > > > $tab = chr(9); // define tabulator > > if(file_exists("userdata")) { > > $fp2=fopen ("userdata","r")or die("unable to open file ($userdata)"); > > flock($fp2, 2); //unless ($use_flock == 0); > > while ($data = fgetcsv ($fp2, 1000, $tab)) { <---this is line 88 > > $num = count ($data); > > $row++; > > for ($c=0; $c<$num; $c++) { > > > > } > > > > > -- > 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] > >
$fp2=fopen ("userdata","r")or die("unable to open file ($userdata)"); $fp2 is getting a value 1 or 0 if ($fp2=fopen ("userdata","r") ) { lock file write some stuff } else { echo ("file would not open"); } wk ""Richard Kurth"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am using the newest ver of PHP and newest ver of apache on win98 > just installed new php and apache yesterday set php up as a module > > > Don't know. Code looks good, what version of PHP are you using? Module or > > cgi? What version of windows? These are the things the PHP/Zend guys > > probably need to know. > > > > On 4/2/01 4:59 PM, "Richard Kurth" <[EMAIL PROTECTED]> wrote: > > > > > What is causing this error > > > > > > > > > Warning: 1 is not a valid File-Handle resource in > > > c:/httpd/htdocs/autosetup/auto/createaccount.php on line 88 > > > > > > This is the cod in question > > > > > > $tab = chr(9); // define tabulator > > > if(file_exists("userdata")) { > > > $fp2=fopen ("userdata","r")or die("unable to open file ($userdata)"); > > > flock($fp2, 2); //unless ($use_flock == 0); > > > while ($data = fgetcsv ($fp2, 1000, $tab)) { <---this is line 88 > > > $num = count ($data); > > > $row++; > > > for ($c=0; $c<$num; $c++) { > > > > > > } > > > > > > > > > -- > > 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] >
""WK"" <[EMAIL PROTECTED]> wrote in message 9abfvp$v4$[EMAIL PROTECTED]">news:9abfvp$v4$[EMAIL PROTECTED]... > $fp2=fopen ("userdata","r")or die("unable to open file ($userdata)"); > $fp2 is getting a value 1 or 0 > > if ($fp2=fopen ("userdata","r") ) { > lock file > write some stuff unlock file <--------------forgot this > } > else { > echo ("file would not open"); > } > > wk > > ""Richard Kurth"" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I am using the newest ver of PHP and newest ver of apache on win98 > > just installed new php and apache yesterday set php up as a module > > > > > Don't know. Code looks good, what version of PHP are you using? Module > or > > > cgi? What version of windows? These are the things the PHP/Zend guys > > > probably need to know. > > > > > > On 4/2/01 4:59 PM, "Richard Kurth" <[EMAIL PROTECTED]> wrote: > > > > > > > What is causing this error > > > > > > > > > > > > Warning: 1 is not a valid File-Handle resource in > > > > c:/httpd/htdocs/autosetup/auto/createaccount.php on line 88 > > > > > > > > This is the cod in question > > > > > > > > $tab = chr(9); // define tabulator > > > > if(file_exists("userdata")) { > > > > $fp2=fopen ("userdata","r")or die("unable to open file ($userdata)"); > > > > flock($fp2, 2); //unless ($use_flock == 0); > > > > while ($data = fgetcsv ($fp2, 1000, $tab)) { <---this is line 88 > > > > $num = count ($data); > > > > $row++; > > > > for ($c=0; $c<$num; $c++) { > > > > > > > > } > > > > > > > > > > > > > -- > > > 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] >
Just a suggestion, but it seems like it would be helpful if there were a --make-cgi or some other flag that I could use so that when I compile PHP4, it generates me both the Apache module and also the stand alone cgi. I use both frequently, PHP4 for the web interface things, and then also the cgi for daily scripts -- both use mySQL and other features that are common. d.
Hi, I am just learning PHP (I was a ASP developer but I switched over) and I need a host that is free and lets me use PHP4 and MySQL? Does anyone know of such a host? If you do please tell me! Thanks, -Frank
Check the database at: http://hosts.php.net/ -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: "Frank K" <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Monday, April 02, 2001 7:16 PM Subject: [PHP] Hosting for FREE?? Hi, I am just learning PHP (I was a ASP developer but I switched over) and I need a host that is free and lets me use PHP4 and MySQL? Does anyone know of such a host? If you do please tell me! Thanks, -Frank
Try these: http://www.uklinux.net/ http://www.any.za.net/ http://hosting.datablocks.net/free/ AndrewH ----- Original Message ----- From: "Frank K" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, April 03, 2001 9:41 AM Subject: [PHP] Hosting for FREE?? Hi, I am just learning PHP (I was a ASP developer but I switched over) and I need a host that is free and lets me use PHP4 and MySQL? Does anyone know of such a host? If you do please tell me! Thanks, -Frank
Why does one variable gets registered and the other don't (the order doesn't alter anything.. I've tried)... <snip> $script_total_time=(float)$total_time; session_register("script_total_time"); $step_times_array[$step]=$total_time; $step_times=serialize($step_times_array); //echo "step_times=\"$step_times\""; session_register("step_times"); </snip> after that (and there are no mentions to either of those vars after that), these are the contents of the session-cookie: script_total_time|d:4.8891049623489;!step_times| step_times simply doesn't get registered... BTW... the commented echo above outputs: step_times="a:1:{s:8:"download";d:4.8891049623489;}" what is wrong with my code? ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer
Why does system() - or any of its cousins, I've tried them all: exec(), passthru(), backtick operator, etc - doesn't output anything when running on a Win2k/IIS5 machine? I ran the exact same script on a WinME/Apache, and the output was perfect.... ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer
> Now i get a error window saying: "Document contained no data" That usually means PHP crashed. Check your web-server error logs. Also, try adding some debug output before each statement to pinpoint the crash line. > ----------code----------------- > > $noaa = "http://weather.noaa.gov/cgi-bin/mgetmetar.pl?cccc=MUHA" ; > $wfile = fopen ($noaa, "r"); > > > $weathcont = fread ($wfile , 1024); > > ereg (" ([0-9][0-9])/([0-9][0-9]) " , $weathcont, $reg); > > $far = 32 + ( $reg[1] / (5.0 / 9.0)); > $data = date("d F"); > $ora = (date("H")-6); > > echo "<font size=\"-1\" color=\"SteelBlue\"><b> > Temperature in Habana, on $data, at "; > if ($ora < 0){ > $timezone = ($ora + 24); > echo $timezone; > }else{ > echo $ora ; > } > echo " is:</b></font><br> > <font color=\"SteelBlue\"><b>$reg[1] C ($far F)</b></font>"; > fclose($wfile); > > --------end of code -------------------------- -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
Check out http://php.net/fopen and PHP's FTP support. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Sunday, March 25, 2001 6:03 AM Subject: [PHP] Let the Server do the downloading Is it possible? Have anyone made a script that allows you to grab a file from another URL directly from the server so that you don't need to download the file and upload it again? Chua Zhi Hon aka. Zeus ------------------------------------- Founder/CEO, Frozened Network "We provide you with the tools needed to setup an online business" http://www.frozened.com Editorial, paGn.net http://www.pagn.net
See manual reference on fopen() and fsockopen() Fopen() can take http://... Or ftp://... As filenames. Therefore, you can do an ftp login and upload and download files from a remote server, or use http:// and read files from a server. On 4/2/01 4:27 PM, "Richard Lynch" <[EMAIL PROTECTED]> wrote: > Check out http://php.net/fopen and PHP's FTP support. > > -- > Visit the Zend Store at http://www.zend.com/store/ > Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm > Volunteer a little time: http://chatmusic.com/volunteer.htm > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > Newsgroups: php.general > Sent: Sunday, March 25, 2001 6:03 AM > Subject: [PHP] Let the Server do the downloading > > > Is it possible? > > Have anyone made a script that allows you to grab a file from another URL > directly from the server so that you don't need to download the file and > upload it again? > > > Chua Zhi Hon aka. Zeus > ------------------------------------- > Founder/CEO, Frozened Network > "We provide you with the tools needed to setup an online business" > http://www.frozened.com > Editorial, paGn.net > http://www.pagn.net > >
> I'm loading a set of txt files into a DB. The first 7 lines of each file > are useless to me... > I want some way I can always jump those 7 lines... I tought of doing a > little function like jumpfirstsevenrows(array), but then I'd have to pass > the whole array as parameter and that can get real memory consuming for > such a small task. I'll have arrays with more than 100.000 lines... I think you can still use: function skip7 (&$array){ for ($i = 0; $i < 7; $i++, next($array)); } The & should keep the array from being pushed on the stack, or at least it did in PHP3. I'm afraid & got rather more complicated in PHP4, so I'm not 100% sure *what* it would do. > since there are pointers in PHP, I'm lost... I don't wanna have to get the > same 'for bla bla bla code' in each and every function that processes this > file (there is one function per file, more then 20 overall)... Another possiblity would be to write a function to first figure out where the 8th line started, and then use fopen/fseek/fread to always skip to that byte in the file and then start returning lines from there. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
Perhaps http://php.net/FAQ.php#4.4 is the answer. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: "Pinwang Chao" <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Sunday, March 25, 2001 6:36 PM Subject: [PHP] PHP and MySQL insert problem > Can any one help me with the following problem? > > I have a very simple query: > > ... > $sql="insert into tt (a, b) values ('1', '2')"; > $result=mysql_query($sql); > ... > > I always got the following error message when I run it from my browser. > > Warning: MySQL: Unable to save result set in /usr/local/apache/htdocs/tt.php > on line 9 > > But even with this message, the values are still inserted into tt. > > When I change $sql to &sql="select * from tt"; > > There were no such error message. > > It puzzled me? Why? > > My system: PHP 4.0.4pl1, MySQL 3.23.32 > > Thanks in advance. > > > -- > 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] >
Works for me... Keep in mind that not all OSes use \n as linefeed, so the data you have may not be what you think it is... -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Jens Kisters <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Thursday, March 29, 2001 9:57 AM Subject: [PHP] Finding linefeeds in Strings String functions like explode, strpos or str_replace seem to fail when asked to work with "\n". What can i do to tokenize or explode a string by linefeeds? i replaced "\n" by another expression and it seems to work, but i'm curious if there's a mor elegant solution... cu Jens -- Grüße aus dem schönen Kleve Jens Kisters rosomm et partner Agentur für neue Medien GmbH Dienstleistungszentrum am Weißen Tor - Eingang B Gocher Landstrasse 2 47551 Kleve / Bedburg-Hau Telefon: 02821 - 97856-20 Telefax: 02821 - 97856-77 [EMAIL PROTECTED] http://www.rosomm-partner.de -- 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]
> It look like that PHP can't set the environment variable or put in the > environment variable. The script I wrote down is .... > > putenv("LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH"); > putenv("ODBCINSTINI=/usr/local/bin/odbcinst.ini"); > putenv("ODBCINI=/usr/local/bin/odbc.ini"); > > Why does the PHP environment varible doesn't work? What can I do about > it? Does caldera have problem with that? I think you need to get those Env variables set before PHP starts for some reason... Try adding them to the .shrc (or whatever) of your "nobody" user (or whichever user PHP runs as). -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
> <PRE> > function do_each($passed_array) { > > global ${$tmp_var_name}; Move this: > > if (substr($passed_array[0],-5) == "_post") { > $tmp_var_name = substr($passed_array[0],0,-5); > ${$tmp_var_name} = $passed_array[1]; down here. > return(${$tmp_var_name}); > } > } -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
Richard Lynch writes: > function do_each($passed_array) { > > global ${$tmp_var_name}; Move this: > > if (substr($passed_array[0],-5) == "_post") { > $tmp_var_name = substr($passed_array[0],0,-5); > ${$tmp_var_name} = $passed_array[1]; down here. > return(${$tmp_var_name}); > } > } Yes, I did that. I must've been going in a different direction when I made it two functions. Problem reamins: Before exiting the function, I can print the true variable name/value pair. As soon as I exit the function, the same print statement returns "". Is it possible to make the variable variable global? Here's what I know have: function conv_vars($input) { global ${$tmp_var_name}; if (IsSet($input)) { while ($each_array = each($input)) { if (is_array($each_array[1])) { conv_vars($each_array[1]); } else { if (substr($each_array[0],-5) == "_post") { $tmp_var_name = substr($each_array[0],0,-5); ${$tmp_var_name} = $each_array[1]; } } } } }
> configure: warning: You will need bison if you want to regenerate the PHP > parsers. > checking for gcc... no > checking for cc... no > configure: error: no acceptable cc found in $PATH cc and gcc are C compilers. PHP is written in C. You need to have a cc compiler, preferably the Gnu CC Compiler known as gcc. You *may* have it on your system, but the user you are logged in as may or may not have it in their "path" and may or may not have permission to execute the compiler. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
I think you want strip_tags($fp, "<!>"); -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: "David Balatero" <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Thursday, March 29, 2001 9:45 PM Subject: [PHP] strip_tags() > I have a document with <!--ktalk newpost--> in it, which I want to KEEP in > the document. (it's being read into $fp). How can I use strip_tags() to > remove all tags, but keep <!--ktalk newpost--> in the document? I tried > > $filedata = strip_tags($filedata, "<!--ktalk newpost-->"); > > Then re-writing it to the file, but it still takes out the <!--ktalk > newpost--> tag! Please help! > > Thanks, > David Balatero > > > -- > 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] >
Wild Guess: Your OS has a limited number of files that can be opened at any one time. Perhaps during heavy activity, you are hitting that limit. I believe "root" can set something somewhere to increase this limit. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Michael Champagne <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Thursday, March 29, 2001 2:18 PM Subject: [PHP] Error during session_start - is this a bug? > Ok, in testing our site that heavily uses sessions I came across this error: > > Warning: open(/tmp/sess_f3051699b0f1ae4a89570e66dab05de9, O_RDWR) failed: m (0) in /ora9ias/Apache/Apache/php/cisweb_global.inc on line 19 > > I can't figure out what causes it. It just happens occasionally when I'm > calling a session_start() - does anyone know what this could be? > > Mike > > > > ****************************************************************** > This communication is for informational purposes only. It is not > intended as an offer or solicitation for the purchase or sale of > any financial instrument or as an official confirmation of any > transaction, unless specifically agreed otherwise. All market > prices, data and other information are not warranted as to > completeness or accuracy and are subject to change without > notice. Any comments or statements made herein do not > necessarily reflect the views or opinions of Capital Institutional > Services, Inc. Capital Institutional Services, Inc. accepts no > liability for any errors or omissions arising as a result of > transmission. Use of this communication by other than intended > recipients is prohibited. > ****************************************************************** > > -- > 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] >
$query = "select blah, blah blah where 1=1 "; if ($institution){ $query .= " and institution like '%$institution%' "; } if ($name){ $query .= " and name like '%$name%' "; } . . . -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Bob Stone <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Friday, March 30, 2001 5:52 PM Subject: [PHP] How to eliminate bad fields from a mysql query? > Dear PHP Helpers, > > Can you direct me to a solution for this problem: > > How can I eliminate bad (blank or incorrect) fields > from a mysql query? In other words, if someone leaves > a form field blank or enters a value that does not > have a matching entry in the database, how can I > eliminate that variable from the query? > > The query that I am using now works fine if the user > enters a value in field that exists in the database. > However if a field is left blank or incorrect data is > entered, no results will display on the screen. > > Here is the code that I am using: > > $result = mysql_query("SELECT salutation, first_name, > mid_name, user_name, cert_deg, job_title, institution, > address_1, address_2, geo_loc, state, zip, country, > phone, fax, e_mail FROM svt_members where first_name > like '$first_name' && user_name like '$user_name' && > institution like '$institution' && state='$state' && > country like '$country'", $db); > > while ($myrow = mysql_fetch_array($result)) { > > printf("Name: <b><font color=\"green\" size=\"5s\">%s > %s %s %s\n<br></b></font>", $myrow["salutation"], > $myrow["first_name"], $myrow["mid_name"], > $myrow["user_name"]); > > printf("Credentials and Degrees: <b><font > color=\"blue\" size=\2\">%s</font></b><br>Job Title: > <b><font color=\"blue\" > size=\2\">%s</font></b><br>Company/Institution: > <b><font color=\"blue\" > size=\2\">%s<br></font></b>Address: <b><font > color=\"blue\" size=\2\">%s %s<br></font></b>City: > <b><font color=\"blue\" size=\2\">%s</font></b> > State/Province: <b><font color=\"blue\" > size=\2\">%s<br></font></b>Country: <b><font > color=\"blue\" size=\2\">%s</font></b> Postal Code: > <b><font color=\"blue\" > size=\2\">%s<br></font></b>Voice: <b><font > color=\"blue\" size=\2\">%s</font></b> Fax: <b><font > color=\"blue\" size=\2\">%s<br></font></b>E-mail: > <b><font color=\"blue\" size=\2\">%s\n<P></b></font>", > $myrow["cert_deg"], $myrow["job_title"], > $myrow["institution"], $myrow["address_1"], > $myrow["address_2"], $myrow["geo_loc"], > $myrow["state"], $myrow["country"], $myrow["zip"], > $myrow["phone"], $myrow["fax"], $myrow["e_mail"]); > } > > So if (for instance) a user enters data for each field > except institution, how can I get the query to > disregard $institution? > > Or if there is a better approach that I should be > using instead of the above, please let me know. > > Thank you, > > Bob > > > __________________________________________________ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.yahoo.com/?.refer=text > > -- > 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] >
Those quotes in the php.ini file matter. sendmail_path = "/usr/sbin/sendmail -t -i" Without the quotes, everything after the space is ignored. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Chris Cameron <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Saturday, March 31, 2001 6:19 PM Subject: [PHP] mail() and a Data format error > My setup is PHP 4.0.4p1 with Apache 1.3.19 (PHP as a module), and sendmail > at /usr/sbin/sendmail. I have sendmail_path = /usr/sbin/sendmail -t -i in > my php.ini. THis is all on Linux. > > When I use mail() in any which way, it returns as if it were sucsessful, > but in my maillog I see; > Mar 31 16:22:16 catsnip sendmail[30912]: f2VNMGZ30910: f2VNMGY30912: DSN: > Data format error > > The messages above it gives me the idea that it's the destination > mailserver returning this error. > > Any ideas? > Thanks, > Chris > > > -- > 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] >
Read php.ini -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: Patrick Dunford <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Sunday, April 01, 2001 11:30 PM Subject: [PHP] PHP3: suppressing error messages > How can I prevent error messages from being displayed and sent to a log file > instead? > > -- > ======================================================================= > Patrick Dunford, Christchurch, NZ - http://pdunford.godzone.net.nz/ > > Now to him who is able to do immeasurably more than all we ask > or imagine, according to his power that is at work within us, to > him be glory in the church and in Christ Jesus throughout all > generations, for ever and ever! Amen. > -- Ephesians 3:20-21 > http://www.heartlight.org/cgi-shl/todaysverse.cgi?day=20010331 > ======================================================================= > Created by Mail2Sig - http://pdunford.godzone.net.nz/software/mail2sig/ > > -- > 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] >
make install should have copied libphp3.so from the libs directory (inside the PHP source directory) into the modules directory which lives inside the Apache directory. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: "Marcelo Pereira" <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Monday, April 02, 2001 7:24 AM Subject: [PHP] libphp3.so Hi all, I'm having trouble when installing PHP3-3.0.18. I've done: tar xzvf php3-3.0.18.tar.gz cd php3-3.0.18 ./configure --with-pgsql ./make ./make install Then, in the INSTALL file says to add the follow line at /etc/httpd/conf/httpd.conf LoadMoldule modules/libphp3.so But, I dunno where is this (libphp3.so) file....... and I also don't know where is the mod_php3.so file. What did I do wrong ??? Thanks in advance, Marcelo Pereira Programmer
Did you perhaps download PHP3 DLL's and try to use them with PHP4 or vice versa? That will not work. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: "Adrian Murphy" <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Monday, April 02, 2001 8:24 AM Subject: [PHP] why some dll's don't work > Certain dll's i try to use simply refuse to work. > > php.ini is edited correctly. > php_ftp.dll works > php_gd.dll don't > php_ldap.dll works > php_oci8.dll don't(with oracle 8i personal inastalled) > etc. > whats going on.all the requiste dll's are in the right folder. > > > -- > 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] >
It seems PHP used to allow "+" for string concatenation according to php.ini warn_plus_overloading = off ; my php.ini entry If you turn on this warring, you may see warning for that. I guess PHP is doing this $str = "a"; $str++; as $str = "a"; $str = $str + $str; // $str now stores "aa" PHP syntax/functions looks and works like C most of the time, but there many function/feature that does not work like C. Regards, -- Yasuo Ohgaki ""Mark Roedel"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... -----Original Message----- From: Boget, Chris [mailto:[EMAIL PROTECTED]] Sent: Monday, April 02, 2001 11:12 AM To: Mark Roedel Subject: RE: [PHP] Why does it work this way? >> Because "z"+1 turns out to be "aa" (which, if you ask me, >> makes about as much sense as any of the alternatives), > > How is it that "z" + 1 is "aa"? What is PHP using behind the > scenes to get/generate this value? Let me start by correcting myself on a minor technicality. "z"+1 turns out to be 1 (because "z" has an integer value of 0). It's "z"++ that turns out to be "aa". Perhaps one of the core developers who has a better understanding of the behind-the-scenes operations of PHP can elaborate on this, but what it basically points out to me is that "incrementing" and "adding one" aren't always the same thing. I assume this behavior is tied closely to what PHP determines the type of a variable at any given time to be. If we take that as a starting point, then what I see happening is that, for the purposes of incrementing, there are certain ranges defined within PHP. 0-9 is one, obviously. a-z appears to be another. If, for the purposes of the increment operator only, you treat the letters of the alphabet as a range of integers, then the result you're seeing makes perfect sense. You get to your highest digit, then go back to zero and increment the next column. The problem, in the "for" loop that we started out discussing, is that there doesn't seem to be any way to make a comparison that follows those same rules. You can't treat them as integers, because "aa" and "z" have the same integer-value -- zero. Treating them as strings gives the result we've already seen. Other interesting sort-of-related notes: While incrementing works (sort of) on strings, decrementing doesn't appear to have any effect at all. $test="z"; echo $test--; echo $test; results in "zz" Incrementing only appears to work on strings within particular ranges of characters. $test="("; echo $test++; echo $test; results in "((" --- Mark Roedel | "The most overlooked advantage to owning a Systems Programmer | computer is that if they foul up there's no LeTourneau University | law against whacking them around a little." Longview, Texas, USA | -- Owen Porterfield -- 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]
Ok, Here is the code I am using to insert values from a form into a mysql database... (Given to me by Lindsay Adams,, thank you!) This is just a phantom form and database, there are several things you could look at right off the bat and ask "Why is this fool doing this" Don't bother I already asked that. I want to be able to input a picture number, date and up to 5 descriptions, If I enter a PHOTONO, two - DESCRIPTIONS, and a DATE the code only shows one entry... Any ideas where I am going wrong? ========= START CODE ======== <html> <head> <title>My Pictures</title> </head> <body color="#FF00FF"> <? if(isset($submit)): $db = mysql_connect("localhost", "root"); mysql_select_db("photo", $db); $query = "INSERT INTO pictures (photoid, photono, photodesc, photodate) VALUES"; for($I=0;$I < count($photono); $I++) { if(!($I == count($photono) - 1)) { $query .="(NULL,'$photono[$I]','$photodesc[$I]','$photodate[$I]'),"; } else { $query .="(NULL,'$photono[$I]','$photodesc[$I]','$photodate[$I]')"; } } $result = mysql_query($query); print("<h2>The data has been entered</h2>\n"); endif; ?> <form action="http://localhost/pic2.phtml" method="post"> Picture Number:<br><input type="text" size="20" name="photono[]"><p> Picture Description:<br><input type="text" size="40" name="photodesc[]"><p> Picture Description:<br><input type="text" size="40" name="photodesc[]"><p> Picture Description:<br><input type="text" size="40" name="photodesc[]"><p> Picture Description:<br><input type="text" size="40" name="photodesc[]"><p> Picture Date:<br><input type="text" size="8" name="photodate[]"><p> <input type="submit" name="submit" value="Submit Picture"> </form> </body> </html> ========You guessed it End Code========= Thanks in advance Curtis
Okay, with all that code, I can answer your question. The problem here is that you only have on form field with a date. Therefore it should not be an array. You also have only one photono, so it too should not be an array. When the loop iterates to create the query, there is only a value for the first item in the photono and photodate arrays. All subsequent iterations will have null values, therefore, the query will insert the first data set, and error out on the following ones. Replace this: > $result = mysql_query($query); With this: Print $query And the query will output to the browser, and you will see the empty values. On deeper thinking, do you have a whole lot of empty fields if you manually do a SELECT * FROM pictures; ? Or is one of the following defined as not null (photono,photodesc,photodate) . If one of those is not null, I think it would error out the query after the first insert. Even though there is an error in a multiple insert like this, it still inserts up to the point it errors. On 4/2/01 6:25 PM, "Curtis" <[EMAIL PROTECTED]> wrote: > Ok, > Here is the code I am using to insert values from a form into a mysql > database... > (Given to me by Lindsay Adams,, thank you!) > This is just a phantom form and database, there are several things you > could look at > right off the bat and ask "Why is this fool doing this" > Don't bother I already asked that. > > I want to be able to input a picture number, date and up to 5 > descriptions, > If I enter a PHOTONO, two - DESCRIPTIONS, and a DATE > the code only shows one entry... > > Any ideas where I am going wrong? > ========= START CODE ======== > <html> > <head> > <title>My Pictures</title> > </head> > <body color="#FF00FF"> > <? > if(isset($submit)): > $db = mysql_connect("localhost", "root"); > mysql_select_db("photo", $db); > > > $query = "INSERT INTO pictures (photoid, photono, photodesc, photodate) > VALUES"; > for($I=0;$I < count($photono); $I++) { > if(!($I == count($photono) - 1)) { > $query .="(NULL,'$photono[$I]','$photodesc[$I]','$photodate[$I]'),"; > } > else { > $query .="(NULL,'$photono[$I]','$photodesc[$I]','$photodate[$I]')"; > } > } > $result = mysql_query($query); > > print("<h2>The data has been entered</h2>\n"); > > endif; > > ?> > <form action="http://localhost/pic2.phtml" method="post"> > Picture Number:<br><input type="text" size="20" name="photono[]"><p> > Picture Description:<br><input type="text" size="40" > name="photodesc[]"><p> > Picture Description:<br><input type="text" size="40" > name="photodesc[]"><p> > Picture Description:<br><input type="text" size="40" > name="photodesc[]"><p> > Picture Description:<br><input type="text" size="40" > name="photodesc[]"><p> > Picture Date:<br><input type="text" size="8" name="photodate[]"><p> > <input type="submit" name="submit" value="Submit Picture"> > </form> > </body> > </html> > ========You guessed it End Code========= > > Thanks in advance > Curtis >
Hello Guys, I have a (very simple?) SQL question. I'm more then sure the answer to it is whether "just do this..." or "It's impossible man, how could you even get that into your mind..." I have this database design: (it's more complex of course, but you get an idea) Table 'accounts': +-------+------+------------+ | ID | type | since | +-------+------+------------+ | 00001 | P | 1999-08-01 | | 00002 | F | 1999-11-06 | | 00003 | S | 2000-07-05 | | 00004 | P | 2001-01-01 | +-------+------+------------+ Table 'addresses': +-------+--------------+------+---------+ | ID | city | pref | country | +-------+--------------+------+---------+ | 00001 | Shibuya-ku | 13 | JP | | 00002 | Nakano-ku | 13 | JP | | 00004 | Toyonaka-shi | 27 | JP | +-------+--------------+------+---------+ As you can see, the main data is in 'accounts', the 'addresses.ID' is UNIQUE and corresponds to 'accounts.ID'. The fact is that not every account has an address registered with it. I need to list ALL the accounts in this order: +---+------+-----+--------+-------+ | ID | Type | City | Country | Since | +---+------+-----+--------+-------+ Therefore I am trying to do it with the following query: SELECT accounts.ID AS ID, accounts.type AS Type, addresses.city AS City, addresses.country AS Country, accounts.since AS Since FROM accounts, addresses WHERE addresses.ID=accounts.ID ORDER BY accounts.ID ASC LIMIT 10 ; And, this selects me IDs 00001, 00002 and 00004. 00003, obviously, is not here because there's no such address.ID as stated in my WHERE clause. Can anyone suggest me how do I SELECT ALL of the accounts having simply NULL on 'addresses.*' when there's no such row, instead of 'loosing' the whole 'account' row? I sure know how to do it using two queries, still, I wonder if one single query can do this job. Where do I miss the logic? Thanks in advance. -maxim Maxim Maletsky - [EMAIL PROTECTED] Webmaster, J-Door.com / J@pan Inc. LINC Media, Inc. TEL: 03-3499-2175 x 1271 FAX: 03-3499-3109 http://www.j-door.com http://www.japaninc.net http://www.lincmedia.co.jp
"Maxim Maletsky" <[EMAIL PROTECTED]> wrote: > As you can see, the main data is in 'accounts', the 'addresses.ID' is UNIQUE > and corresponds to 'accounts.ID'. The fact is that not every account has an > address registered with it. <snip> > FROM > accounts, > addresses You're doing a straight join. You need to use a LEFT JOIN to return all the records from one table and those from a second table that match based on a common field. Read about joins in the manual and find a resource on SQL statements - it'll pay off. SELECT * FROM accounts LEFT JOIN addresses ON addresses.ID = accounts.ID > Can anyone suggest me how do I SELECT ALL of the accounts having simply NULL > on 'addresses.*' when there's no such row, instead of 'loosing' the whole > 'account' row? Use the query above and add: WHERE addresses.ID IS NULL -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
I think many users are confusing about PHP4 session. I thought this info might be useful for someone. There are 3 ways to start PHP4 session. (as far as I know) 1) Using php.ini: "session.auto_start = 1" to automatically start session for any request. 2) Using session_start(): Explicitly start PHP4 session with "session_start()" 3) Using session functions: Implicitly start PHP4 session with "session_register()" If you are having trouble with PHP4 session, set "error_reporting = E_ALL" in php.ini. Is there any other way to start PHP4 session? Regards, -- Yasuo Ohgaki "Jack Dempsey" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Jacky, > > basic thing about sessions: you need session_start() at the top of every > page in which you expect to use them...check out zend.com for some > tutorials...but yes, you do need it at the top of that page... > > -jack > "Jacky@lilst" wrote: > > > > Not really, do I need to have session_start at the sender page and the > > receiver page? > > Jack > > [EMAIL PROTECTED] > > "There is nothing more rewarding than reaching the goal you set for > > yourself" > > ----- Original Message ----- > > From: Wade Halsey <[EMAIL PROTECTED]> > > To: Jacky@lilst <[EMAIL PROTECTED]> > > Sent: Monday, April 02, 2001 3:48 AM > > Subject: Re: [PHP] is this syntax correct? > > > > > do you have > > > session_start(); > > > at the top of the next page? > > > > > > ----- Original Message ----- > > > From: Jacky@lilst <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Monday, April 02, 2001 10:43 PM > > > Subject: Re: [PHP] is this syntax correct? > > > > > > > > > > I also tried this syntax: > > > > <?php > > > > global $test; > > > > $test = "foo"; > > > > session_register("test"); > > > > ?> > > > > > > > > and it still not work as when I go to next page, and try echo $test, > > > nothing > > > > come up. > > > > Jack > > > > [EMAIL PROTECTED] > > > > "There is nothing more rewarding than reaching the goal you set for > > > > yourself" > > > > ----- Original Message ----- > > > > From: Joseph Bannon <[EMAIL PROTECTED]> > > > > To: Jacky@lilst <[EMAIL PROTECTED]> > > > > Sent: Monday, April 02, 2001 3:44 AM > > > > Subject: RE: [PHP] is this syntax correct? > > > > > > > > > > > > > > So what is the right way to do? > > > > > > > > > > > > > > > I resent my email to the list. I've done mostly DB work, so I need to > > > know > > > > > what those functions do. > > > > > > > > > > J > > > > > > > > > > > > > > > > > > > > > > -- > > > > 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] >
hello, does anyone know if set_nonblock() works, what paramaters it takes and what it returns? there is only one mention of it in the manual under accept_connect, and I can not seem to set the socket to non block?? also has anybody successfully written a way to time out a read with the new socket fuctions I can not get this to work eithier. any help would be appreciated, regards, joseph
This is best done with a LEFT JOIN. Please read up the manual about it. ----- Original Message ----- From: "Maxim Maletsky" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "'PHP General List. (E-mail)'" <[EMAIL PROTECTED]> Sent: Tuesday, April 03, 2001 9:41 Subject: SQL : multiple SELECT and missing rows. > > Hello Guys, > > I have a (very simple?) SQL question. I'm more then sure the answer to it is > whether "just do this..." or "It's impossible man, how could you even get > that into your mind..." > > > > I have this database design: (it's more complex of course, but you get an > idea) > > > > Table 'accounts': > +-------+------+------------+ > | ID | type | since | > +-------+------+------------+ > | 00001 | P | 1999-08-01 | > | 00002 | F | 1999-11-06 | > | 00003 | S | 2000-07-05 | > | 00004 | P | 2001-01-01 | > +-------+------+------------+ > > > Table 'addresses': > +-------+--------------+------+---------+ > | ID | city | pref | country | > +-------+--------------+------+---------+ > | 00001 | Shibuya-ku | 13 | JP | > | 00002 | Nakano-ku | 13 | JP | > | 00004 | Toyonaka-shi | 27 | JP | > +-------+--------------+------+---------+ > > > > As you can see, the main data is in 'accounts', the 'addresses.ID' is UNIQUE > and corresponds to 'accounts.ID'. The fact is that not every account has an > address registered with it. > > > > I need to list ALL the accounts in this order: > > +---+------+-----+--------+-------+ > | ID | Type | City | Country | Since | > +---+------+-----+--------+-------+ > > > > Therefore I am trying to do it with the following query: > > > > SELECT > accounts.ID AS ID, > accounts.type AS Type, > addresses.city AS City, > addresses.country AS Country, > accounts.since AS Since > FROM > accounts, > addresses > WHERE > addresses.ID=accounts.ID > ORDER > BY > accounts.ID > ASC > LIMIT > 10 > ; > > > And, this selects me IDs 00001, 00002 and 00004. > 00003, obviously, is not here because there's no such address.ID as stated > in my WHERE clause. > > > > Can anyone suggest me how do I SELECT ALL of the accounts having simply NULL > on 'addresses.*' when there's no such row, instead of 'loosing' the whole > 'account' row? > > I sure know how to do it using two queries, still, I wonder if one single > query can do this job. > > Where do I miss the logic? > > > > Thanks in advance. > > -maxim > > > > > Maxim Maletsky - [EMAIL PROTECTED] > Webmaster, J-Door.com / J@pan Inc. > LINC Media, Inc. > TEL: 03-3499-2175 x 1271 > FAX: 03-3499-3109 > http://www.j-door.com > http://www.japaninc.net > http://www.lincmedia.co.jp > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
I've tried this with both PHP4.0.4 and PHP4.0.4pl1 as a module (it's for a daily script eventually). [root=pts/1]7:29pm@content:{/www/html/private/TattooShop}> ./odbc-test2.phtml #!/bin/php -q Segmentation fault the relevant part of phpinfo(); is below, so I'm assuming that I finally got odbc compiled into it: Configure Command './configure' '--with-iodbc=/usr/local/openlink/odbcsdk' '--with-mysql=/usr/local' '--with-config-file-path=/etc' ODBC ODBC library iodbc odbc.allow_persistent On odbc.check_persistent On odbc.default_db no value odbc.default_pw odbc.default_user no value odbc.defaultbinmode return as is odbc.defaultlrl return up to 4096 bytes odbc.max_links Unlimited odbc.max_persistent Unlimited here is the actual "odbc-test2.phtml" script, which is basically the one in the iODBC PHP install example: Commented lines are one's I've tried too with the same or worse results. Commenting out the odbc_* line(s) doesn't segfault, but then again, it's a useless script at that point too ;-) ---------------------- #!/bin/php -q <?php //phpinfo(); //putenv("LD_LIBRARY_PATH=/usr/local/openlink/odbcsdk/lib"); putenv("LD_LIBRARY_PATH=/usr/local/openlink/lib"); putenv("ODBCINSTINI=/usr/local/openlink/bin/odbcinst.ini"); putenv("ODBCINI=/usr/local/openlink/bin/odbc.ini"); $dsn="DSN=OpenLink"; // this is a valid DSN set up in the above odbc.ini file $user="daevid"; //default user for the demo database $password="secret"; //default password for demo database $sql="SELECT * FROM EMP"; $conn_id = odbc_pconnect("$dsn","$user","$password"); //$conn_id = odbc_connect("$dsn","$user","$password"); //$conn_id = odbc_connect("$dsn","",""); //$conn_id = odbc_connect("DSN=OpenLink;UID=daevid;PWD=secret","",""); ?> ---------------------- and here is the directory structure: [root=pts/2]7:33pm@content:{/usr/src/WT_Apache_Setup/php}> l /usr/local/openlink/odbcsdk/lib total 976 -rw-r--r-- 1 openlink openlink 143692 Mar 7 14:42 libiodbc.a -rwxr-xr-x 1 openlink openlink 669 Mar 7 14:42 libiodbc.la* lrwxrwxrwx 1 openlink openlink 17 Mar 30 15:16 libiodbc.so -> libiodbc.so.2.1.2* lrwxrwxrwx 1 openlink openlink 17 Mar 30 15:16 libiodbc.so.2 -> libiodbc.so.2.1.2* -rwxr-xr-x 1 openlink openlink 117877 Mar 7 14:42 libiodbc.so.2.1.2* -rw-r--r-- 1 openlink openlink 431992 Mar 7 14:42 oplodbc.a -rw-r--r-- 1 openlink openlink 678 Mar 7 14:42 oplodbc.la lrwxrwxrwx 1 openlink openlink 16 Mar 30 15:16 oplodbc.so -> oplodbc.so.1.0.0 lrwxrwxrwx 1 openlink openlink 16 Mar 30 15:16 oplodbc.so.1 -> oplodbc.so.1.0.0 -rw-r--r-- 1 openlink openlink 272057 Mar 7 14:42 oplodbc.so.1.0.0 [root=pts/2]7:33pm@content:{/usr/src/WT_Apache_Setup/php}> l /usr/local/openlink/lib total 400 -rwxr-xr-x 1 openlink openlink 669 Mar 7 14:43 libiodbc.la* lrwxrwxrwx 1 openlink openlink 17 Mar 30 15:16 libiodbc.so -> libiodbc.so.2.1.2* lrwxrwxrwx 1 openlink openlink 17 Mar 30 15:16 libiodbc.so.2 -> libiodbc.so.2.1.2* -rwxr-xr-x 1 openlink openlink 117877 Mar 7 14:43 libiodbc.so.2.1.2* lrwxrwxrwx 1 openlink openlink 17 Mar 30 15:16 libodbc.so -> libiodbc.so.2.1.2* -rw-r--r-- 1 openlink openlink 678 Mar 7 14:43 oplodbc.la lrwxrwxrwx 1 openlink openlink 16 Mar 30 15:16 oplodbc.so -> oplodbc.so.1.0.0 lrwxrwxrwx 1 openlink openlink 16 Mar 30 15:16 oplodbc.so.1 -> oplodbc.so.1.0.0 -rw-r--r-- 1 openlink openlink 272057 Mar 7 14:43 oplodbc.so.1.0.0 [root=pts/2]7:33pm@content:{/usr/src/WT_Apache_Setup/php}> l /usr/local/openlink/bin/ total 136 -rwxr--r-- 1 openlink openlink 23260 Mar 7 14:43 inifile* -rw-rw-rw- 1 openlink openlink 521 Apr 2 18:15 odbc.ini -rw-r--r-- 1 openlink openlink 473 Mar 7 14:43 odbc.ini.sample -rw-rw-rw- 1 openlink openlink 180 Mar 29 20:21 odbcinst.ini -rw-r--r-- 1 openlink openlink 170 Mar 7 14:43 odbcinst.ini.sample -rwxr-xr-x 1 openlink openlink 92225 Mar 7 14:43 odbctest* -rw-rw-rw- 1 openlink openlink 0 Mar 29 20:20 oplrqb.ini here is some other useful info: [root=pts/2]7:35pm@content:{/usr/local/openlink/bin}> cat odbc.ini [ODBC Data Sources] OpenLink = OpenLink Generic ODBC Driver [OpenLink] Driver = /usr/local/openlink/lib/oplodbc.so.1 Description = Sample OpenLink DSN Host = 10.2.3.11 ServerType = Oracle 8.1.x FetchBufferSize = 99 UserName = daevid Password = secret Database = mydatabase ServerOptions = ConnectOptions = Options = ReadOnly = yes Trace = 0 TraceFile = /tmp/iodbc.trace [Default] Driver = /usr/local/openlink/lib/oplodbc.so.1 Is "ServerType = Oracle 8.1.x" right? I'm trying to connect to a MS SQL2000 server on a Win2k box: [root=pts/2]7:35pm@content:{/usr/local/openlink/bin}> cat odbcinst.ini [ODBC Drivers] OpenLink Generic ODBC Driver = Installed [OpenLink Generic ODBC Driver] Driver = /usr/local/openlink/lib/oplodbc.so.1 Setup = /usr/local/openlink/lib/oplodbc.so.1 [root=pts/2]7:35pm@content:{/usr/local/openlink/bin}> ./odbctest OpenLink ODBC Demonstration program This program shows an interactive SQL processor Enter ODBC connect string (? shows list): ? DSN | Description --------------------------------------------------------------- OpenLink | OpenLink (MT) Enter ODBC connect string (? shows list): OpenLink [iODBC][Driver Manager]Dialog failed, SQLSTATE=IM008 Have a nice day.
Hi Experts, It seems to me that, the topic is not attractive or challenging that makes nobody come to problem. But I really hope those experts or experiance ppl can give me ur hands. Please Help! I'm planning to build a template but failed to do so.... Here is the code: <? include "class.FastTemplate.php"; $tpl = new FastTemplate("../usr/local/apache/htdocs/toplevel.tpl"); $tpl->define(array("toplevel" => "toplevel.tpl")); $tpl->assign("title", "R U THEre"); $tpl->assign("content", "try this out"); $tpl->parse("main", "toplevel"); $tpl->FastPrint(); ?> error: Warning: Failed opening 'class.FastTemplate.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr/local/apache/htdocs/tem.php on line 3 Fatal error: Cannot instantiate non-existent class: fasttemplate in /usr/local/apache/htdocs/tem.php on line 5 Please consult, thanks... E K _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
In a message dated 03/04/2001 03:52:47 GMT Daylight Time, [EMAIL PROTECTED] writes: << include "class.FastTemplate.php"; >> Just for a start, I didn`t notice anything else in the code... include ("class.FastTemplate.php"); Ade
"E K L" <[EMAIL PROTECTED]> wrote: > $tpl = new FastTemplate("../usr/local/apache/htdocs/toplevel.tpl"); According to the error, the path above is incorrect. Looking at it, my guess is that the path might really be: "/usr/local/apache/htdocs/toplevel.tpl" -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
I'd check where "class.FastTemplate.php" is located in relation to the current file you are running. Fully qualify the path for the "include" statement. Also, what are the permissions on this file? Are they readable by the apache user? > -----Original Message----- > From: E K L [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, 3 April 2001 12:52 > To: [EMAIL PROTECTED] > Subject: [PHP] Please Help! > > > Hi Experts, > > It seems to me that, the topic is not attractive or challenging > that makes > nobody come to problem. But I really hope those experts or experiance ppl > can give me ur hands. Please Help! > > I'm planning to build a template but failed to do so.... > > Here is the code: > > <? > > include "class.FastTemplate.php"; > > $tpl = new FastTemplate("../usr/local/apache/htdocs/toplevel.tpl"); > > $tpl->define(array("toplevel" => "toplevel.tpl")); > > $tpl->assign("title", "R U THEre"); > $tpl->assign("content", "try this out"); > > $tpl->parse("main", "toplevel"); > > $tpl->FastPrint(); > > ?> > > error: > Warning: Failed opening 'class.FastTemplate.php' for inclusion > (include_path='.:/usr/local/lib/php') in > /usr/local/apache/htdocs/tem.php on > line 3 > > Fatal error: Cannot instantiate non-existent class: fasttemplate in > /usr/local/apache/htdocs/tem.php on line 5 > > Please consult, thanks... > > E K > > _________________________________________________________________________ > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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] >
Daevid, connection script snipped (looked fine) > $dsn="DSN=OpenLink"; // this is a valid DSN set up in the above odbc.ini > //$conn_id = odbc_connect("DSN=OpenLink;UID=daevid;PWD=secret","",""); > ?> > ---------------------- > > [OpenLink] > Driver = /usr/local/openlink/lib/oplodbc.so.1 > Description = Sample OpenLink DSN > Host = 10.2.3.11 > ServerType = Oracle 8.1.x > FetchBufferSize = 99 > UserName = daevid > Password = secret > Database = mydatabase > ServerOptions = > ConnectOptions = > Options = > ReadOnly = yes > Trace = 0 > TraceFile = /tmp/iodbc.trace > > [Default] > Driver = /usr/local/openlink/lib/oplodbc.so.1 > > Is "ServerType = Oracle 8.1.x" right? > I'm trying to connect to a MS SQL2000 server on a Win2k box: No, that is just a sample DSN - you will want to edit it to match your configureation or add an additional one wiht server type SQLServer 2000 Database is the sqlserver catalog, e.g. northwind, pubs, or yours. When adding a DSN, add a matching section at the top as well: [ODBC Data Sources] OpenLink = OpenLink Generic ODBC Driver //o SQLServer2k [SQLServer2k] Driver = /usr/local/openlink/lib/oplodbc.so.1 Host = 10.2.3.11 FetchBufferSize = 99 ServerType = SQLServer2000 UserName = daevid Password = secret Database = mydatabase You can add the other options as you see fit, or even override these by setting the RulesBook on the server side. Everything else looks fine. This assumes you have the server-side components of our Multi-Tier driver installed on the SQLServer box. It might be wise to add a DSN on the server using the OpenLink driver, to test you have the server-side components installed properly. If you've not yet installed them, the SQLServer agent / Request Broker components are at: http://www.openlinksw.com/software/open40/ntadmzzz.zip Checking the docs out for configuring OpenLink Drivers might not hurt either, and might have saved you time setting up your initial connection: http://www.openlinksw.com/info/docs/rel4doc/index.html > > [root=pts/2]7:35pm@content:{/usr/local/openlink/bin}> cat odbcinst.ini > [ODBC Drivers] > OpenLink Generic ODBC Driver = Installed > > [OpenLink Generic ODBC Driver] > Driver = /usr/local/openlink/lib/oplodbc.so.1 > Setup = /usr/local/openlink/lib/oplodbc.so.1 > > [root=pts/2]7:35pm@content:{/usr/local/openlink/bin}> ./odbctest > OpenLink ODBC Demonstration program > This program shows an interactive SQL processor > > Enter ODBC connect string (? shows list): ? > > DSN | Description > --------------------------------------------------------------- > OpenLink | OpenLink (MT) > > Enter ODBC connect string (? shows list): OpenLink > [iODBC][Driver Manager]Dialog failed, SQLSTATE=IM008 Syntax problem here - odbctest takes the argument "DSN=DSN_Name", not just the DSN_Name > > Have a nice day. > You obviously have the ODBCINI set properly in the environmnet, or odbctest wouldn't show your DSNs. So fix the ServerType, ensure working server-side components, and change your connection syntax for odbctest - you actually are just about there. Let me know if you need additional assistance. Best regards, Andrew --------------------------------------- Andrew Hill - OpenLink Software Director Technology Evangelism eBusiness Infrastructure Technology http://www.openlinksw.com
I ran into this problem last week. I finally punted. My configuration is: RH7, Apache 1.3.19, MySQL 3.23.36, mod_auth_mysql 2.20. The strange thing is that I did not have any problems with RH6.0, Apache1.3.12, MySQL 3.22.x, and mod_auth_mysql 2.20. If you run into a fix, please copy me as well... /dkm ----- Original Message ----- From: "Daevid Vincent" <[EMAIL PROTECTED]> To: "PHP General" <[EMAIL PROTECTED]> Sent: Thursday, March 29, 2001 11:36 PM Subject: [PHP] mod_auth_mysql 2.20 won't compile with newer Apache and alloc.h vs ap_alloc.h > trying to get Apache to compile with this keeps failing, complaining about > "alloc.h" it seems. I notice that apache calls it "ap_alloc.h" now, but the > only reference in mod_auth _mysql is in: > > apMakefile.tmpl: $(INCDIR)/alloc.h $(INCDIR)/buff.h \ > > but changing that doesn't fix the problem... > > this has been going on since like apache 1.3.1x and there is no newer > mod_auth_mysql that I've found. I fixed this before, but I can't remember > what I did. Could you please tell me how to fix this, and then put up a > fixed version of mod_auth_mysql so other's don't run into this problem? > > apache 1.3.19, linux RH6.2, mysql, mod_auth_mysql 2.20: > > ===> src/modules/auth_mysql > make[4]: *** No rule to make target `../../include/alloc.h', needed by > `mod_auth_mysql.o'. Stop. > make[3]: *** [all] Error 1 > make[2]: *** [subdirs] Error 1 > make[2]: Leaving directory `/data/usr/src/WT_Apache_Setup/apache_1.3.19/src' > make[1]: *** [build-std] Error 2 > make[1]: Leaving directory `/data/usr/src/WT_Apache_Setup/apache_1.3.19' > make: *** [build] Error 2 > > > > > -- > 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]
my solution was actually kinda simple if you think about it... make a symbolic link. It sure would have been nice if Zeev would just release a new .tarball liek v2.21 that fixes this little annoyance. It seemed that no matter how often I changed the makefile in mod_auth_apache, it still reverted back to the "alloc.h" one. So if you can't bring Muhamed to the mountain... [root=pts/2]8:24pm@content:{/usr/src/apache/src/include}> ll total 332 lrwxrwxrwx 1 root root 10 Mar 29 19:37 alloc.h -> ap_alloc.h -rw-r--r-- 1 root root 16367 Feb 3 12:14 ap_alloc.h > -----Original Message----- > From: Dennis Moore [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 02, 2001 8:28 PM > To: Daevid Vincent; PHP General > Subject: Re: [PHP] mod_auth_mysql 2.20 won't compile with newer Apache > and alloc.h vs ap_alloc.h > > > I ran into this problem last week. I finally punted. My configuration > is: RH7, Apache 1.3.19, MySQL 3.23.36, mod_auth_mysql 2.20. The strange > thing is that I did not have any problems with RH6.0, Apache1.3.12, MySQL > 3.22.x, and mod_auth_mysql 2.20. > > If you run into a fix, please copy me as well... > > /dkm > > > > ----- Original Message ----- > From: "Daevid Vincent" <[EMAIL PROTECTED]> > To: "PHP General" <[EMAIL PROTECTED]> > Sent: Thursday, March 29, 2001 11:36 PM > Subject: [PHP] mod_auth_mysql 2.20 won't compile with newer Apache and > alloc.h vs ap_alloc.h > > > > trying to get Apache to compile with this keeps failing, > complaining about > > "alloc.h" it seems. I notice that apache calls it "ap_alloc.h" now, but > the > > only reference in mod_auth _mysql is in: > > > > apMakefile.tmpl: $(INCDIR)/alloc.h $(INCDIR)/buff.h \ > > > > but changing that doesn't fix the problem... > > > > this has been going on since like apache 1.3.1x and there is no newer > > mod_auth_mysql that I've found. I fixed this before, but I > can't remember > > what I did. Could you please tell me how to fix this, and then put up a > > fixed version of mod_auth_mysql so other's don't run into this problem? > > > > apache 1.3.19, linux RH6.2, mysql, mod_auth_mysql 2.20: > > > > ===> src/modules/auth_mysql > > make[4]: *** No rule to make target `../../include/alloc.h', needed by > > `mod_auth_mysql.o'. Stop. > > make[3]: *** [all] Error 1 > > make[2]: *** [subdirs] Error 1 > > make[2]: Leaving directory > `/data/usr/src/WT_Apache_Setup/apache_1.3.19/src' > > make[1]: *** [build-std] Error 2 > > make[1]: Leaving directory `/data/usr/src/WT_Apache_Setup/apache_1.3.19' > > make: *** [build] Error 2 > > > > > > > > > > -- > > 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] >
Ok so i've got a nice little game site and some folks want to start hosting their websites on my machine. I let a few here and a couple there and now my machine has more folks on it doing more things than I've got a handle on. Yes I did a bad thing. Most of them are there because of the PHP and mysql which I've setup and let them use. so on and so forth. What I need now is some help getting this situation under control. I know this is not a unix admin forum but I've seen several posts from folks with hosting experience. I don't charge any money for folks to use my server and I don't want to start. If anyone has some experience setting up a system to host websites (many virtual domains) and is willing to spend a little time giving me some pointers on how to lock down a system while still allowing folks the ability to, for the most part, painlessly maintain their website, I would be very much in that person's debt. Please email me privately if you are willing to help. thanks much, Michael Roark p.s. if there is a faq/tutorial/set of guidelines out there on the web feel free to just send me a link and say RTFM. I've not found anything yet.
>p.s. if there is a faq/tutorial/set of guidelines out there on the web >feel free to just send me a link and say RTFM. I've not found anything yet. Try www.devshed.com Has some nice stuff.. Read the HOWTO's.. Install SSH and a secure FTP server with the ability to chroot people.. like ProFTPD (www.proftpd.org). Remove telnet, they can use SSH instead. Read about MySQL security (www.mysql.com) but also some info on devshed.com Have a lot of fun.. Bye, B.
can anyone help me in making a webpage (php) that shows the results of a MySQL database search? the search must be made using a form... thank you very much Joao Monteiro
>can anyone help me in making a webpage (php) that shows the results of a >MySQL database search? >the search must be made using a form... Take a look at webmonkey www.devshed.com www.phpbuilder.com www.phpbeginner.com www.phpworld.com But also on www.php.net .... many scripts can be found to do what you want. Bye, B.
Hiya i've got a script that basically draws values from a db and will display them, as i have multiple records in there and want to display them all i'm using a while ( ($myrow = mysql_fetch_array($result) ) ) statement this is all good as far as it will display them all how ever when i to be able to update the fields as well as display them .. sounds easy to do i know .. but for some reason my id value gets sent to the server as "id=++" can some one offer any suggestions as to why this is as when i view the source it lists the vaules as 1 2 3 etc. Thanks Peter Houchin [EMAIL PROTECTED] ========================================================= _____ __ /\ /_/_/_\ / |_/ \ /_/_/_ __ __ __ __ / \ \_/_/_\ /_/ /_/ /_/ /_/ \ _ / ___\_\_\/ /_/_/_/ /_//\/_/ \_/ \/\_/ \_//_/_/ /_/_/_/ /_/ \/_/ v ________ ________________________________________ /_/_/_/_/ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ /_/_ _/_/ ______ __ __ /_/ ____ __ ______ /_/_/_/_/ /_/_/_/ /_/ /_/ /_/ /_/\_\ /_/ /_/_/_/ /_/ \_\ /_/ _/ /_//\/_/ /_/ /_/__\_\ /_/___ _\_\_\ /_/ \_\/_/_/_/ /_/ \/_/ /_/ /_/ \_\/_/_/_//_/_/_/ ========================================================= Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755 ************* We rent the dot in .COM! **************
G'Day, You need to have an auto_incrementing field in your database. Then all lines that are displayed need to be in the form of fieldname[] so that PHP builds an array. Then you need a hidden field to represent the unique record number to be updated. Here is some code that I use to print out a list of products by category, and allow me to do mass updates on any of the information present, except the unique id. It then goes through a while loop to UPDATE TABLE for each record. Code follows: <!-- START CODE --> <html><head><title>Product Admin Page</title></head> <body BGCOLOR="white"> <!-- Product Administration page --> <? // FUNCTION DEF function showitems($prod,$cat) { // show all items in the product database, optionally sorted // selected by category or product id including '%' wildcard $mylink = mysql_connect(); mysql_select_db('printcart',$mylink); // select * from product where category like 'postcard' and prodid like '%' ($prod == '') ? $prod = '%' : $prod; ($cat == '') ? $cat = '%' : $cat; $query = "SELECT * FROM product WHERE category LIKE '$cat' AND prodid LIKE '$prod' order by category, prodid"; $myresult = mysql_query($query,$mylink); // build table and show all items in form fields print ' <form name="showitems" action="prodadmin.php?update" method="post"> <table bgcolor="#EEEEEE" border="1"><tr> <th>ProdID</th><th>Product Name</th><th>Product Description</th> <th>Unit</th><th>Price</th><th>Minimum Order</th><th>Packaged</th><th>Category</th></tr> '; while($row = mysql_fetch_array($myresult)) { print "<tr><td><input type=\"hidden\" name=\"id[]\" value=\"$row[prodid]\" > <font size=\"2\">$row[prodid]</font></t d>\n"; print "<td align=\"center\"><font size=\"2\"><input type=\"text\" name=\"name[]\" value=\"$row[prodname]\" ></font>< /td>\n"; print "<td align=\"center\"><font size=\"2\"><input type=\"text\" name=\"desc[]\" value=\"$row[proddesc]\" ></font>< /td>\n"; print "<td align=\"center\"><font size=\"2\"><input type=\"text\" name=\"unit[]\" value=\"$row[unit]\" size=\"6\"></ font></td>\n"; print "<td align=\"center\"><font size=\"2\"><input type=\"text\" name=\"price[]\" value=\"$row[price]\" size=\"6\"> </font></td>\n"; print "<td align=\"center\"><font size=\"2\"><input type=\"text\" name=\"minorder[]\" value=\"$row[minorder]\" size= \"5\"></font></td>\n"; print "<td align=\"center\"><font size=\"2\"><input type=\"text\" name=\"packaged[]\" value=\"$row[packaged]\" size= \"5\"></font></td>\n"; print "<td><font size=\"2\"><input type=\"text\" name=\"category[]\" value=\"$row[category]\" ></font></td></tr>\n"; } print '</table>'; print '<input type="submit" name="update" value="Update">'; print '<input type="hidden" name="cat" value="' . $cat . '">'; print '<input type="hidden" name="prod" value="' . $prod . '">'; print '</form>'; } // FUNCTION function updateproducts() { global $name,$id,$unit,$price,$category,$desc,$minorder,$packaged; $mylink = mysql_connect(); mysql_select_db('printcart', $mylink); $numrows = count($id); for ($i = 0; $i < $numrows; ++$i) { if($desc[$i] == '' ) { $desc[$i] = $name[$i]; } $line = "UPDATE product SET prodname='${name[$i]}',"; $line .= "proddesc='${desc[$i]}',"; $line .= "unit='${unit[$i]}',"; $line .= "price='${price[$i]}',"; $line .= "category='${category[$i]}', "; $line .= "minorder='${minorder[$i]}', "; $line .= "packaged='${packaged[$i]}' "; $line .= "WHERE prodid='${id[$i]}'"; $myresult = mysql_query($line,$mylink); print mysql_error($mylink); } } ?> <form NAME="filter" ACTION="prodadmin.php"> Product id is: <input TYPE="text" NAME="prod" VALUE="<? print $prod ?>"><br> Category is: <!-- <input type="text" name="cat" value="<? print $cat ?>">--> <select NAME="cat"> <? $catq = "select category,c.name from product,category as c where category=c.ckey group by c.name order by category"; $link = mysql_connect(); mysql_select_db('printcart',$link); $catsr = mysql_query($catq,$link); while(list($catop,$catname) = mysql_fetch_array($catsr)) { if($catop == $cat) { $select = "selected"; } else { $select = ""; } print "<option value=\"$catop\" $select>$catname</option>\n"; } ?> <option VALUE="%">%wildcard</option> </select> <br> <font SIZE="-1">(you may use the '%' as a wildcard for matching a portion of the code or category)</font><br><br> Too display all items, enter % into both fields. <br> <br> <input TYPE=submit VALUE="Get Matches"> </form> <? // Begin MAIN if(isset($update)) { updateproducts(); showitems($prod,$cat); } elseif(isset($prod) OR isset($cat)) { showitems($prod,$cat); } ?> </body></html> <!-- END CODE --> You should be able to get the gist of it ;) On 4/2/01 9:42 PM, "Peter Houchin" <[EMAIL PROTECTED]> wrote: > Hiya i've got a script that basically draws values from a db and will display > them, as i have multiple records in there and want to display them all i'm > using a > while ( ($myrow = mysql_fetch_array($result) ) ) statement this is all good > as far as it will display them all how ever when i to be able to update the > fields as well as display them .. sounds easy to do i know .. but for some > reason my id value gets sent to the server as "id=++" can some one offer any > suggestions as to why this is as when i view the source it lists the vaules as > 1 2 3 etc. > > Thanks > Peter Houchin > [EMAIL PROTECTED] > ========================================================= > _____ __ /\ > /_/_/_\ / |_/ \ > /_/_/_ __ __ __ __ / \ > \_/_/_\ /_/ /_/ /_/ /_/ \ _ / > ___\_\_\/ /_/_/_/ /_//\/_/ \_/ \/\_/ > \_//_/_/ /_/_/_/ /_/ \/_/ v > ________ ________________________________________ > /_/_/_/_/ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ > /_/_ _/_/ ______ __ __ /_/ ____ __ ______ > /_/_/_/_/ /_/_/_/ /_/ /_/ /_/ /_/\_\ /_/ /_/_/_/ > /_/ \_\ /_/ _/ /_//\/_/ /_/ /_/__\_\ /_/___ _\_\_\ > /_/ \_\/_/_/_/ /_/ \/_/ /_/ /_/ \_\/_/_/_//_/_/_/ > ========================================================= > Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755 > ************* We rent the dot in .COM! ************** > >
Not test your code with GIF yet (I not have GIF support). In your book they have a result picture of this code ? I try this by change imagegif($image) to imagepng($image) and return blank image with specify width. -- -Tuna- ""Thalis A. Kalfigopoulos"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Mon, 2 Apr 2001, Thalis A. Kalfigopoulos wrote: > > > Thank you very much, really appreciate it. But I have to admit that I have an example from a book in which he creates a gif (and not a png), where he doesn't actually have to allocate a color. He only has 3 lines which are supposed to work. Maybe true for gif, but cannot tell, since I don't have gif support. > > > > header("Content-type: image/gif"); > > $image= imagecreate(200,200)l > > imageRectangle($image, 50, 50, 150, 150, $blue); > > Sorry mistake. 3-line code of example was: > > header("Content-type: image/gif"); > $image= imagecreate(200,200); > imagegif($image); > > cheers, > thalis > > > > > > > I make change of your code by move some line to correct line and it's > > > work. > > > Here this a code > > > > > > <?PHP > > > header("Content-type: image/png"); > > > $image= imagecreate(200,200) or die("Failed in call to > > > imagecreate()<BR>\n"); > > > $blue = imageColorAllocate($image,0,0,255); > > > imageRectangle($image, 50, 50, 150, 150, $blue); > > > imagepng($image); //---- I MOVE THIS LINE > > > imagedestroy($image); > > > ?> > > > > > > Hope this will help. > > > -Tuna- > > > -- > 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] >
Hey you guys! I'm a new girl at this, and wondering on a question that might be simple for you. Yesturday I started to learn PHP and proud I showed it to a friend of mine, what I had learned. The first thing he did was check the safity of it and very easy he found the list over all the users of the server, f.ex. I'm glad I didn't upload the new pages as frontpages yet =) What can I do to prevent this and how can I build the pages safer than they are today? Perhaps it would be a good ide to learn basic Linux, I'm also considering to buy another computer to use with Linux. Greetings, Marthe -http://www.marthe.com (under construction!)
Not much to go on here. Basically don't do whatever it was you did. And yes, understanding the environment you are working in, both the OS and PHP and whatever 3rd party stuff you hook PHP up to is the first step to making stuff secure. -Rasmus On Tue, 3 Apr 2001, Marthe Kristiansen wrote: > Hey you guys! > > I'm a new girl at this, and wondering on a question that might be simple for > you. > Yesturday I started to learn PHP and proud I showed it to a friend of mine, > what I had learned. > The first thing he did was check the safity of it and very easy he found the > list over all the users of the server, f.ex. > I'm glad I didn't upload the new pages as frontpages yet =) > What can I do to prevent this and how can I build the pages safer than they > are today? > Perhaps it would be a good ide to learn basic Linux, I'm also considering to > buy another computer to use with Linux. > > Greetings, > Marthe > > -http://www.marthe.com (under construction!) > > > -- > 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] >
Hey Marthe, Do you know what he did? The problem may not have been a "PHP" problem as much as a design or security issue...if you could include some code, or tell us what he actually did, we might be able to explain a) why its a problem or b) why its not a PHP issue... best regards, jack Marthe Kristiansen wrote: > > Hey you guys! > > I'm a new girl at this, and wondering on a question that might be simple for > you. > Yesturday I started to learn PHP and proud I showed it to a friend of mine, > what I had learned. > The first thing he did was check the safity of it and very easy he found the > list over all the users of the server, f.ex. > I'm glad I didn't upload the new pages as frontpages yet =) > What can I do to prevent this and how can I build the pages safer than they > are today? > Perhaps it would be a good ide to learn basic Linux, I'm also considering to > buy another computer to use with Linux. > > Greetings, > Marthe > > -http://www.marthe.com (under construction!) > > -- > 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]
Well, since I'm a newbie and also Norwegian it ain't that easy to explain very simple. What he did was that he entered a file that showed all the users of the server, as I said, and he told me this was kindof insecure. To prevent it he showed me a code that would help a bit. $filename=str_replace("..","",$filename); $filename=str_replace("/","",$filename); $filename=str_replace("%20","",$filename); He used /, .. and %20 to reach this file on my server. /Marthe -----Original Message----- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 03, 2001 7:44 AM To: Marthe Kristiansen Cc: Php-General Subject: Re: [PHP] Safety with PHP. Not much to go on here. Basically don't do whatever it was you did. And yes, understanding the environment you are working in, both the OS and PHP and whatever 3rd party stuff you hook PHP up to is the first step to making stuff secure. -Rasmus On Tue, 3 Apr 2001, Marthe Kristiansen wrote: > Hey you guys! > > I'm a new girl at this, and wondering on a question that might be simple for > you. > Yesturday I started to learn PHP and proud I showed it to a friend of mine, > what I had learned. > The first thing he did was check the safity of it and very easy he found the > list over all the users of the server, f.ex. > I'm glad I didn't upload the new pages as frontpages yet =) > What can I do to prevent this and how can I build the pages safer than they > are today? > Perhaps it would be a good ide to learn basic Linux, I'm also considering to > buy another computer to use with Linux. > > Greetings, > Marthe > > -http://www.marthe.com (under construction!) > > > -- > 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]
So you wrote a script that took a filename as an argument somehow and did something with it? That's always going to be insecure unless you do a lot of error checking on it. -Rasmus On Tue, 3 Apr 2001, Marthe Kristiansen wrote: > Well, since I'm a newbie and also Norwegian it ain't that easy to explain > very simple. > What he did was that he entered a file that showed all the users of the > server, as I said, and he told me this was kindof insecure. > To prevent it he showed me a code that would help a bit. > > $filename=str_replace("..","",$filename); > $filename=str_replace("/","",$filename); > $filename=str_replace("%20","",$filename); > > He used /, .. and %20 to reach this file on my server. > > /Marthe
Of course, you can always disable certain functions, etc, that you deem to insecure. PHP is as secure as you make it. ~Nuff said Jason Lotito www.NewbieNetwork.net Where those who can, teach; and those who can, learn. > -----Original Message----- > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 02, 2001 10:54 PM > To: Marthe Kristiansen > Cc: Php-General > Subject: RE: [PHP] Safety with PHP. > > > So you wrote a script that took a filename as an argument somehow and did > something with it? That's always going to be insecure unless you do a lot > of error checking on it. > > -Rasmus > > On Tue, 3 Apr 2001, Marthe Kristiansen wrote: > > > Well, since I'm a newbie and also Norwegian it ain't that easy > to explain > > very simple. > > What he did was that he entered a file that showed all the users of the > > server, as I said, and he told me this was kindof insecure. > > To prevent it he showed me a code that would help a bit. > > > > $filename=str_replace("..","",$filename); > > $filename=str_replace("/","",$filename); > > $filename=str_replace("%20","",$filename); > > > > He used /, .. and %20 to reach this file on my server. > > > > /Marthe > > > -- > 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] > >
Is there an easy way to do this when I'm so new at this that I don't quite understand what I'm doing wrong and how to prevent all those mistakes in the beginning? /Marthe -----Original Message----- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 03, 2001 7:54 AM To: Marthe Kristiansen Cc: Php-General Subject: RE: [PHP] Safety with PHP. So you wrote a script that took a filename as an argument somehow and did something with it? That's always going to be insecure unless you do a lot of error checking on it. -Rasmus On Tue, 3 Apr 2001, Marthe Kristiansen wrote: > Well, since I'm a newbie and also Norwegian it ain't that easy to explain > very simple. > What he did was that he entered a file that showed all the users of the > server, as I said, and he told me this was kindof insecure. > To prevent it he showed me a code that would help a bit. > > $filename=str_replace("..","",$filename); > $filename=str_replace("/","",$filename); > $filename=str_replace("%20","",$filename); > > He used /, .. and %20 to reach this file on my server. > > /Marthe
If you could post the actual thing that he did, the actual script, that would be helpful. Jason Lotito www.NewbieNetwork.net Where those who can, teach; and those who can, learn. > -----Original Message----- > From: Marthe Kristiansen [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 02, 2001 11:05 PM > To: Php-General > Subject: RE: [PHP] Safety with PHP. > > > Is there an easy way to do this when I'm so new at this that I don't quite > understand what I'm doing wrong and how to prevent all those > mistakes in the > beginning? > > /Marthe
@ 1:54:08 AM on 4/3/2001, Rasmus Lerdorf wrote: RL> So you wrote a script that took a filename as an argument somehow and did RL> something with it? That's always going to be insecure unless you do a lot RL> of error checking on it. ... RL> On Tue, 3 Apr 2001, Marthe Kristiansen wrote: ... >> $filename=str_replace("..","",$filename); >> $filename=str_replace("/","",$filename); >> $filename=str_replace("%20","",$filename); >> >> He used /, .. and %20 to reach this file on my server. As a matter of fact, you can get the same result in just about anything. If he doesn't realize the same thing can be done in, for example, Perl, he shouldn't even be auditing anything in the first place. What you've described is _certainly_ not limited to PHP. -Brian -- PGP is spoken here: 0xE4D0C7C8 Please do not carbon copy me on list replies.
Marthe, if you post the script we can all get to the bottom of this pretty quickly. You have a lot of expertise here ready to help. Just copy and paste it into your email. BTW, you should remove it from your site before you post it, if at all possible. Good luck. ............................................................................ Les Neste 678-778-0382 http://www.lesneste.com
This is not PHP problems but it's a programming problems. Just paste your code here and remove the original one on you site. Many people here will help. -- -Tuna- ""Marthe Kristiansen"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hey you guys! > > I'm a new girl at this, and wondering on a question that might be simple for > you. > Yesturday I started to learn PHP and proud I showed it to a friend of mine, > what I had learned. > The first thing he did was check the safity of it and very easy he found the > list over all the users of the server, f.ex. > I'm glad I didn't upload the new pages as frontpages yet =) > What can I do to prevent this and how can I build the pages safer than they > are today? > Perhaps it would be a good ide to learn basic Linux, I'm also considering to > buy another computer to use with Linux. > > Greetings, > Marthe > > -http://www.marthe.com (under construction!) > > > -- > 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] >
Hi, I'm using PHP4.04pl1 as an Apache module. I just wrote some code which calls ctype_alpha() and got the message Fatal error: Call to undefined function: ctype_alpha() in /usr/local/lesneste/requestpwd.php on line 80 Is this function truly non-existent or is there some compile-time setting I need to enable to include these functions in the build? Here's my phpinfo(). Thanks in advance. System Linux tsunami 2.2.14-5.0 #1 Tue Mar 7 20:53:41 EST 2000 i586 unknown Build Date Mar 8 2001 Configure Command './configure' '--with-apache=/usr/local/samba/shared/preinstall/Apachetoolbox-1.5.13a/apac he_1.3.19' '--enable-exif' '--enable-memory-limit=yes' '--enable-track-vars' '--with-calendar=shared' '--enable-safe-mode' '--enable-magic-quotes' '--enable-trans-sid' '--enable-wddx' '--enable-ftp' '--with-mcrypt' '--with-mhash' '--with-mysql=/usr' '--with-pgsql' ............................................................................ Les Neste 678-778-0382 http://www.lesneste.com
Hi Les, @ 2:38:17 AM on 4/3/2001, Les Neste wrote: LN> Hi, I'm using PHP4.04pl1 as an Apache module. I just wrote some LN> code which calls ctype_alpha() and got the message LN> Fatal error: LN> Call to undefined function: ctype_alpha() in LN> /usr/local/lesneste/requestpwd.php on line 80 LN> Is this function truly non-existent or is there some compile-time setting I LN> need to enable to include these functions in the build? Here's my LN> phpinfo(). Thanks in advance. ... % pwd /usr/local/src/lang/php4-200101200145 % ./configure --help | egrep ctype --enable-ctype Enable ctype support % Maybe.. I've never used it. -Brian -- PGP is spoken here: 0xE4D0C7C8 Please do not carbon copy me on list replies.
I have this problem ? I want to connect to the Informix database on Unix server and my apache server running on Windows 2000 but I haven't php_ifx.dll. Please if you want send me. Thanx. Roman
foreach doesn't work in Linux-Apache and OK in Win with IIS: Fatal error: Call to unsupported or undefined function foreach() in ... My code: foreach ($lineas as $key => $value) { if (strpos($value,";".$idf.";")>0) { print "<tr bgcolor=$colorfila>"; $fila=split(";",$value); foreach ($fila as $celda => $c) print "<td>".$c."</td>"; print "</tr>"; $contador++; if ($colorfila=="eeeeee"){ $colorfila="ffffff";} else {$colorfila="eeeeee";} }; } I need a solution please! Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at http://www.eudoramail.com
> Fatal error: Call to unsupported or undefined function > foreach() in ... You're probably using PHP3 on that Apache server. Jason -- Jason Murray [EMAIL PROTECTED] Web Design Team, Melbourne IT Fetch the comfy chair!
hi, i'm in the body of a html page, and I'd like to redirect to a new URL in an if() statement. I *could* re-write the whole page so that the test is in the head, and use meta tags to refresh, but i'd rather not... the code will be heaps cleaner without it. thanks Justin French
if you're trying to redirect with something like header, then you need to do that redirection before any output is sent to the browser...(note, ANY output, likes SPACES) look at www.php.net/header if you're interested... jack Justin French wrote: > > hi, i'm in the body of a html page, and I'd like to > redirect to a new URL in an if() statement. > > I *could* re-write the whole page so that the test > is in the head, and use meta tags to refresh, but > i'd rather not... the code will be heaps cleaner > without it. > > thanks > > Justin French > > -- > 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]
On Mon, Apr 02, 2001 at 05:15:26PM +0200, Martin Skjöldebrand wrote: > I'm afraid I dont quite under stand the output you gave (maybe ... or do > you mean var_dump included the number of the array elements?) First I echoed the number, then var_dump() also printed it, try var_dump yourself. Stig
Hi! system(), exec(), popen() and similar has been disabled in the system I'm working on, if that's what you're talking about. :( I can't read the temp file because it's created in PHP's UID which is not the same as the script's. I also tried the FTP approach, but apparently the files written with FTP can't be manipulated with PHP. Can't create new files and can't unlink the old! No permission. I must admit I've come to hate the web hotel this is all running on! Thanks! -- -- Intent A/S Tais M. Hansen Web Developer ""John Almberg"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Howdy, > You should be able to read this file using the file system functions. The > PHP process (if it is set up properly) should have read access to this > directory. The problem you will have is *writing* it to your own directory, > as the PHP process probably *doesn't* have write access to your directory > structure. The way I got around this was to read the tmp file with the file > system, and write it using FTP (which can log in to your area.) > > Hope this helps. > John
SOLVED! Setting TMPDIR="site-specific-upload-directory" at execution time of the PHP parser, made it work. The directory must have a+rwx though! -- -- Intent A/S Tais M. Hansen Web Developer ""[Intent A/S] Tais M. Hansen"" <[EMAIL PROTECTED]> wrote in message 9abu1j$99q$[EMAIL PROTECTED]">news:9abu1j$99q$[EMAIL PROTECTED]... > Hi! > system(), exec(), popen() and similar has been disabled in the system I'm > working on, if that's what you're talking about. :( > I can't read the temp file because it's created in PHP's UID which is not > the same as the script's. I also tried the FTP approach, but apparently the > files written with FTP can't be manipulated with PHP. Can't create new files > and can't unlink the old! No permission. > I must admit I've come to hate the web hotel this is all running on! > > Thanks! > -- > Intent A/S > Tais M. Hansen > Web Developer
Hello, I am trying to validate the email address in my PHP program using the ereg function. I have different combinations of regular expressions to get the chunks of the email substring before and after the @ symbol and the dot (.) character. However, this does not seem to work. Can anyone suggest a method using ereg or otherwise to validate the email address in a PHP program? Regards, Sharat Hegde
i've only been using the php image functions for about a week now. i understand that jpegs have their own custom color pallette. so whenever i want to add something to an existing jpeg, the only colors i have to work with are the ones that are already defined. hence the purpose of imagecolorclosest(). at least this is how i understand things. so, for example, if i'm working with a jpeg that mostly uses dark colors, attempting to add white text to it doesn't always come out as bright as i'd like. is there any way around this without switching to a different image format or making system calls to something more advance like imagemagick? is it not possible to expand the color pallette after doing an imagecreatefromjpeg()? -jr
Try register globals off, see if it helps. (You need to use $HTTP_SESSION_VARS) I always set track vars to on (It's always on from 4.0.3(?), if I remember correctly), register globals OFF. It works fine. (I use custom session handling functions, though) FYI: It seems there is race condition problem in current session module, but it shouldn't occur that often. I don't know if it's closed or not. Search BugDB if you need. One thing I can think of is your script may be running to long, try to increase max_execution_time in your php.ini. Session is stored to whatever (file/mm/user) when script execution is ended. Regards, -- Yasuo Ohgaki ----- Original Message ----- From: "Felix Kronlage" <[EMAIL PROTECTED]> To: "Yasuo Ohgaki" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, April 02, 2001 9:21 PM Subject: Re: [PHP] known problems with session_register()? > On Mon, Apr 02, 2001 at 09:13:41PM +0900, Yasuo Ohgaki wrote: > > > If you are enabled track vars and disabled register globals, all you have to do > > is assign values to $HTTP_SESSION_VARS and > > both are on. Could there be a problem with session_register() ? > I do think it's odd, that the same code, on the same box, same > php, same everything works 80% of the time and fails in 20% of the time. > (no, there can't be a race-condition). > > -fkr > -- > gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0 8A48 0D31 9BD3 D9AC 74D0 > |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE | > |all your base are belong to us | shame on me | fkr@IRCnet | > >
On Tue, Apr 03, 2001 at 05:34:05PM +0900, Yasuo Ohgaki wrote: > Try register globals off, see if it helps. > (You need to use $HTTP_SESSION_VARS) ok. will do that. Does $HTTP_SESSION_VARS always work? (even with register_globals being on?) > FYI: It seems there is race condition problem in current session module, but it > shouldn't occur that often. I don't know if it's closed or not. Search BugDB if > you need. will do that. thanks. sounds like what I expected. > One thing I can think of is your script may be running to long, try to increase > max_execution_time in your php.ini. Session is stored to whatever > (file/mm/user) when script execution is ended. mmmh...it's set to 30 seconds (the default), which I'd think is plenty. But I'll increase it anyways. thanks for the hints. -fkr -- gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0 8A48 0D31 9BD3 D9AC 74D0 |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE | |all your base are belong to us | shame on me | fkr@IRCnet |
I forgot to mention that I haven't tested session module behavior when script execution is timed out. So it may/ may not be the cause. I set max_execution_time = 300 for file uploading, so I never worried about time out. Does anyone know what happens to session vars in this case? Regards, -- Yasuo Ohgaki ""Yasuo Ohgaki"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Try register globals off, see if it helps. > (You need to use $HTTP_SESSION_VARS) > > I always set track vars to on (It's always on from 4.0.3(?), if I remember > correctly), register globals OFF. > It works fine. (I use custom session handling functions, though) > > FYI: It seems there is race condition problem in current session module, but it > shouldn't occur that often. I don't know if it's closed or not. Search BugDB if > you need. > > One thing I can think of is your script may be running to long, try to increase > max_execution_time in your php.ini. Session is stored to whatever > (file/mm/user) when script execution is ended. > > Regards, > -- > Yasuo Ohgaki > > ----- Original Message ----- > From: "Felix Kronlage" <[EMAIL PROTECTED]> > To: "Yasuo Ohgaki" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Monday, April 02, 2001 9:21 PM > Subject: Re: [PHP] known problems with session_register()? > > > > On Mon, Apr 02, 2001 at 09:13:41PM +0900, Yasuo Ohgaki wrote: > > > > > If you are enabled track vars and disabled register globals, all you have to > do > > > is assign values to $HTTP_SESSION_VARS and > > > > both are on. Could there be a problem with session_register() ? > > I do think it's odd, that the same code, on the same box, same > > php, same everything works 80% of the time and fails in 20% of the time. > > (no, there can't be a race-condition). > > > > -fkr > > -- > > gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0 8A48 0D31 9BD3 D9AC 74D0 > > |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE | > > |all your base are belong to us | shame on me | fkr@IRCnet | > > > > > > -- > 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] >
I have a number of php4/mysql sites running from various NT boxes. I have the opportunity to move a lot of stuff across from one of the NT boxes onto a new Cobalt RaQ XTR. This job will have to be done in a hurry. If anyone can prewarn me of any problems, or better still, tell me it will all run like a dream, I'd be most grateful. Cheers -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org
On Tue, 3 Apr 2001 02:05, Marcelo Pereira wrote: > > Hi all [again], > > I'm becoming crazy installing PHP3 on my system.... I had already been > using PHP but with no postgresql support, now I need it and I done: > > get php3-3.0.18.tar.gz > untared it > ./configure --with-pgsql > ./make > ./make install > > The INSTALL file says to add > -LoadModules libphp3 modules/libpgp3.so > WHERE is this file ??? > > I could NOT get it running, > > Is there anyone here that could, for the love of god, help me to > install it with pgsql support on my system ??? > > Thanks, really thanks, in advance, > > Marcelo Pereira > Programmer Looks like you may need to look a bit closer at the documentation. It seems you have compiled php as a cgi, not an apache module. Please re-read the INSTALL file, and look at either of QUICK INSTALL (Static Object - requires Apache to be recompiled) or QUICK INSTALL (DSO - Dynamic Shared Object) if you want to use it as an Apache module -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA
On Monday 02 April 2001 18:37, you wrote: > Thank You Steve! > Here is my php > ---- > <? > $fillista = "fillista.xml"; > $fp = @fopen($fillista,r); > $count = fgets($fp,filesize($fillista)); use fread () -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Never doubt that a small group of thoughtful, committed people can change the world... Indeed, it's the only thing that ever has." - Margaret Mead