php-general Digest 15 Feb 2001 09:01:00 -0000 Issue 513
php-general Digest 15 Feb 2001 09:01:00 - Issue 513 Topics (messages 39740 through 39857): Re: gettimeofday() question 39740 by: James Moore 39791 by: CC Zona Re: Structuring large PHP programs 39741 by: Ben Peter 39743 by: Michael McGlothlin 39751 by: Scott Mebberson 39784 by: Joe Stump 39787 by: Jonathan Sharp 39792 by: Joe Stump 39794 by: Michael Kimsal 39811 by: Ben Peter 39835 by: Joe Stump Re: XML parsing without the PHP4 XML functions 39742 by: Michael McGlothlin PHP scripts in HTML 39744 by: Don 39748 by: Scott Mebberson 39761 by: Brian V Bonini 39842 by: Ankur Verma Re: Bad Practices 39745 by: szii.sziisoft.com Up Downloading 39746 by: Steve Haemelinck 39844 by: Ankur Verma Security... 39747 by: John Vanderbeck uploading files 39749 by: Scott Mebberson email.. (check this one out!) 39750 by: FredrikAT 39752 by: FredrikAT 39754 by: Balak, Frank 39759 by: Scott Mebberson 39760 by: CC Zona Re: [PHP-DB] Passing vars 39753 by: Tanya Brethour Re: PDF Functions 39755 by: Mike Tuller 39764 by: Chris Carbaugh 39766 by: Tim Livers 39770 by: Michael Stearne 39776 by: Mike Tuller 39781 by: Chris Carbaugh 39783 by: Mike Tuller 39802 by: Chris Carbaugh 39837 by: Michael Stearne PHP 4 sessions and PHPLIB 39756 by: Martin A. Marques Re: Environment Variables ??? 39757 by: Scott Mebberson Remote Connection 39758 by: John Monfort Re: PHP Editors 39762 by: John Hinsley help make less ugly? 39763 by: Andrew 39847 by: Ankur Verma (roberto)Standar of modules of PHP3 ...how i can make a extension in C/c++ for this version? 39765 by: Celestino Roberto Alejandro Forms 39767 by: Brandon Feldhahn 39768 by: Augusto Cesar Castoldi Re: mcrypt! 39769 by: Phillip Bow list only checkbox-marked records on a new page 39771 by: Helmut Ott Restrict access per IP Address 39772 by: Karl J. Stubsjoen 39773 by: Michael Stearne 39774 by: Mark Green 39775 by: Alexander Wagner Re: Paging results 39777 by: David Robley 39841 by: Ankur Verma Re: PHP and Java (CVS version) 39778 by: Alex Akilov Re: re:linebreak 39779 by: Steve Werby Array question 39780 by: Chris Re: need better solution 39782 by: Christian Dechery error handling 39785 by: Patrick Brown 39788 by: David Robley 39790 by: CC Zona 39796 by: Patrick Brown Re: OOP in web development 39786 by: Nold, Mark uploading files with just a string c:\temp\whatever.txt 39789 by: Scott Mebberson 39808 by: Scott Mebberson 39809 by: Jason Murray 39810 by: Timothy Aslat 39812 by: Jason Murray 39813 by: Scott Mebberson 39823 by: Philip Olson 39843 by: Christopher Ostmo Can I launch an external program from a php script? 39793 by: Wyatt Earp 39807 by: David Robley 39814 by: Wyatt Earp Re: concatenating strings and \n's for mail... 39795 by: 'Larry Rosenman' 39797 by: CC Zona 39806 by: 'Larry Rosenman' 39840 by: Ankur Verma A little code here? :) 39798 by: Dallas Kropka 39799 by: Philip Olson 39800 by: Dallas Kropka 39848 by: Ankur Verma SELECT BLAH WHERE BLAH LIKE BLAH not working 39801 by: Peter Houchin 39805 by: CC Zona 39815 by: Ben Peter 39817 by: Peter Houchin 39827 by: Ben Peter recommended PHP/MySQL host 39803 by: Freemail 39804 by: Timothy Aslat 39826 by: Joe Sheble (Wizaerd) Re: apache php 39816 by: Ankur Verma Re: Help Work with files 39818 by: Ankur Verma Re: date maniplations 39819 by: Ankur Verma Re: Why??? 39820 by: Ankur Verma 39821 by: Ankur Verma Re: Qoute problem 39822 by: Ankur Verma 39833 by: Ankur Verma 39846 by: Terrence Wong php vs perl 39824 by: Jeff 39830 by: Jason Brooke 39850 by: Scott Mebberson automatic php execution 39825 by: Jeff 39828 by: Philip Olson 39853 by: Ankur Verma Re: how do I do file maintenance with PHP? 39829 by: Ankur Verma deleting cart items on session expire 39831 by: Joseph H Blythe 39838 by: Jason Brooke 39845 by: Christopher Ostmo 39849 by: Jason Brooke 39854 by: Ankur Verma Re: Access my script 39832 by: Ankur Verma Re: Passing vars 39834 by: Ankur Verma currency conversion 39836 by: christian Re: Upload moves the file doesn't copy it.. 39839 by: Ankur Verma HTTP authentication 39851 by: Thomas
Re: [PHP] Undocumented Socket functions?
"Daniel Grace" [EMAIL PROTECTED] wrote in message 96g30n$jgi$[EMAIL PROTECTED]">news:96g30n$jgi$[EMAIL PROTECTED]... "Rog" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Can anyone here decipher for me some of the undocumented Socket functions in PHP4? For instance, how do I use select() to multiplex multiple connections? With the functions that are documented, there is a nice example of a simple echoing TCP server, but it only accepts a single connection which has limited usage. Can anyone come up with an example to expand that to multiple connections. I too would be interested in knowing this. I was once (and still am) interested in developing a MUD (= multi-user text-based game) engine entirely in PHP. This would be nice because powerful scripts and stuff like that could be coded within the mud and executed on-the-fly if proper considerations were taken towards stability and security. I'm not honestly sure if it'd be possible. Normally you would have a daemon running that listens for incoming connections and then spawns another process for each connection. Then the daemon goes back to listening. As far as I know, PHP doesn't have any sort of fork() or process spawning type commands. -- Rick Hodger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Undocumented Socket functions?
Rick Hodger wrote: I'm not honestly sure if it'd be possible. Normally you would have a daemon running that listens for incoming connections and then spawns another process for each connection. Then the daemon goes back to listening. As far as I know, PHP doesn't have any sort of fork() or process spawning type commands. It should be entirely possible to manage multiple connections to a socket using the alternative to forking, select(). I don't know enough about select() and its corresponding functions, but they are there and they should allow the ability to step through and deal with each connection without ever forking a new process. Those functions are part of the Socket extension to PHP, but they are undocumented. I would be very happy to see an example of their usage in PHP (as the C examples are leaving me quite baffled). -- Visit the Gates Motel webgame: http://www.gameslate.com/gatesmotel/ -- 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] FW: CSETI Announcement - Urgent Disclosure Project Update
Please read and forward. -Original Message- From: James [mailto:[EMAIL PROTECTED]] Sent: 14 February 2001 21:39 To: Young, Stuart; Raf; Nicky Gosney; Nick; [EMAIL PROTECTED]; John Boddy; Iain; Green, Karen; Darren S; Andy; [EMAIL PROTECTED] Subject: FW: CSETI Announcement - Urgent Disclosure Project Update -Original Message- From: Tony Craddock [mailto:[EMAIL PROTECTED]] Sent: 14 February 2001 05:35 To: [EMAIL PROTECTED] Subject: CSETI Announcement - Urgent Disclosure Project Update Please Post and Distribute As Desired Since August of 2000, the CSETI Disclosure Project has recorded the testimony of over 100 military, government and related witnesses to UFO events and projects from around the world. The testimony of these courageous witnesses creates a permanent archive with the most profound implications as it constitutes dozens of first-hand, often top-secret witnesses to UFO events, internal UFO -related government projects and covert government activities related to UFOs, Extraterrestrial Intelligence and exotic energy and propulsion system projects. These 100 witnesses constitute the tip of a larger pool of over 400 prospective witnesses, many of whom would prefer coming forward first in formal Congressional hearings --which we hope will follow the upcoming planned disclosure event. This testimony is on broadcast quality digital videotape and audio tape. Printed transcriptions of the testimony are currently being created. We are requesting that any further military, government, government- contractor or related witnesses to UFO events and projects contact CSETI Director Dr. Steven Greer immediately for inclusion in the briefing materials and the upcoming disclosure event. Such witnesses may contact Dr. Greer via the CSETI website at www.cseti.org http://www.cseti.org/ or at 540 456 8302 (government witnesses only should use this number, please). Additionally, any other substantial, supporting evidence, such as government documents, high quality UFO photographs and videotaped images, hard evidence etc. should similarly be referred to the project for inclusion in the final briefing materials and disclosure Press Conference. The date for the Disclosure Press Conference and related activities in Washington DC has been set and will occur in the Spring of this year (2001). Prior to the Disclosure Press Conference we will be conducting private briefings for key leaders in society, government and related institutions (for example, members of the US Congress, White House staff, scientific and religious leaders etc). If you have good access to such leaders and can assist with arranging a briefing please contact Dr. Greer as soon as possible. This body of testimony is being edited and the over 100 hours of testimony will be condensed into a 2 hour briefing video. Additionally, a written briefing document consisting of witness testimony transcripts, government documents and important case material and policy papers is being prepared for use in the briefings and in the Disclosure Press Conference in Washington. The Disclosure Press Conference will present many of the government witnesses in person, and the other evidence and briefing materials will be available to the media at that time. People with excellent national and international media contacts who can assist pro bono with media coordination are invited to contact Dr. Greer also. Unfortunately, a documentary containing this witness testimony will not be available as there are insufficient funds to complete such a project. We would like to thank all of the supporters and contributors to this historic effort and especially the witnesses who have come together to let the world know the truth about this very important matter. Anyone who would like to help support this effort is invited to make a tax-deductible contribution to : The Disclosure Project, PO Box 265, Crozet Va 22932. Further updates will be issued as the date for the event approaches. Again, we would like to thank our many supporters for their assistance in and dedication to disclosing the truth. The Disclosure Project CSETI 11 February 2001
[PHP] Concatenate a variable.
Hello. I receive from a post T1, T2, T3, ... Tn I want to put then in an array with a for, how can I do that? How can I use $T$i ??? Thank you Fabian Fabela [EMAIL PROTECTED] www.vacagorda.com
Re: [PHP] Oracle Web Php
Hi! I mean running php in an oracle server! thanks From: Adi Wibowo [EMAIL PROTECTED] To: kaab kaoutar [EMAIL PROTECTED] CC: [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: [PHP] Oracle Web Php Date: Thu, 15 Feb 2001 02:22:03 +0700 (GMT+0700) On Wed, 14 Feb 2001, kaab kaoutar wrote: Hi! thanks but i'm talking of oracle server! i mean instead of using pws or IIS or apache , may i use php with an oracle server thanks Yes, you could access oracle server using PHP without any web server. Just compile it as a CGI (without any kind of web server flag). But it still has the same instruction manual. Try looking at "Oracle Functions" or "Oracle 8 Functions" at PHP manual. Hope it help. Adi Wibowo --- * Work matter: [EMAIL PROTECTED] * Private matter : [EMAIL PROTECTED] -- _ 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]
Re: [PHP] Concatenate a variable.
Sorry I know the answer now. Thank you Fabian Fabela From: "Fabian Fabela" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 15, 2001 3:30 AM Subject: [PHP] Concatenate a variable. Hello. I receive from a post T1, T2, T3, ... Tn I want to put then in an array with a for, how can I do that? How can I use $T$i ??? Thank you Fabian Fabela [EMAIL PROTECTED] www.vacagorda.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Cookies
Hi! I'm about to use cookies in my application, and i'm intersted in using baskets, i mean while the user surfing in my web site, he can select items and it will be added to the basket etc (like the classical shopping) ! can u point me to a url with details information about cookies(i've read the one of the manual) and php samples about cookies and baskets stuff ... what about if cookies are disactivated in a user browser ? Thanks a lot ! _ 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]
[PHP] Get a variable from a variable.
Hello, In $a I have the name of the array that I want to use. For example. $a="myarray"; I need to send myFunction($myarray); if I try myArray($a); the string "myarray" is sent, and I want to send $myarray that is the text in $a. Thank you. Fabian Fabela [EMAIL PROTECTED] www.vacagorda.com
[PHP] Compiling with Sablotron and XML
Hi all: I am working now on a project where I want to use PHP's XML and XSLT capabilities. The problem is that, after searching the list archives, I have seen endless questions from people who have had problems compiling PHP4 with Sablotron and XML support, so before I start with it, I would like to make sure of some things: 1) Can I compile correctly the latest version of Sablotron with PHP 4.0.4p1? (which is the version of PHP I'm using). 2) If so, do I need to install the full version of expat? Up to now I had been compiling PHP with the bundled version of expat (expat-lite) that came with the Apache sources. In that case, would I havwe to recompile Apache using the full version of Expat too? 3) If I can't use Sablotron with PHP 4.0.4p1, which other version should I use? Will PHP 4.0.3p1 do? Thanks in advance, Paulo Jan. DDnet. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Cookies
Using PHP4 I think u should store your vars on session and pass the session_id() for all your web pages ... take a look at the sess-cap on the php man I hope this help max --- Please Help Puppies --- x On Thu, 15 Feb 2001, kaab kaoutar wrote: Hi! I'm about to use cookies in my application, and i'm intersted in using baskets, i mean while the user surfing in my web site, he can select items and it will be added to the basket etc (like the classical shopping) ! can u point me to a url with details information about cookies(i've read the one of the manual) and php samples about cookies and baskets stuff ... what about if cookies are disactivated in a user browser ? Thanks a lot ! _ 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] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-CVS] cvs: php4 / configure.in /ext/standard basic_functions.cdir.c php_dir.h
On Thu, 15 Feb 2001, Sascha Schumann wrote: There might be more systems which do not support chroot, so we check for the existence of it. Additionally, if chroot is not supported, the warn_not_available function is invoked now. Thanx Sascha, I hope it's now really fixed :) Derick Rethans - PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED] - -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP Charts
Hi everyone, im making a statistics type program and was wondering if anyone knew of some PHP libraries to produce charts/graphs etc. Cheers Phil P.S. Can you please reply to this address as im not on the mailing list anymore -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] need better solution
On Thursday 15 February 2001 02:49, Christian Dechery wrote: that's kinda what I have here... but the line of code isn't being shown... and that is the problem... I for one, think that in an error message the line of code is crucial. Check the manual for set_error_handler () well... that could help, but even than I'd have to call that error_handler everytime I execd a query and still would have to pass to it the __LINE__ of code... Read that section again. That error handler is called automatically every time an error occurs, and __LINE__ is also passed automatically to it. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God - and she was black. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Cookies
On Thu, 15 Feb 2001, kaab kaoutar wrote: So it has nothing to do with cookies ?! No, I did not say this ... I think u need to associate a unique_id for each client/customer and store the basket's vars on it ... u know that the session_id is passed on all your pages: - via cookies - via get/post method if cookies failed (cookies that store the session_id) 'cause the client browser doesn't accept them, you always have the session_id() passed on the query string or post data ... Anyway I suggest u to read a very interesting column about this topic that u can find at phpbuilder.com (".. A simple shopping cart using session ..") ... and i should focus on session part ? in the manual there is only one chapter called Session handling functions ! max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP Charts
http://www.phpbuilder.com/columns/allan2830.php3 http://www.phpbuilder.com/snippet/detail.php?type=snippetid=183 http://phpclasses.upperdesign.com/browse.html/class/11 This is a great class for printing HTML graphs http://www.advgraph.regiocom.net/ hope that helps best regards Ankur Verma HCL Technologies A1CD, Sec -16 Noida, UP India - Original Message - From: "Phil Lambert" [EMAIL PROTECTED] To: "PHP-General Mailing List" [EMAIL PROTECTED] Sent: Thursday, February 15, 2001 3:44 PM Subject: [PHP] PHP Charts Hi everyone, im making a statistics type program and was wondering if anyone knew of some PHP libraries to produce charts/graphs etc. Cheers Phil P.S. Can you please reply to this address as im not on the mailing list anymore -- 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] problem with pack function
Hello, I need to generate the value '0A 00 00 00' with the pack function. How to do this? TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-CVS] cvs: php4 /ext/pgsql pgsql.c
On Thu, Feb 15, 2001 at 04:17:06AM +0200, Zeev Suraski wrote: This patch won't always work (it may cause the link not to be closed when it's supposed to). I committed a different patch to the CVS - can you under what circumstances? please check it? will do - tc At 18:54 13/2/2001, Thies C. Arntzen wrote: thies Tue Feb 13 08:54:48 2001 EDT Modified files: /php4/ext/pgsql pgsql.c Log: @- fixes PostgeSQL pg_connect() bug. We would sometimes close the default @ link by acciedent. (Patch by: [EMAIL PROTECTED]) Index: php4/ext/pgsql/pgsql.c diff -u php4/ext/pgsql/pgsql.c:1.85 php4/ext/pgsql/pgsql.c:1.86 --- php4/ext/pgsql/pgsql.c:1.85 Wed Jan 31 13:53:29 2001 +++ php4/ext/pgsql/pgsql.c Tue Feb 13 08:54:48 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: pgsql.c,v 1.85 2001/01/31 21:53:29 andi Exp $ */ +/* $Id: pgsql.c,v 1.86 2001/02/13 16:54:48 thies Exp $ */ #include stdlib.h @@ -114,9 +114,10 @@ { PGLS_FETCH(); -if (PGG(default_link)!=-1) { +if ((PGG(default_link) != -1) (PGG(default_link) != id)) { zend_list_delete(PGG(default_link)); } + if (PGG(default_link) != id) { PGG(default_link) = id; zend_list_addref(id); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Zeev Suraski [EMAIL PROTECTED] CTO co-founder, Zend Technologies Ltd. http://www.zend.com/ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP CVS 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] Array
How can I delete one record in a array? Example: $myarray = array ("a", "b", "c"); I want to delete/take away "b" so the array is: $myarray = array ("a", "c"); David -- 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] stupid problem!
when i try the phinfo test in a php file it works! however when i put it in an htm file it does not work : htmlheadtitlePHP Test/title/head body ?php phpinfo(); ? /body/html It gives me a blank page _ 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]
Re: [PHP] Array question
On Thursday 15 February 2001 01:40, Chris wrote: How do I get the index,number of an array if reffering to an array via string? Ex: I have 100 arrays, and I want to know what # myarray["something"] is. That element doesn't have an index number such arrays are implemented as hashes or trees, which don't store data at "fixed positions" (that's a very bad explanation, but, well...) The "index" is the "key" in this case - in your example it's "something". -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God - and she was black. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] A little code here? :)
On Thursday 15 February 2001 04:31, Dallas Kropka wrote: I have a few text input boxes that I am using to allow the client to compose emails for a mailing list... does anyone have a little snippet that will take the "\n's" and turn them into BR's? I would attempt to write one myself but Im not the best at ereg or replace code... nl2br () is the simple solution (as others already mentioned). Attached is a more sophisticated one I use in my code. It detects paragraphs (empty lines), and highlights URLs and email adresses. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God - and she was black. ?php /* * $Id: text2html.php,v 1.7 2001/01/07 21:03:23 chris Exp $ */ function pbText2HTML ($Text, $LinkStyleClass = '', $LinkTarget = '') { $NewText = ""; $LastWasBlank = true; // (1) quote all HTML entities (assumes iso8859-1) $Text = htmlentities ($Text); // (2) Divide into paragraphs and // (3) Add markup for URLs foreach (explode ("\n", $Text) as $CLine) { $CLine = trim ($CLine); if ($CLine == '') { if ($LastWasBlank) { // ignore multiple blank lines continue; } else { $LastWasBlank = true; $NewText .= "/p\n"; } } else { if ($LastWasBlank) { $LastWasBlank = false; $NewText .= "p\n"; } $NewText .= pb_t2h_URLMarkup ($CLine, $LinkStyleClass, $LinkTarget); $NewText .= "\n"; } } return $NewText; } function pb_t2h_URLMarkup ($Text, $StyleClass = '', $Target = '') { if ($StyleClass != '') $ClassS = " class='$StyleClass'"; else $ClassS = ""; if ($Target != '') $TargetS = " target='$Target'"; else $TargetS = ''; $Patterns = array ('/([^"\'])(http:\/\/[\w\.\/~\-]+)/', '/([^"\'])(ftp:\/\/[\w\.\/~\-]+)/', '/([^"\'\w-\.\/])(www\.[\w\.\/~\-]+)/', '/^(www\.[\w\.\/~\-]+)/', '/([\w\.~\-=]+@[\w\.~\-]+)/'); $Replacements = array ("\\1a href='\\2'$ClassS$TargetS\\2/a", "\\1a href='\\2'$ClassS$TargetS\\2/a", "\\1a href='http://\\2'$ClassS$TargetS\\2/a", "a href='http://\\1'$ClassS$TargetS\\1/a", "a href='mailto:\\1'$ClassS\\1/a"); return preg_replace ($Patterns, $Replacements, $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]
Re: [PHP] php vs perl
On Thursday 15 February 2001 08:03, Scott Mebberson wrote: When Jason says 'especially when your note using the cgi' he means the cgi version of PHP (I think) in preference to installing PHP as an apache module. ...just as using mod_perl is better than perl as CGI -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God - and she was black. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] currency conversion
"c" == christian [EMAIL PROTECTED] writes: does anyone know of a way to currency conversions with php? i want to grab the current currency from some kind of web site and then convert money to different currency value I'm sure plenty of people have done this properly, but here's a quick hack to use Xe's currency converter. ?php class currency { function convert($amount, $from, $to) { $regex = "/[0-9.]+\s*$from\s*=\s*([0-9.]+)\s*$to/"; $return = file ("http://www.xe.net/ucc/convert.cgi?Amount=1From=$fromTo=$to"); foreach ($return as $line) { if( preg_match($regex, $line, $match) ) break; } if (!isset($match)) return false; return $amount * $match[1]; } } $money = new currency; print $money-convert( 10, "GBP", "AUD" ); ? -- Robin Vickery. BlueCarrots, 14th Floor, 20 Eastbourne Terrace, London, W2 6LE -- 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] PWS PHP
Hi! How can i make my web server PWS parse html file into PHP? cause it shows nothing when i include php in an html file.However it works when i put it in a php file ! Thanks _ 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]
Re: [PHP] Specific PHP/JSP questions
Gerald, although I cannot give you extensive answers, I hope I can help you in some points: 1) JSPs can persist variables at the page, request, session and application scopes. I believe PHP variables are implicitly page-scoped, and session management can be used for session-scoping. Are there equivalents to request and application scoping? The PHP default scope is request scope rather than page scope, as all processing that is done in connection with one request shares the same scope. This includes auto_prepend and auto_append files, as well as any that are included. There is no concept of application scope variables. You would need to implement these using the shared memory functions. 2) In JSPs, it is possible to do server-side page redirection, i.e. "forward" a request from page A to page B, as if the user actually requested page B. There is no browser involvement in the redirection; it is complete on the server. In this scenario, there are two "page scopes", and one "request scope". How is this server-side redirection done in PHP? You cannot actually do page redirection, but you can simulate something similar: If you set up an auto_prepend file, this file is processed before the requested page is. In this file, the originally requested resource is available in $REQUEST_URI. With this information, you can decide not to serve the requested file, but include() another page and then exit() instead. I am using this to implement a 'sourceview' function on my homepage. Have a look at http://bpeter.org/ and hit 'view source'. Have a look at 'prepend.php' and 'sourceview.php' to get an idea. 3) In doing the server-side page redirection, variables can be added to a "request" object, which embodies parameters related to a request. Page A can add variables to the request object (perhaps values from an SQL select), which page B can then retrieve and display. How is this done in PHP? If you take above approach, the scope will be shared between the prepend file and any included files. 4) JSPs, being a part of J2EE, can use a security system that does authentication and authorization. What is the commonly accepted way to do security with PHP? Varies. You can either use http level authentication or something within application scope. You can access almost any backend you like for that (MySQL Database, .htpasswd, EJB, whatever). 5) On a JSP site, I typically arrange things such that a particular JSP (or servlet) accepts requests, processes them and then forwards them to one of a number of different pages, depending on the outcome of the processing. This is in contrast to the alternative approach where one simply goes to a page, which does some processing and then displays the contents of the requested page. What is the typical way to achieving this "funnel all requests to a single point and have it forward the correct response to the user" paradigm? In the above model, the auto_prepended file would be that point. If you like, you can have a single page which then include()s read()s as necessary. 6) JSPs can be packaged up as an application (a WAR file), and that WAR file has descriptors that allow mapping of URLs to JSPs and servlets. This allows me to just drop in a WAR file to a JSP container, like Tomcat, and have it run. Are there equivalents to the "pack it up as an application" and URL mapping concepts in PHP? There is no similar concept in PHP. One way would be to tune an application so that it reads all necessary information from a configuration file, but you would have to do this manually. 7) JSPs can be mapping to multiple URLS, e.g. /alpha/mypage and /beta/mypage can both go to the same JSP. Is there an equivalent to this in PHP? This would be best done on webserver configuration level. For apache, add 'Alias /beta/mypage /alpha/mypage'. I have several more, but this is a sample. Answers to these questions are quite important to me because at the moment I'm trying to decide whether I should choose JSPs (J2EE actually), PHP or Zope for some projects. I know that most likely my answers are not what you hoped for; others might have much cleaner and better solutions for achieving your goals in PHP. PHP and JSP differ in concept rather far, so that there is no 1:1 mapping of many of the architectural aspects of JSP. In your decision it might help to know that you can use Java objects from PHP. This gives you the ability to access EJBs from a PHP frontend. You can so pack you logic into Java, which offers more capabilities in backend integration, and stick with PHP/MySQL for the frontend and personalization. Cheers, Ben Thanks. Gerald. -- 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
Re: [PHP] Array
use array_splice ($myarray, 1 ,1); hope that helps best regards Ankur Verma HCL Technologies A1CD, Sec -16 Noida, UP India - Original Message - From: "David Tandberg-Johansen" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 15, 2001 4:35 PM Subject: [PHP] Array How can I delete one record in a array? Example: $myarray = array ("a", "b", "c"); I want to delete/take away "b" so the array is: $myarray = array ("a", "c"); David -- 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-I18N] weblog on i18n issues
http://liga1.com/ new weblog on localisation, internationalisation, globalisation and accessibility issues. Any feedback welcome, and feel free to participate, post articles, ... Peter -- PHP Internationalization Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Structuring large PHP programs
Joe, I believe that the concept of the Zend Cache shows the contrary. It basically pre-parses scripts and stores them in memory. Zend.com give figures up to 603% performance increase (http://www.zend.com/cguidemo/benchmark_frame.html). Part of this certainly is due to less disk access, the other part is the time that is saved in parsing the scripts. So, for a heavily-used application, the overhead in parsing code that is not needed is all but minimal. Ben Joe Stump wrote: Declaring the functions is minimal. Either your ISP has the memory allocations set unbearably low or you aren't coding things very well ... --Joe On Thu, Feb 15, 2001 at 04:16:22AM +0100, Ben Peter wrote: Hi Joe, the reason I changed to 'include on demand' was a rather large application which would not work, as the memory limit that my isp had set wouldn't suffice. I have files that are included all the way, yes: DB connection, some common helpers, etc. But I would not include files that the current state of an application (or part of the site) does not need to keep things small. This is especially true for some classes which before included both user access and 'admin' function (for, say, user authentication and administration). I split all of these up into two classes, so that the part that is accessed when a regular user hits the site is minimal, and the administrative functions won't be loaded in that case. Ben -- 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-i18n Digest 15 Feb 2001 11:20:21 -0000 Issue 52
php-i18n Digest 15 Feb 2001 11:20:21 - Issue 52 Topics (messages 123 through 123): weblog on i18n issues 123 by: Peter Van Dijck 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] -- http://liga1.com/ new weblog on localisation, internationalisation, globalisation and accessibility issues. Any feedback welcome, and feel free to participate, post articles, ... Peter
Re: [PHP-CVS] cvs: php4 /ext/pgsql pgsql.c
On Thu, Feb 15, 2001 at 12:01:35PM +0100, Thies C. Arntzen wrote: On Thu, Feb 15, 2001 at 04:17:06AM +0200, Zeev Suraski wrote: This patch won't always work (it may cause the link not to be closed when it's supposed to). I committed a different patch to the CVS - can you under what circumstances? please check it? will do - works. tc -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-CVS] cvs: php4 /ext/pgsql pgsql.c
At 13:01 15/2/2001, Thies C. Arntzen wrote: On Thu, Feb 15, 2001 at 04:17:06AM +0200, Zeev Suraski wrote: This patch won't always work (it may cause the link not to be closed when it's supposed to). I committed a different patch to the CVS - can you under what circumstances? Well, if you have an open link, and then you reopen the same link, then the original code would fail. Why? pgsql_connect();// default_link is -1, so no ref-- is done. ref is 1 after it, and link is set to n (e.g. 2) pgsql_connect();// default_link is 2, ref is 1, so ref-- brings it to 0, deletes it, and only afterwards theres ref++ which brings it to 1, but it's already too late with the original patch: pgsql_connect();// default_link is -1, so no ref-- is done. ref is 1 after it, and link is set to n (e.g. 2) pgsql_connect();// default link is 2, ref is 1. with the patch, no ref-- is done, and then there's a ref++ - which brings ref to 2. this refcount is wrong... with my patch: pgsql_connect();// default_link is -1, so no ref-- is done. ref is 1 after it, and link is set to n (e.g. 2) pgsql_connect();// default_link is 2, ref++ brings it the refcount to 2, ref-- brings it back to 1. all is well... Zeev please check it? will do - tc At 18:54 13/2/2001, Thies C. Arntzen wrote: thies Tue Feb 13 08:54:48 2001 EDT Modified files: /php4/ext/pgsql pgsql.c Log: @- fixes PostgeSQL pg_connect() bug. We would sometimes close the default @ link by acciedent. (Patch by: [EMAIL PROTECTED]) Index: php4/ext/pgsql/pgsql.c diff -u php4/ext/pgsql/pgsql.c:1.85 php4/ext/pgsql/pgsql.c:1.86 --- php4/ext/pgsql/pgsql.c:1.85 Wed Jan 31 13:53:29 2001 +++ php4/ext/pgsql/pgsql.c Tue Feb 13 08:54:48 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: pgsql.c,v 1.85 2001/01/31 21:53:29 andi Exp $ */ +/* $Id: pgsql.c,v 1.86 2001/02/13 16:54:48 thies Exp $ */ #include stdlib.h @@ -114,9 +114,10 @@ { PGLS_FETCH(); -if (PGG(default_link)!=-1) { +if ((PGG(default_link) != -1) (PGG(default_link) != id)) { zend_list_delete(PGG(default_link)); } + if (PGG(default_link) != id) { PGG(default_link) = id; zend_list_addref(id); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Zeev Suraski [EMAIL PROTECTED] CTO co-founder, Zend Technologies Ltd. http://www.zend.com/ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP CVS 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] -- Zeev Suraski [EMAIL PROTECTED] CTO co-founder, Zend Technologies Ltd. http://www.zend.com/ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php vs perl
When Jason says 'especially when your note using the cgi' he means the cgi version of PHP (I think) in preference to installing PHP as an apache module. Almost, yes - I literally meant the 'common gateway interface', due to the fact that the webserver spawns the requested script/program outside of it's own process. I don't know the technical detals involved in doing this, but I'm guessing that in general, it'd incur more overhead on the system than the same code would if it was parsed by the already-running httpd process. jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PWS PHP
How can i make my web server PWS parse html file into PHP? cause it shows nothing when i include php in an html file.However it works when i put it in a php file ! You need to edit your registry (using regedit or a .reg file based on the one shown here). [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Scrip t Map] ".html"="[PUT PATH HERE]\\php.exe" The registry entry will be the same as the .php one you already have, but will be called .html Cheers -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: Re: [PHP] PDF Functions
-Original Message- From: Chris Carbaugh [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 15, 2001 1:39 AM To: Mike Tuller; Michael Stearne Cc: php mailing list Subject: Re: Re: [PHP] PDF Functions Redhat's *.0 releases are known to be problematic. They are usually pretty much bleading edge, meaning they're buggy. Thats might not really a problem. A few days ago I successfully compiled PHP 4.0.4 with PDFlib 3.0.3 on RedHat 7. When I tried it on Mandrake 7.2 I failed, but on RH7 it compiled without any problems. Maybe a description of the installed libraries would help here. An ldconfig is important after installing PDFlib and configuring PDFlib with --enable-shared-pdflib too. Best Regards. Mathias Meyer -- 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] Generate XML files
Hi all: A question tangentially related to the former one. I have seen lots of tutorials about how to parse XML files using PHP and generate something else (usually HTML) from it, but I haven't seen anything so far about generating XML with some specific data. Basically, what I want is: 1) To have a XML file describing the structure of the data, like: SECTION BLAH VALUE="" FOOBAR VALUE="" /SECTION 2) Receive the values of "BLAH" and "FOOBAR" from, say, a Web form. 3) Output an XML file with the values of "BLAH" and "FOOBAR", like: SECTION BLAH VALUE="203" FOOBAR VALUE="666" /SECTION 4) Store said XML file with the data in a text field in a database. I suppose that I could use the existing XML parsr functions to parse the XML template in 1), and define event handlers that output the relevant XML tag with the specific data, like: function startElement($parser, $name, $attribs) { $data=$data . "BLAH VALUE=\"" . $blah . "\""; } (I know that the above is probably wrong; it's just an example). ...But I'd like to know if there's another way to do the above, something more... elegant. Paulo Jan. DDnet. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/mnogosearch php_mnogo.c test.php
gluke Thu Feb 15 03:50:49 2001 EDT Modified files: /php4/ext/mnogosearch php_mnogo.c test.php Log: Added thow new mnoGoSearch agent session parameters: UDM_PARAM_WEIGHT_FACTOR and UDM_PARAM_WORD_MATCH. Index: php4/ext/mnogosearch/php_mnogo.c diff -u php4/ext/mnogosearch/php_mnogo.c:1.14 php4/ext/mnogosearch/php_mnogo.c:1.15 --- php4/ext/mnogosearch/php_mnogo.c:1.14 Wed Feb 14 06:27:45 2001 +++ php4/ext/mnogosearch/php_mnogo.cThu Feb 15 03:50:48 2001 @@ -1,5 +1,5 @@ /* $Source: /local/repository/php4/ext/mnogosearch/php_mnogo.c,v $ */ -/* $Id: php_mnogo.c,v 1.14 2001/02/14 14:27:45 gluke Exp $ */ +/* $Id: php_mnogo.c,v 1.15 2001/02/15 11:50:48 gluke Exp $ */ /* +--+ @@ -52,6 +52,8 @@ #define UDM_PARAM_CHARSET 6 #define UDM_PARAM_STOPTABLE7 #define UDM_PARAM_STOPFILE 8 +#define UDM_PARAM_WEIGHT_FACTOR9 +#define UDM_PARAM_WORD_MATCH 10 /* udm_add_search_limit constants */ #define UDM_LIMIT_URL 1 @@ -59,6 +61,7 @@ #define UDM_LIMIT_LANG 3 #define UDM_LIMIT_CAT 4 +/* track modes */ #define UDM_TRACK_ENABLED 1 #define UDM_TRACK_DISABLED 0 @@ -155,6 +158,8 @@ REGISTER_LONG_CONSTANT("UDM_PARAM_STOP_TABLE", UDM_PARAM_STOPTABLE,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("UDM_PARAM_STOPFILE",UDM_PARAM_STOPFILE,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("UDM_PARAM_STOP_FILE", UDM_PARAM_STOPFILE,CONST_CS | CONST_PERSISTENT); + +REGISTER_LONG_CONSTANT("UDM_PARAM_WEIGHT_FACTOR",UDM_PARAM_WEIGHT_FACTOR,CONST_CS | +CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UDM_PARAM_WORD_MATCH", UDM_PARAM_WORD_MATCH,CONST_CS +| CONST_PERSISTENT); /* udm_add_search_limit constants */ REGISTER_LONG_CONSTANT("UDM_LIMIT_CAT", UDM_LIMIT_CAT,CONST_CS | CONST_PERSISTENT); @@ -184,6 +189,12 @@ /* track mode params */ REGISTER_LONG_CONSTANT("UDM_TRACK_ENABLED", UDM_TRACK_ENABLED,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("UDM_TRACK_DISABLED",UDM_TRACK_DISABLED,CONST_CS | CONST_PERSISTENT); + + /* word match mode params */ + REGISTER_LONG_CONSTANT("UDM_MATCH_WORD",UDM_MATCH_WORD,CONST_CS | +CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UDM_MATCH_BEGIN", UDM_MATCH_BEGIN,CONST_CS | +CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UDM_MATCH_SUBSTR", UDM_MATCH_SUBSTR,CONST_CS | +CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("UDM_MATCH_END", UDM_MATCH_END,CONST_CS | +CONST_PERSISTENT); return SUCCESS; } @@ -330,7 +341,33 @@ } break; + + case UDM_PARAM_WORD_MATCH: + switch (atoi(val)){ + case UDM_MATCH_WORD: + Agent-word_match=UDM_MATCH_WORD; + break; + + case UDM_MATCH_BEGIN: + Agent-word_match=UDM_MATCH_BEGIN; + break; + + case UDM_MATCH_END: + Agent-word_match=UDM_MATCH_END; + break; + + case UDM_MATCH_SUBSTR: + Agent-word_match=UDM_MATCH_SUBSTR; + break; + + default: + +php_error(E_WARNING,"Udm_Set_Agent_Param: Unknown word match mode"); + RETURN_FALSE; + break; + } + break; + case UDM_PARAM_CACHE_MODE: switch (atoi(val)){ case UDM_CACHE_ENABLED: @@ -385,6 +422,11 @@ php_error(E_WARNING,Agent-Conf-errstr); RETURN_FALSE; } + + break; + + case UDM_PARAM_WEIGHT_FACTOR: + Agent-weight_factor=strdup(val); break; Index: php4/ext/mnogosearch/test.php diff -u php4/ext/mnogosearch/test.php:1.10 php4/ext/mnogosearch/test.php:1.11 --- php4/ext/mnogosearch/test.php:1.10 Fri Feb 9 05:29:19 2001 +++ php4/ext/mnogosearch/test.php Thu Feb 15
RE: [PHP] stupid problem!
This is because your server is set up to parse .php files as php, and .html files as html. If you have access to your httpd.conf or whatever, you can set it to include .html files in the php parsing. If not, you'll have to stick with calling your php files .php. HTH Jon -Original Message- From: kaab kaoutar [mailto:[EMAIL PROTECTED]] Sent: 15 February 2001 11:12 To: [EMAIL PROTECTED] Subject: [PHP] stupid problem! when i try the phinfo test in a php file it works! however when i put it in an htm file it does not work : htmlheadtitlePHP Test/title/head body ?php phpinfo(); ? /body/html It gives me a blank page _ 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] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-CVS] cvs: php4 /ext/pgsql pgsql.c
On Thu, Feb 15, 2001 at 01:47:46PM +0200, Zeev Suraski wrote: At 13:01 15/2/2001, Thies C. Arntzen wrote: On Thu, Feb 15, 2001 at 04:17:06AM +0200, Zeev Suraski wrote: This patch won't always work (it may cause the link not to be closed when it's supposed to). I committed a different patch to the CVS - can you under what circumstances? Well, if you have an open link, and then you reopen the same link, then the original code would fail. Why? pgsql_connect();// default_link is -1, so no ref-- is done. ref is 1 after it, and link is set to n (e.g. 2) pgsql_connect();// default_link is 2, ref is 1, so ref-- brings it to 0, deletes it, and only afterwards theres ref++ which brings it to 1, but it's already too late with the original patch: pgsql_connect();// default_link is -1, so no ref-- is done. ref is 1 after it, and link is set to n (e.g. 2) pgsql_connect();// default link is 2, ref is 1. with the patch, no ref-- is done, and then there's a ref++ - which brings ref to 2. this refcount is wrong... with my patch: pgsql_connect();// default_link is -1, so no ref-- is done. ref is 1 after it, and link is set to n (e.g. 2) pgsql_connect();// default_link is 2, ref++ brings it the refcount to 2, ref-- brings it back to 1. all is well... ok - got you. tc -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PWS PHP
This has been extensively covered in a step by step process in the PHP Manual Installation Chapter http://www.php.net/manual/en/install.iis.php follow the steps and you will have php working just fine with PWS best regards Ankur Verma HCL Technologies A1CD, Sec -16 Noida, UP India - Original Message - From: "kaab kaoutar" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, February 15, 2001 5:00 PM Subject: [PHP] PWS PHP Hi! How can i make my web server PWS parse html file into PHP? cause it shows nothing when i include php in an html file.However it works when i put it in a php file ! Thanks _ 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] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] stupid problem!
Oh yes u're right it's that once installing i just cares for php file ! but when i try now, i find that thaere are existent phpfile keys that are already filled with things related to, for instance in the shell-open-commnand default ihave the following : "C:\PROGRA~1\Plus!\MICROS~1\iexplore.exe" -nohome may i erase it and put instead it c:\php\php.exe -q %1 ? Thanks From: Jon Haworth [EMAIL PROTECTED] To: 'kaab kaoutar' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP] stupid problem! Date: Thu, 15 Feb 2001 12:14:35 - This is because your server is set up to parse .php files as php, and .html files as html. If you have access to your httpd.conf or whatever, you can set it to include .html files in the php parsing. If not, you'll have to stick with calling your php files .php. HTH Jon -Original Message- From: kaab kaoutar [mailto:[EMAIL PROTECTED]] Sent: 15 February 2001 11:12 To: [EMAIL PROTECTED] Subject: [PHP] stupid problem! when i try the phinfo test in a php file it works! however when i put it in an htm file it does not work : htmlheadtitlePHP Test/title/head body ?php phpinfo(); ? /body/html It gives me a blank page _ 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] _ 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]
[PHP] Debugger, Debugger and Debugger
Hi, Problem: I'm trying put to work the debugger in php4.0.4pl1(Red Hat Distribution), I change my php.ini file to enable the debugger but when try to use in a simple script I get the following error: Fatal error: Call to undefined function: debugger_on() in /var/www/html/php/dbg.php on line 2 Questions: 1 Do I need some sort of extension (something like xxx.so) to activate the debugger? 2 In php documentation (Chapter: Using the Debugger) says: Set up a TCP listener on that port somewhere (for example socket -l -s 1400 on UNIX). I don't have that "socket" command in Linux/Unix, what is this? What this means? 3 I need to debug my script what is the best way to do that? (I tried the "Zend IDE Test Drive" but after 30 days is not for free and can't put to work the "The DBG PHP Debugger"). 4 What is the difference between Zend debugger, Dmitri Dmitrienko PHP debugger (seen link below) and the 'internal' PHP debugger? Thanks, (Sorry for the bad english) Additional Information: PHP version: PHP Version 4.0.4pl1- Red Hat distribution O.S. - Red Hat 7.0 Compiled options (PHP) extract from phpinfo(): './configure' '--prefix=/usr' '--with-config-file-path=/etc' '--disable-debug' '--enable-pic' '--enable-shared' '--enable-inline-optimization' '--with-apxs=/usr/sbin/apxs' '--with-exec-dir=/usr/bin' '--with-regex=system' '--with-gettext' '--with-gd' '--with-jpeg-dir=/usr' '--with-png' '--with-zlib' '--with-db2' '--with-db3' '--with-gdbm' '--enable-debugger' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-yp' '--enable-ftp' '--enable-wddx' '--without-mysql' '--without-oracle' '--without-oci8' '--with-xml' Simple Script to test the debugger: ?php debugger_on(localhost); $var = 1; if ($var == 1 ) { echo "VAR is 1"; } else { echo "VAR is not 1"; } ? PHP.INI file (Revelant parts): #Extension actived extension=imap.so extension=ldap.so extension=pgsql.so [Debugger] debugger.host = localhost debugger.port = 7869 debugger.enabled= true Dmitri Dmitrienko PHP Debugger: http://dd.cron.ru/dbg/ +++ Ricardo D'Aguiar MemoSis - Sistemas Informticos Portugal +++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] deleting cart items on session expire
Well, why not store the item's in the session-var? When the session dies because of timeout or user-intervention, the items dissapear too. Or store a timestamp along with the items, and refresh the timestamps as needed. Then put in a cron-job to delete out-of-date items left in the DB at regular intervals. -J 17.02.01 02:29:04, Joseph H Blythe [EMAIL PROTECTED] wrote: hey all, I was wondering how one would suggest removing items from a cart system once the session lifetime has expired. I have it set to the default 0, which expires the session on browser close, what I want to be able to do is "delete * from Cart where session='$PHPSESSID'" when the user closes thier browser window is this even possible? maybe using register_shutdown_function or something? Any ideas would be great! Thanks Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] MVC Framework in PHP?
Hello all, I've been searching for a framework for MVC in PHP and I've been unsuccessful thus far. Does anyone know of one out there? TIA, -Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTTP authentication
On Wed, Feb 14, 2001 at 11:07:46PM -0800, Thomas Edison Jr. wrote: The code I'm entering is: ?php if(!isset($PHP_AUTH_USER)) { Header("WWW-Authenticate: Basic realm=\"My Realm\""); Header("HTTP/1.0 401 Unauthorized"); echo "Text to send if user hits Cancel button\n"; exit; } else { echo "Hello $PHP_AUTH_USER.P"; echo "You entered $PHP_AUTH_PW as your password.P"; } ? I'm not sure what is wrong. I copied and pasted this onto my system and it works just fine. -- Jason Stechschulte [EMAIL PROTECTED] -- Soitainly. I was assuming that came with the OO-ness of it. -- Larry Wall in [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Get a variable from a variable.
On Thu, Feb 15, 2001 at 03:57:58AM -0600, Fabian Fabela wrote: $a="myarray"; myFunction($myarray); if I try myArray($a); the string "myarray" is sent, and I want to send $myarray that is the text in $a. You were pretty close. I think you want to try this: myFunction($$a); It is a variable variable. http://www.php.net/manual/en/language.variables.variable.php -- Jason Stechschulte [EMAIL PROTECTED] -- Just don't create a file called -rf. :-) -- Larry Wall in [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] currency conversion
How legal is this? can u use it on a website? free? - Original Message - From: Robin Vickery [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 15, 2001 10:46 AM Subject: Re: [PHP] currency conversion "c" == christian [EMAIL PROTECTED] writes: does anyone know of a way to currency conversions with php? i want to grab the current currency from some kind of web site and then convert money to different currency value I'm sure plenty of people have done this properly, but here's a quick hack to use Xe's currency converter. ?php class currency { function convert($amount, $from, $to) { $regex = "/[0-9.]+\s*$from\s*=\s*([0-9.]+)\s*$to/"; $return = file ("http://www.xe.net/ucc/convert.cgi?Amount=1From=$fromTo=$to"); foreach ($return as $line) { if( preg_match($regex, $line, $match) ) break; } if (!isset($match)) return false; return $amount * $match[1]; } } $money = new currency; print $money-convert( 10, "GBP", "AUD" ); ? -- Robin Vickery. BlueCarrots, 14th Floor, 20 Eastbourne Terrace, London, W2 6LE -- 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] Question about ImageCopy and colors
Hi, I have 4 images, and I copy three of them onto one main background, these images all have fairly different colors and as you can imagine the resulting image looks splotchy and missing colors. What do i need to do to make sure the resulting image looks proper? -- David Raufeisen [EMAIL PROTECTED] Cell: (604) 818-3596 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] XML parsing without the PHP4 XML functions
Wddx may also be an option. That would allow you to serialize the xml into php variables so that you could use them in your example. But if your provider won't compile xml in, I doubt you'll be able to get wddx. Shaun On Wed, 14 Feb 2001, Stefen Lars wrote: Hello all I have recently been assigned the task of parsing an xml file and format the contents of the file in HTML. The xml file lies on another server. Our web space provider does not provide the XML functions (nor is he willing to install them) :-gr. I am sure that I am not the only who has come across this problem. Would someone have already created a few functions to parse xml that they are willing to share? I have the following structure to deal with: faq item productProductName/product questionWhy does it not work/question answerBecause it is not turned onanswer item /faq There are whole load of items in the file. I then want to display the contents a bit like this: echo $product; echo $question; etc (of course with some HTML formatting, like a bulleted list). Any help would be really VERY appreciated! Thanks S _ 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]
[PHP-CVS] cvs: php4 /ext/xml xml.c
thies Thu Feb 15 05:41:05 2001 EDT Modified files: /php4/ext/xml xml.c Log: fixed SEGFAULT when using xml_set_object. Zend does not yes support cyclic references! Index: php4/ext/xml/xml.c diff -u php4/ext/xml/xml.c:1.71 php4/ext/xml/xml.c:1.72 --- php4/ext/xml/xml.c:1.71 Fri Jan 5 10:09:43 2001 +++ php4/ext/xml/xml.c Thu Feb 15 05:41:04 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: xml.c,v 1.71 2001/01/05 18:09:43 dbeu Exp $ */ +/* $Id: xml.c,v 1.72 2001/02/15 13:41:04 thies Exp $ */ #define IS_EXT_MODULE #include "php.h" @@ -294,9 +294,11 @@ { xml_parser *parser = (xml_parser *)rsrc-ptr; - if (parser-object) { + /* please leave this commented - or ask [EMAIL PROTECTED] before doing it +(again) +if (parser-object) { zval_del_ref(parser-object); } + */ if (parser-parser) { XML_ParserFree(parser-parser); @@ -1175,19 +1177,19 @@ RETURN_FALSE; } - if (! ParameterPassedByReference(ht,2)) { - php_error(E_WARNING,"arg 2 not passed by reference"); - RETURN_FALSE; - } - ZEND_FETCH_RESOURCE(parser,xml_parser *,pind, -1, "XML Parser", le_xml_parser); - if (parser-object) { + /* please leave this commented - or ask [EMAIL PROTECTED] before doing it +(again) +if (parser-object) { zval_del_ref(parser-object); } + */ parser-object = *mythis; - zval_add_ref(parser-object); + + /* please leave this commented - or ask [EMAIL PROTECTED] before doing it +(again) + zval_add_ref(parser-object); + */ RETVAL_TRUE; } @@ -1405,19 +1407,10 @@ argc = ZEND_NUM_ARGS(); if (zend_get_parameters_ex(4, pind, data, xdata,info) == SUCCESS) { - if (!ParameterPassedByReference(ht, 4)) { - php_error(E_WARNING, "Array to be filled with values must be passed by reference."); -RETURN_FALSE; - } zval_dtor(*info); array_init(*info); } else if (zend_get_parameters_ex(3, pind, data, xdata) == FAILURE) { WRONG_PARAM_COUNT; - } - - if (!ParameterPassedByReference(ht, 3)) { - php_error(E_WARNING, "Array to be filled with values must be passed by reference."); - RETURN_FALSE; } ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/standard string.c
thies Thu Feb 15 06:01:18 2001 EDT Modified files: /php4/ext/standard string.c Log: 0..255 Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.187 php4/ext/standard/string.c:1.188 --- php4/ext/standard/string.c:1.187Fri Feb 2 05:47:02 2001 +++ php4/ext/standard/string.c Thu Feb 15 06:01:18 2001 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.187 2001/02/02 13:47:02 rasmus Exp $ */ +/* $Id: string.c,v 1.188 2001/02/15 14:01:18 thies Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -2937,7 +2937,7 @@ array_init(return_value); } - for (inx=0; inx 255; inx++) { + for (inx=0; inx 256; inx++) { switch (mymode) { case 0: add_index_long(return_value,inx,chars[inx]); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTTP authentication
I'm sure this wont' help, but just in case you may have missed the obvious (it happens sometimesg)..Make sure you PHP script has the extension .PHP .. The server won't recognize it as a PHP file otherwise, and it won't know what to do with it. Also this extension has to be registred properly on the server, but that is beyond me. - John Vanderbeck - Admin, GameDesign - Original Message - From: "Thomas Edison Jr." [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 15, 2001 2:07 AM Subject: [PHP] HTTP authentication I was browsing thru the http authentication method given thru the header() function in the manual. I tried it out but it's not giving me the pop-up window asking me the username and password and is only writing the text given in the code on the page. I'm using win98 and otherwise use sun solaris. Does this function work on these two OS? I have to write a code that checks each time a user enters a page, his previously entered user/pwd so as to prevent anyone from entering the page if he knows and writes the page's URL in the address bar. I've used the same authentication method in ASP before for the same. Can I use it in my OS using PHP? The code I'm entering is: ?php if(!isset($PHP_AUTH_USER)) { Header("WWW-Authenticate: Basic realm=\"My Realm\""); Header("HTTP/1.0 401 Unauthorized"); echo "Text to send if user hits Cancel button\n"; exit; } else { echo "Hello $PHP_AUTH_USER.P"; echo "You entered $PHP_AUTH_PW as your password.P"; } ? Regards, T.Edison jr. = Rahul S. Johari (Director) ** Abraxas Technologies Inc. Homepage : http://www.abraxastech.com Email : [EMAIL PROTECTED] Tel : 91-4546512/4522124 *** __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Specific PHP/JSP questions
Gerald Gutierrez wrote: Hi all. I understand that a lot of JSP Vs. PHP questions have been asked on this list, but they've been philosophical and general in nature. I have some specific questions and was hoping that someone might be able to entertain them: 1) JSPs can persist variables at the page, request, session and application scopes. I believe PHP variables are implicitly page-scoped, and session management can be used for session-scoping. Are there equivalents to request and application scoping? My understanding of this is that the language itself doesn't handle this. PHP is a language. Java is a language. Neither implicity handle application variables. However, Java running in a java application server handles these for you, similar to how VBScript running under ASP handles this. You would need an overriding architecture in PHP that would handle this for you. Someone suggested an autoprepend - we use one main file which handles all this for you (sessions, applications, etc) and includes whatever classes are necessary to process a specific request. As all logic passes through one file, that file can handle all session/app variable handling, as well as security, logging, error handling, templating and other things. 2) In JSPs, it is possible to do server-side page redirection, i.e. "forward" a request from page A to page B, as if the user actually requested page B. There is no browser involvement in the redirection; it is complete on the server. In this scenario, there are two "page scopes", and one "request scope". How is this server-side redirection done in PHP? Not directly possible, although storing session info, then doing a 'redirect' to another page via Location: header should accomplish the same thing. We have a redirect function which handles this - I can set my session vars, then redirect() and it'll close the session, then redirect, pick up the session, and continue processing. *probably* equivalent to what you're looking for? 3) In doing the server-side page redirection, variables can be added to a "request" object, which embodies parameters related to a request. Page A can add variables to the request object (perhaps values from an SQL select), which page B can then retrieve and display. How is this done in PHP? See above. We've not tried adding things to the request object, but store things in sessions between pages. 4) JSPs, being a part of J2EE, can use a security system that does authentication and authorization. What is the commonly accepted way to do security with PHP? There are multiple security models out there for implementation in PHP projects - it comes down to the requirements of the task at hand. There isn't a 'common' way, yet, anyway, which is both positive and negative. 5) On a JSP site, I typically arrange things such that a particular JSP (or servlet) accepts requests, processes them and then forwards them to one of a number of different pages, depending on the outcome of the processing. This is in contrast to the alternative approach where one simply goes to a page, which does some processing and then displays the contents of the requested page. What is the typical way to achieving this "funnel all requests to a single point and have it forward the correct response to the user" paradigm? Have all your requests go to a single URL, with parameters after them. blah.com/PHPfile/param1/param2 blah.com/PHPfile/param4/param3 Both requests go to PHPfile, and get processed accordingly. Not sure why you need to redirect, and couldn't simply include() the logic you need in the main file. 6) JSPs can be packaged up as an application (a WAR file), and that WAR file has descriptors that allow mapping of URLs to JSPs and servlets. This allows me to just drop in a WAR file to a JSP container, like Tomcat, and have it run. Are there equivalents to the "pack it up as an application" and URL mapping concepts in PHP? Not to my knowledge, although I don't doubt someone, somewhere is working on a similar approach. 7) JSPs can be mapping to multiple URLS, e.g. /alpha/mypage and /beta/mypage can both go to the same JSP. Is there an equivalent to this in PHP? Again, it's a server thing, not a language thing. This is best accomplished at the web server level, with aliases of some type. I have several more, but this is a sample. Answers to these questions are quite important to me because at the moment I'm trying to decide whether I should choose JSPs (J2EE actually), PHP or Zope for some projects. Some of this decision will come down to the comfort level of the developers. I somewhat don't care how great Zope is - if I needed a project done on a deadline, I wouldn't use it, because I'm not familiar with it. If you and/or everyone on your team knows Java, there's little reason to use Zope or PHP, I'd think. Using something like the APC or zend cache, the "compilation time" of PHP scripts is nothing,
[PHP] Compiling PHP for Apache.
Hi! Right now, I'm trying to figure out which step in order is appropriate. I'm going to put it down now, if I got it wrong then help me out with the correct order. Whether it is from scratch or from existing softwares. 1) OpenSSL 2) libmcrypt (Add-on to PHP) 3) PHP 4.0 4) mod_ssl 5) apache Thanks, Scott -- 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] Charts
Hi everyone, im doing a statistics type system with PHP4 and I was wondering if anyone had any experience of creating charts/graphs with PHP. Cheers Phil -- 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] Can't access a mail archive
Can someone please help? I'm seeing lots of interesting message headings go by in the digest, but I can't get to the current archive. I get the error message: "Forbidden. You don't have permission to access /mail/php-general/2001012/ on this server." But I can get to all the other archives. And speaking of the digest, is it normal behavior for this one to get the summary of message headings, but only a single message text, the first? Please help. I feel like I'm locked out. --David -- David M. Phillips [EMAIL PROTECTED] eBoing, Inc. Austin, Texas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PWS PHP
Hi! please help me ! i have tried to do what is that url concerning html file but i've found that there is already a key called htmlfile where the default is filled with Microsoft HTML Document 5.0 and the shell-open-command with "C\PROGRA~1\Plus!\MICROS~1\iexplorer.exe" -nohome i get rid of them and put instead them PHP Script and c:\php\php.exe -q %1 but it does not work and above all now i can't open any html file from the server i get : Erreur HTTP 403 403.1 Forbidden - Execute Access Forbidden Cette erreur peut être engendrée si vous tentez d'exécuter une application CGI, ISAPI ou un autre programme exécutable à partir d'un répertoire qui n'autorise pas l'exécution de programmes. Veuillez contacter l'administrateur du serveur Web si le problème persiste. i tried to restore but i still can't open html files ! pleaase help thanks From: "Ankur Verma" [EMAIL PROTECTED] Reply-To: "Ankur Verma" [EMAIL PROTECTED] To: "kaab kaoutar" [EMAIL PROTECTED], [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [PHP] PWS PHP Date: Thu, 15 Feb 2001 17:42:53 +0530 This has been extensively covered in a step by step process in the PHP Manual Installation Chapter http://www.php.net/manual/en/install.iis.php follow the steps and you will have php working just fine with PWS best regards Ankur Verma HCL Technologies A1CD, Sec -16 Noida, UP India - Original Message - From: "kaab kaoutar" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, February 15, 2001 5:00 PM Subject: [PHP] PWS PHP Hi! How can i make my web server PWS parse html file into PHP? cause it shows nothing when i include php in an html file.However it works when i put it in a php file ! Thanks _ 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] _ 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]
[PHP] RE: [PHP-WIN] Bug in mktime-function ?
Therefore any date on or before 1 Jan 1970 ain't going to work using mktime or any PHP function which returns a UNIX timestamp. I'm sorry, but this is wrong. The following works with no problems whatsoever. script language="php" $month = 3; $day = 9; $year = 1935; echo "Using $month/$day/$yearbr\n"; $oldDate = mktime( 0, 0, 0, $month, $day, $year ); echo "Unix timestamp for this date is $oldDatebrbr\n"; echo "Reconverting... " . date( "F d, Y", $oldDate ); /script Chris
Re: [PHP] Debugger, Debugger and Debugger
You must be viewing old documentation. http://php.net/manual/en/debugger.php clearly states that debugger, ie debugger_on() support is in php3 only, not in php4. Your not out of luck though, you could still use the Zend Debugger, the Zend boys seem to be quite eager to improve its current quallity. http://zend.com/store/products/ide-test-drive.php -- Chris Lee Mediawaveonline.com em. [EMAIL PROTECTED] ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 "Ricardo D'Aguiar" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, Problem: I'm trying put to work the debugger in php4.0.4pl1(Red Hat Distribution), I change my php.ini file to enable the debugger but when try to use in a simple script I get the following error: Fatal error: Call to undefined function: debugger_on() in /var/www/html/php/dbg.php on line 2 Questions: 1º Do I need some sort of extension (something like xxx.so) to activate the debugger? 2º In php documentation (Chapter: Using the Debugger) says: Set up a TCP listener on that port somewhere (for example socket -l -s 1400 on UNIX). I don't have that "socket" command in Linux/Unix, what is this? What this means? 3º I need to debug my script what is the best way to do that? (I tried the "Zend IDE Test Drive" but after 30 days is not for free and can't put to work the "The DBG PHP Debugger"). 4º What is the difference between Zend debugger, Dmitri Dmitrienko PHP debugger (seen link below) and the 'internal' PHP debugger? Thanks, (Sorry for the bad english) Additional Information: PHP version: PHP Version 4.0.4pl1- Red Hat distribution O.S. - Red Hat 7.0 Compiled options (PHP) extract from phpinfo(): './configure' '--prefix=/usr' '--with-config-file-path=/etc' '--disable-debug' '--enable-pic' '--enable-shared' '--enable-inline-optimization' '--with-apxs=/usr/sbin/apxs' '--with-exec-dir=/usr/bin' '--with-regex=system' '--with-gettext' '--with-gd' '--with-jpeg-dir=/usr' '--with-png' '--with-zlib' '--with-db2' '--with-db3' '--with-gdbm' '--enable-debugger' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-yp' '--enable-ftp' '--enable-wddx' '--without-mysql' '--without-oracle' '--without-oci8' '--with-xml' Simple Script to test the debugger: ?php debugger_on(localhost); $var = 1; if ($var == 1 ) { echo "VAR is 1"; } else { echo "VAR is not 1"; } ? PHP.INI file (Revelant parts): #Extension actived extension=imap.so extension=ldap.so extension=pgsql.so [Debugger] debugger.host = localhost debugger.port = 7869 debugger.enabled= true Dmitri Dmitrienko PHP Debugger: http://dd.cron.ru/dbg/ +++ Ricardo D'Aguiar MemoSis - Sistemas Informáticos Portugal +++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/cpdf cpdf.c /ext/gd gd.c gd_ctx.c /ext/hyperwave hw.c /ext/interbase interbase.c /ext/oci8 oci8.c /ext/pdf pdf.c /ext/standard file.c iptc.c
thies Thu Feb 15 06:48:59 2001 EDT Modified files: /php4/ext/cpdf cpdf.c /php4/ext/gdgd.c gd_ctx.c /php4/ext/hyperwave hw.c /php4/ext/interbase interbase.c /php4/ext/oci8 oci8.c /php4/ext/pdf pdf.c /php4/ext/standard file.c iptc.c Log: @- Fixed some modules to allow using output-buffering. (Thies) i nuked all unneded calls to php_header() - i'm not too sure how we do handle HEAD Requests as they were only detected via php_header(). but calling php_header from a module makes output-buffering unusable. NOTICE: there is some EBSDIC stuff in gd.c - i think it's obsolete. Index: php4/ext/cpdf/cpdf.c diff -u php4/ext/cpdf/cpdf.c:1.21 php4/ext/cpdf/cpdf.c:1.22 --- php4/ext/cpdf/cpdf.c:1.21 Wed Oct 25 10:43:49 2000 +++ php4/ext/cpdf/cpdf.cThu Feb 15 06:48:56 2001 @@ -27,7 +27,7 @@ +--+ */ -/* $Id: cpdf.c,v 1.21 2000/10/25 17:43:49 andrei Exp $ */ +/* $Id: cpdf.c,v 1.22 2001/02/15 14:48:56 thies Exp $ */ /* cpdflib.h -- C language API definitions for ClibPDF library * Copyright (C) 1998 FastIO Systems, All Rights Reserved. */ @@ -2226,7 +2226,7 @@ } buffer = cpdf_getBufferForPDF(pdf, lenght); - php_header(); + php_write(buffer, lenght); RETURN_TRUE; Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.114 php4/ext/gd/gd.c:1.115 --- php4/ext/gd/gd.c:1.114 Fri Feb 9 13:14:30 2001 +++ php4/ext/gd/gd.cThu Feb 15 06:48:56 2001 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.114 2001/02/09 21:14:30 hholzgra Exp $ */ +/* $Id: gd.c,v 1.115 2001/02/15 14:48:56 thies Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -853,33 +853,35 @@ php_error(E_WARNING, "%s: unable to open temporary file", get_active_function_name()); RETURN_FALSE; } - output = php_header(); - if (output) { - switch(image_type) { - case PHP_GDIMG_TYPE_JPG: - (*func_p)(im, tmp, q); - break; - case PHP_GDIMG_TYPE_WBM: - if(q0||q255) { - php_error(E_WARNING, "%s: invalid threshold value '%d'. It must be between 0 and 255",get_active_function_name(), q); - } - (*func_p)(im, q, tmp); - break; - default: - (*func_p)(im, tmp); - break; - } + + switch(image_type) { + case PHP_GDIMG_TYPE_JPG: + (*func_p)(im, tmp, q); + break; + case PHP_GDIMG_TYPE_WBM: + if(q0||q255) { + php_error(E_WARNING, "%s: invalid threshold +value '%d'. It must be between 0 and 255",get_active_function_name(), q); + } + (*func_p)(im, q, tmp); + break; + default: + (*func_p)(im, tmp); + break; + } + + fseek(tmp, 0, SEEK_SET); -fseek(tmp, 0, SEEK_SET); #if APACHE defined(CHARSET_EBCDIC) - SLS_FETCH(); -/* This is a binary file already: avoid EBCDIC-ASCII conversion */ -ap_bsetflag(php3_rqst-connection-client, B_EBCDIC2ASCII, 0); -#endif -while ((b = fread(buf, 1, sizeof(buf), tmp)) 0) { -php_write(buf, b); -} -} + /* XXX this is unlikely to work any more [EMAIL PROTECTED] */ + + SLS_FETCH(); + /* This is a binary file already: avoid EBCDIC-ASCII conversion */ + ap_bsetflag(php3_rqst-connection-client, B_EBCDIC2ASCII, 0); +#endif + while ((b = fread(buf, 1, sizeof(buf), tmp)) 0) { + php_write(buf, b); + } + fclose(tmp); /* the temporary file is automatically deleted */ } Index: php4/ext/gd/gd_ctx.c diff -u php4/ext/gd/gd_ctx.c:1.1 php4/ext/gd/gd_ctx.c:1.2 --- php4/ext/gd/gd_ctx.c:1.1Thu Feb 1 07:40:35 2001 +++ php4/ext/gd/gd_ctx.cThu Feb 15 06:48:56 2001 @@ -61,15 +61,13 @@ ctx = gdNewFileCtx(fp); } else { - if(!php_header()) { - RETURN_TRUE; -
[PHP] Session Questions...
I was reading through the documentation on sessions at http://www.php.net/manual/en/html/ref.session.html I have a few questions.. 1) How do I explicitly close a session, so that any subsequent attempts to use pages would require a new session started? Will session_destroy() do this? 2) I don't want to rely on cookies being set for the client's browser. What are the security ramifications for passing the SID through the URL? Most important to me is to understand the overall concept. Can I start and stop sessions whever I want? Can I start and use one session, then destroy it, then start a whole new session on the client? I'm just starting to hate the looks of all these encoded urls being thrown around as i'm developing the site. It is getting more and more complex, and some of the stuff i'm passing in the urls is ugly, and some of it is not good to be showing. - John Vanderbeck - Admin, GameDesign -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] parse error driving me nuts ...
hi, can anyone help me spot the parse error? It's throwing up on the first "if" line, and for the life of me I cannot find it! :) tia, andrew ?php include("db_connect_params.inc"); $sql="select path from PHOTO where pid =1"; $link_id = mysql_connect($host, $usr, $pass); $result = mysql_db_query($database, $sql, $link_id) or die("no result"); if ((mysql_num_rows($result)) = 1) { $row=mysql_fetch_array($result); extract($row); echo "img src =\"$path\"/imgbr"; } else { if (!isset($ii)) $ii = 1; $i = 1; while($row=mysql_fetch_array($result)) { extract($row); $displayed[$i]=$path; echo "a href=\"$PHP_SELF?ii=$i\"$i/anbspnbsp"; $i++; } echo "img src =\"$displayed[$ii]\"/imgbr"; } ? -- 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] File_exists function question.
Hello everyone: I'm trying to build a table with the last row being a check function for an image, where it checks if the item image exists in the image directory and either echos "no image" or places a small icon of something (I guess you could say Ebay style). The problem is that the fuction checks for an image matching the first row item id and then it copies the same result to the remaning item rows weather they have images or not. I read that I could use the clearstatcache() to clear the cache and start again but there must be something wrong with the way I persive the use of this. this is the code: $fn = "directory/images/$id.gif"; if (!file_exists($fn)) { echo "no image"; } else { echo"img src=\"$siteurl/images/camara.gif\""; clearstatcache(); } Could anyone that sees what's wrong with this drop me a line? Thanks in advance: -- Gerry Figueroa -- - - - --* War does not determine who is right, war determine who is left. |XXX|-^|XX| -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP Socket working (sorta)
After hours of pulling my hair out and staring a C code I don't understand, I almost have a generic PHP multiplexing TCP server running. Basically right now multiple clients can connect and be recognized by the server and the server is aware of incoming input from the clients. This is mostly using undocumented functions from the Socket extension and I could really use some help from anyone that knows sockets better than I. From where I am, I still need to figure out when a client disconnects, plus how to disconnect a client (at the server's whim) directly. I also need the multiplex to be aware of writes as well as reads, although I think I should be able to sort that part out, it's the disconnects that I haven't a clue on yet. Here's my sloppy code (sorely lacking in error checking, but oh well): // PHP normally times out, we don't want to do that here. set_time_limit (0); // Server's address and port we want to listen to. $address = '209.53.13.112'; $port = 8080; // Start the socket. $sock = socket (AF_INET, SOCK_STREAM, 0); $foo = bind ($sock, $address, $port); $foo = listen ($sock, 10); // Allocate File Descriptor, not sure if this is needed, I'm just guessing. $fdgroup = fd_alloc(); $maxfd = $sock + 1; do { // FD needs to be rebuilt each time because select() may alter it. if ($maxfd $sock + 1) { // If any clients have connected, rebuild the FD from the list. $foo = fd_zero($fdgroup); $foo = fd_set($sock,$fdgroup); for ($i=0;$i = count($fdlist);$i++) { $foo = fd_set($fdlist[$i],$fdgroup); } } else { // or else the socket itself is the only FD. $foo = fd_zero($fdgroup); $foo = fd_set($sock,$fdgroup); } // Now the very important and magical select(), set to timeout after a million microseconds (1 second). $selectnow = select($maxfd, $fdgroup, NULL, NULL, 0, 100); if ($selectnow == 0) { // We've timed out, put any appropriate activities here. } elseif ($selectnow 0) { for ($fd=$sock;$fd =$maxfd;$fd++) { if (fd_isset($fd,$fdgroup)) { if ($fd == $sock) { // The socket is knocking, someone is at the door. $newfd = accept_connect($sock); if ($newfd 0) { $fdlist[] = $newfd; if ($maxfd $newfd + 1) $maxfd = $newfd + 1; } } else { // One of our clients has something to say. } } } } } while (true); // Do we need to deallocate File Descriptors? I'm not sure. $foo = fd_dealloc($fdgroup); close ($sock); -- Visit the Gates Motel webgame: http://www.gameslate.com/gatesmotel/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Compiling PHP for Apache.
El Jue 15 Feb 2001 11:47, escribiste: Hi! Right now, I'm trying to figure out which step in order is appropriate. I'm going to put it down now, if I got it wrong then help me out with the correct order. Whether it is from scratch or from existing softwares. 1) OpenSSL 2) libmcrypt (Add-on to PHP) 3) PHP 4.0 4) mod_ssl 5) apache OS is an importante issue. More info please. Saludos... ;-) -- System Administration: It's a dirty job, but someone told I had to do it. - Martn Marqus email: [EMAIL PROTECTED] Santa Fe - Argentinahttp://math.unl.edu.ar/~martin/ Administrador de sistemas en math.unl.edu.ar - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] parse error driving me nuts ...
Instead of if ((mysql_num_rows($result)) = 1) try if ((mysql_num_rows($result)) == 1) HTH Jon -Original Message- From: Andrew [mailto:[EMAIL PROTECTED]] Sent: 15 February 2001 15:34 To: [EMAIL PROTECTED] Subject: [PHP] parse error driving me nuts ... hi, can anyone help me spot the parse error? It's throwing up on the first "if" line, and for the life of me I cannot find it! :) tia, andrew ?php include("db_connect_params.inc"); $sql="select path from PHOTO where pid =1"; $link_id = mysql_connect($host, $usr, $pass); $result = mysql_db_query($database, $sql, $link_id) or die("no result"); if ((mysql_num_rows($result)) = 1) { $row=mysql_fetch_array($result); extract($row); echo "img src =\"$path\"/imgbr"; } else { if (!isset($ii)) $ii = 1; $i = 1; while($row=mysql_fetch_array($result)) { extract($row); $displayed[$i]=$path; echo "a href=\"$PHP_SELF?ii=$i\"$i/anbspnbsp"; $i++; } echo "img src =\"$displayed[$ii]\"/imgbr"; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parse error driving me nuts ...
Try to use == instead of = Sorin Ifrim - Original Message - From: Andrew [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 15, 2001 5:33 PM Subject: [PHP] parse error driving me nuts ... hi, can anyone help me spot the parse error? It's throwing up on the first "if" line, and for the life of me I cannot find it! :) tia, andrew ?php include("db_connect_params.inc"); $sql="select path from PHOTO where pid =1"; $link_id = mysql_connect($host, $usr, $pass); $result = mysql_db_query($database, $sql, $link_id) or die("no result"); if ((mysql_num_rows($result)) = 1) { $row=mysql_fetch_array($result); extract($row); echo "img src =\"$path\"/imgbr"; } else { if (!isset($ii)) $ii = 1; $i = 1; while($row=mysql_fetch_array($result)) { extract($row); $displayed[$i]=$path; echo "a href=\"$PHP_SELF?ii=$i\"$i/anbspnbsp"; $i++; } echo "img src =\"$displayed[$ii]\"/imgbr"; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] file upload size limits
On Thu, 15 Feb 2001, Scott wrote: I am uploading files and want to limit the size of the file. I can do this as long as the file that I am uploading doesn't exceed the Server limit. We don't own the server so I can't change any configuration on the server. Is there a way to Catch the warning and display my own message in the browser. The Warning that I am getting is Warning: Max file size of 2097152 bytes exceeded - file [upfile] not saved in [no active file] on line 0 You could control filesize within the HTML form. input type="hidden" name="MAX_FILE_SIZE" value="(insert size)" / This means that PHP will automatically reject files over the specified size. As far as I know, I'm not sure you will be able to catch the exceeded file error before it is passed back to the client, so customising the error might be out of the question. Also, I doubt you would be able to perform any kind of action that would determine the entire size of the uploading file prior to the upload being completed - if there was a way to catch this, then you would be able to redirect to an error page at the beginning of the upload, thus meaning that there would be no time wasted on the user's behalf. :) Cheers, Nicky W.. -[ [EMAIL PROTECTED] ]- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parse error driving me nuts ...
hi, can anyone help me spot the parse error? It's throwing up on the first "if" line, and for the life of me I cannot find it! :) tia, andrew ?php include("db_connect_params.inc"); $sql="select path from PHOTO where pid =1"; $link_id = mysql_connect($host, $usr, $pass); $result = mysql_db_query($database, $sql, $link_id) or die("no result"); if ((mysql_num_rows($result)) = 1) Well I don't know if it will give a parse error or not, but you have made the oh way too common C error in your IF statement. if ((mysql_num_rows($result)) = 1) should be: if ((mysql_num_rows($result)) == 1) - John Vanderbeck - Admin, GameDesign -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PWS PHP
I think that the registry key you are playing with here just sets what happens when a file is opened (e.g. by double clicking on it). It should have no effect on how PWS deals with the file. You should restore that to it's original setting. When you have had .php files working, I assume that you were accessing them as something like http://localhost/myfile.php With the PWS scriptmap key set for .html, are you saying that accessing a file http://localhost/myfile.html just returns you the unparsed raw php stored in myfile.html Cheers -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] parse error driving me nuts ...
Jon, John, Ifrim, the == worked ... thank you!! gotta read up on it now :) Cameron, dropping the extra () did not work :( thanks for the suggestions folks! andrew -Original Message- From: Jon Haworth [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 15, 2001 10:38 AM To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' Subject: RE: [PHP] parse error driving me nuts ... Instead of if ((mysql_num_rows($result)) = 1) try if ((mysql_num_rows($result)) == 1) HTH Jon -Original Message- From: Andrew [mailto:[EMAIL PROTECTED]] Sent: 15 February 2001 15:34 To: [EMAIL PROTECTED] Subject: [PHP] parse error driving me nuts ... hi, can anyone help me spot the parse error? It's throwing up on the first "if" line, and for the life of me I cannot find it! :) tia, andrew ?php include("db_connect_params.inc"); $sql="select path from PHOTO where pid =1"; $link_id = mysql_connect($host, $usr, $pass); $result = mysql_db_query($database, $sql, $link_id) or die("no result"); if ((mysql_num_rows($result)) = 1) { $row=mysql_fetch_array($result); extract($row); echo "img src =\"$path\"/imgbr"; } else { if (!isset($ii)) $ii = 1; $i = 1; while($row=mysql_fetch_array($result)) { extract($row); $displayed[$i]=$path; echo "a href=\"$PHP_SELF?ii=$i\"$i/anbspnbsp"; $i++; } echo "img src =\"$displayed[$ii]\"/imgbr"; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parse error driving me nuts ...
Jon, John, Ifrim, the == worked ... thank you!! gotta read up on it now :) Cameron, dropping the extra () did not work :( thanks for the suggestions folks! andrew Remember that '=' means assign what is on the right to what is on the left, whereby '==' means is what is on the left equal to what is on the right. C, and C based languages allow you to out an assignemtn statement even when you intend a relational expression. It is a very common pitfall. I know I have fallen into it in my C work many times :( - John Vanderbeck - Admin, GameDesign -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ereg_replace
why does this ?php $string = "this is my string."; print $string . "br\n"; $string = preg_replace( array( '/is/', '/string/'), array( 'is not', 'bit of text' ), $string ); print $string . "br\n"; ? This happens because you are replacing "is" with "is not" so parse your string by hand: "this is my string"..ok the first occurence of "is", is in the word "this", so do the replace..the replaced part in CAPS: "thIS NOT" .. then the second "is": thIS NOT IS NOT" etc..I think you can see why now.. - John Vanderbeck - Admin, GameDesign -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Array
Try this : ?php $foo = array('a','b','c'); unset($foo[1]); print_r($foo);// [0] = a [2] = c $bar = array('a','b','c'); $piece = array_splice ($bar, 1 ,1); print_r($piece); // [0] = b print_r($bar);// [0] = a [1] = c ? http://www.php.net/manual/en/function.array-slice.php http://www.php.net/manual/en/function.unset.php Regards, Philip Olson http://www.cornado.com/ On Thu, 15 Feb 2001, David Tandberg-Johansen wrote: How can I delete one record in a array? Example: $myarray = array ("a", "b", "c"); I want to delete/take away "b" so the array is: $myarray = array ("a", "c"); David -- 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] Magazine Subscription Script
Does anyone know of any sites that have any scripts for managing magazine subscriptions! Cheeky I know but may save a lot of time! Thanks Andy Kent Managing Director Angel Solutions Ltd t: 0151 737 1048 f: 0870 126 9837 e: [EMAIL PROTECTED] w: http://www.angelsolutions.co.uk
[PHP] Job offer in central London (repost)
Hi all, Unique ID Software are looking for a new permanent PHP and MySQL programmer. The company is based in central London and works in the video/film industry. The main product is called Cakes (don't ask!) which transparently manages video footage in a professional environment. I think we can probably make a claim for the largest PHP application ever - we're up to some 100,000 lines or so at the moment, not including the support C++ programs! We have a lively and robust office environment, and meet our clients on a daily basis, so you must be able to interact well with people. The major qualifications we need are PHP (3 or 4. Must be comfortable with classes :-) and MySQL. Anything else of benefit is a bonus :-) The initial position is to work on two of the client sites hosted by us - we make you do some smaller, more self-contained projects before letting you loose on the main product :-) If you can prove to us that you are competent, we'll "upgrade" you to the main team. UID is a small company at the moment - 7 people in fact. We are currently being courted by two of the main industry players to fund us to a much larger company. This is a good opportunity to get in before the big expansion happens. OTOH at the moment everyone is expected to "muck in" and help. You pays your money... Along with the general "good environment to work in", we offer a group company personal pension scheme (it's yours, you can take it with you, but we can contribute as if it were ours :-), death-in-service benefit (!) and critical-illness insurance (pays out 80% of your salary till your pension kicks in if you can't work. 5% "pay" increase per year). The industry we work in is a lot of fun, and there are 2 guaranteed trade shows to go to every year (one in Las Vegas, one in Amsterdam). This assumes you can talk to people in a non-scary manner :-) Feel free to browse the website (www.unique-id.com) and reply to [EMAIL PROTECTED] if you're interested. CV's are requested, along with expected salary. ATB, Simon. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: [phplib] ct_sql bug - PHPLIB page_close()
I have the same problem but i don't study the record which is the subject of the update query. I tested just the object "db" from ac_store, which has the props Host, Database, user. The values of the db are correct in a debug mode (print the values :o) ) but in the command query($q) is the error. My user has a insert, update and delete privileges, on a just select privilege user i hadn't the error. Example of dabases and users: class MyDB extend DB_SQL { Host = "aaa.com"; Database = "MyDataBase"; User = "writeuser"; Password = "xxx"; } class MySession extend Session { Host = "aaa.com"; Database = "lib"; User = "writeuser"; Password = "xxx"; } I had the objects: page_open (array("sess"="MySession")); X = new MyDB; X-free(); page_close(); My error is, after the correct properties Host, Database, User, printed in debug mode (from ac_store function) MyDataBase.active_session "isn't a table"; I ask myself why ct_sql.db before the command "query" has the correct properties and in the "query" function will be used the MyDataBase.properties. If you find a solution, please email me. Bogdan Morar SO: Redhat 6.2 Database: MySql 3.2. Php: 3.0.16 Web Server: Apache PhpLib: 7.2c Prasad RL wrote: I know this problem has been discussed before. But then unfortunatly, i still find the bug has not been fixed. The problem seems to be in ac_store() function in ct_sql.inc. My observations were that 1. Surprisingly though the page_open() function doesnt create any entry in active_sessions table. 2.When page_close() function is called, it gives the following error; Database error: Invalid SQL: update active_sessions set val='...', changed='20010215030837' where sid='8378099455e8f8f96958bc3fc3559cbd' and name='Example_Session' MSSQL Error: 1 (General Error (The MSSQL interface cannot return detailed error messages).) Session halted. (pls note: this error doesnt appear when call to the page_close function is removed) The program halts with the above error immediately when the query "update active_sessions set val=.." is executed. What could be the cause of this error ? Why is the function trying to update when there's no entry in active_sessions table. and why is the entry not created at first point ? Any help would be highly appreciated. Thanks in advance, Sivaprasad R.L. p.s. I'm using phplib 7.2c (also tried with 7.2b) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PWS PHP
First Thanks ! well yes when i call http://localhost/myfile.html it skips the php syntaxes it shows wht is only in the html tags! Can you check that a view source shows all your php code. What OS are you running - 9x or NT WS? Cheers -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PWS PHP Thanks
Thanks a lot guys for ur help! _ 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]
RE: [PHP] ereg_replace
Ah right, strings not words, I feel like a dummy now... ;-) -Original Message- From: John Vanderbeck [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 15, 2001 10:57 AM To: [EMAIL PROTECTED]; Robin Vickery; [EMAIL PROTECTED] Subject: Re: [PHP] ereg_replace why does this ?php $string = "this is my string."; print $string . "br\n"; $string = preg_replace( array( '/is/', '/string/'), array( 'is not', 'bit of text' ), $string ); print $string . "br\n"; ? This happens because you are replacing "is" with "is not" so parse your string by hand: "this is my string"..ok the first occurence of "is", is in the word "this", so do the replace..the replaced part in CAPS: "thIS NOT" .. then the second "is": thIS NOT IS NOT" etc..I think you can see why now.. - John Vanderbeck - Admin, GameDesign -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Extra whitespace when decrypting data with mcrypt
Folks: I have some code that encrypts data using a relatively long (164 characters) alphanumeric key. The code for encrypt is: $encrypted = mcrypt_cbc( MCRYPT_TripleDES, $secret_key, trim($data), MCRYPT_ENCRYPT); and the decrypt code is: $decrypted = mcrypt_cbc( MCRYPT_TripleDES, $secret_key, $data, MCRYPT_DECRYPT); The encrypted valus is stored in a mysql database with 'addslashes' on store and 'stripslashes' on retrieval. When I decrypt the data, I'm getting extra whitespace characters at the end of it. I don't get this when I test it stand-alone, but on my production server it seems to be happening regularly. I've stopped it with trim(), but is this a known weirdness ? I'm running PHP4.0.3pl1 and mcrypt 2.2.x on FreeBSD 4.1.1. Any thoughts appreciated as this is causing me some concern with respect to the encryption/decryption process not being that robust. tia ..Iain -- Join Nortel Networks at CeBIT 2001 on Stand F13, Hall 17, March 22-28, 2001 in Hannover, Germany. And find out how Nortel Networks is building the high-performance Internet. Visit www.nortelnetworks.com/cebit for all the information you need.
[PHP] unstable execution of mysql_db_query($db, $myQuery)
I am using MySQL 3.22.32 and PHP 4.01PL2, but it seems that mysql_db_query($db, $myQuery) is not quite stable, actually, in my code, it is like mysql_db_query($db, $myQuery) or die "Something wrong during query"); 1 out of 15 (the same query), it will "die". Does anyone have any suggestion? Thanks, George -- 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] SMTP
Hi, on PHP.ini, it's said [mail function] SMTP = localhost ;for win32 only sendmail_from = [EMAIL PROTECTED] ;for win32 only ;sendmail_path = ;for unix only, may supply arguments as well (default is 'sendmail -t -i') Well, my question is : does anyone knows abasic solution to use another smtp server than localhost (we use sudo, on debian, sendmail is on the sbin dir and we don't want to move it from here, that's the problem : mail() is used by nobody and not have rights tu use sendmail, if it's on sbin...) I know I may implement another php mail() fonction that connect to the SMTP server I want and says helo But I was wondering it anyone had a better solution Thanks Seb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ereg_replace
"VB" == "Brian V Bonini" [EMAIL PROTECTED] writes: Ah right, strings not words, I feel like a dummy now... ;-) -Original Message- From: John Vanderbeck [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 15, 2001 10:57 AM To: [EMAIL PROTECTED]; Robin Vickery; [EMAIL PROTECTED] Subject: Re: [PHP] ereg_replace $string = preg_replace( array( '/is/', '/string/'), array( 'is not', 'bit of text' ), $string ); You could specify word boundaries on each side of your string to get the behaviour you were expecting. $string = preg_replace( array( '/\bis\b/', '/\bstring\b/'), array( 'is not', 'bit of text' ), $string ); -- Robin Vickery. BlueCarrots, 14th Floor, 20 Eastbourne Terrace, London, W2 6LE -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PDF Functions
I will as soon as the final release comes out. I don't want to rely on the beta now. Even though it is very stable. It will be nice to have standard hardware for a change. Mike From: Michael Stearne [EMAIL PROTECTED] Date: Thu, 15 Feb 2001 00:53:22 -0500 To: [EMAIL PROTECTED] Cc: Mike Tuller [EMAIL PROTECTED], php mailing list [EMAIL PROTECTED] Subject: Re: [PHP] PDF Functions I'm waiting on OS X also. (I'm running it now.) But I need to get a RH setup working for a client. BTW PHP4, mySQL and Apache work fine of the OS X PB so you might try installing PDF on that (I haven't yet though). Michael Chris Carbaugh wrote: OS X? What's that? :) Damn Mac PPC somethin or other I just don't get it.. In the mean time, I'd say 6.2 is a good bet. Good Luck, Chris On Wed, 14 Feb 2001, Mike Tuller wrote: Date: Wed, 14 Feb 2001 19:03:05 -0600 To: [EMAIL PROTECTED], Michael Stearne [EMAIL PROTECTED] From: Mike Tuller [EMAIL PROTECTED] Subject: Re: [PHP] PDF Functions I decided on my way home tonight to ditch 7.0 and go back to 6.2. I think that it is the only way to get anything done. When 7.1 or later comes out then I can go back. Thanks for your help. When OS X finally ships I will be happy. Mike From: Chris Carbaugh [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Wed, 14 Feb 2001 19:39:04 EST To: Mike Tuller [EMAIL PROTECTED], Michael Stearne [EMAIL PROTECTED] Cc: php mailing list [EMAIL PROTECTED] Subject: Re: Re: [PHP] PDF Functions Well, first let me say that I'm kind of surprised I'm the only one trying to help you guys out. It seems not many folk are into PHP/PDF? Any how, Redhat's *.0 releases are known to be problematic. They are usually pretty much bleading edge, meaning they're buggy. The last time I compiled PHP with PDF support, was a few weeks ago. It was on RedHat 6.2, PHP 4.0.2, and PDFLIB, as a CGI or a stand alone executable. The config was pretty much ./configure --with-pgsql=/usr/local/pgsql --with-pdf=/usr/local/bin (I really think that was it, note I did NOT point right to the libpdf.so). I also added /usr/local/lib to /etc/ld.so.conf and did a ldconfig. That's really all I did. RH 6.2, source tarballs of Apache 1.3.12, PHP 4.0.2, pdflib 3.03, postgresql 7.0.2. If everything configs/builds correctly, I would blame RH 7.0 While I would like to install RH 7.0 and figure out what's up, I just don't have the time. I would suggest, A) you try to install PHP/PDF as a CGI under your current install. This allows the simplest install. If that doesn't work, try RH 6.2 or some other distro? Good Luck, Chris On Wed, 14 Feb 2001, Mike Tuller wrote: Date: Wed, 14 Feb 2001 17:45:28 -0600 To: Michael Stearne [EMAIL PROTECTED] From: Mike Tuller [EMAIL PROTECTED] Subject: Re: [PHP] PDF Functions Exactly!!! I have gone back and redone everything 3 or 4 times, and am on day 3 of this. I watch while I configure, and it says that it is working, but when I go to check. I still get an error. From: Michael Stearne [EMAIL PROTECTED] Date: Wed, 14 Feb 2001 18:01:20 -0500 To: [EMAIL PROTECTED] Cc: Mike Tuller [EMAIL PROTECTED], php mailing list [EMAIL PROTECTED] Subject: Re: [PHP] PDF Functions Chris Carbaugh wrote: I have had problems in the past with RedHat's RPMs. They seem to put things in weird places. And just removing them and starting fresh with source always seems to work. Besides, once you have built from source a few times, it's really a piece of cake, and much less frustrating than screwing with RPMs. I am in the same situation except I have compiled from all the sources (not RPMS) and I still get hung up when I try to include PDF. My system is a new install of RH 7 with the updates that up2date suggests (gcc, etc.). I have compiled and installed PHP with PDF no problem on RH 6.2. I think the issue is something specific to RH7. I hope RH 7.1 fixes it. I think at this point I am going back to 6.2 Michael Chris On Wed, 14 Feb 2001, Mike Tuller wrote: Date: Wed, 14 Feb 2001 15:49:44 -0600 To: [EMAIL PROTECTED], php mailing list [EMAIL PROTECTED] From: Mike Tuller [EMAIL PROTECTED] Subject: Re: [PHP] PDF Functions The reason why I needed the RPM is because no matter what I tried, I couldn't get PHP to compile for the Apache rpm on Redhat 7. If at all possible, I like to use the rpms so that they can be easily updated. I have done everything everyone has suggested, and I still get an error. I have even compiled PHP and still I can't use PDFlib. What next? Here is the updated config script that I used. ./configure --prefix=/usr --with-config-file-path=/etc --disable-debug --enable-pic --enable-shared --enable-inline-optimization --with-apxs=/usr/sbin/apxs --with-exec-dir=/usr/bin --with-regex=system --with-gettext --with-gd --with-jpeg-dir=/usr
[PHP] Question about PDF functions and PDFLib 3.03
I'm running PHP4.0.4pl1-Win32, Zend Engine v1.0.4, Zend Optimizer v1.0.0, I tryed to run sample script for creating PDF document. It's PHP manual script, but I get message like this: Fatal error: Call to undefined function: pdf_new() in c:/web/pdf/pdf.php on line 2 phpinfo.php said: PDF Support enabled PDFLib Version 3.03 CJK Font Support yes In-memory PDF Creation Supportyes Can you help me with this problem? Thanks in advance, Vladmir P.S. Here is a PDF that I wanted to create. ?php $pdf = PDF_new(); PDF_open_file($pdf, "test.pdf"); PDF_set_info($pdf, "Author", "Uwe Steinmann"); PDF_set_info($pdf, "Title", "Test for PHP wrapper of PDFlib 2.0"); PDF_set_info($pdf, "Creator", "See Author"); PDF_set_info($pdf, "Subject", "Testing"); PDF_begin_page($pdf, 595, 842); PDF_add_outline($pdf, "Page 1"); PDF_set_font($pdf, "Times-Roman", 30, "host"); PDF_set_value($pdf, "textrendering", 1); PDF_show_xy($pdf, "Times Roman outlined", 50, 750); PDF_moveto($pdf, 50, 740); PDF_lineto($pdf, 330, 740); PDF_stroke($pdf); PDF_end_page($pdf); PDF_close($pdf); PDF_delete($pdf); echo "A HREF=getpdf.phpfinished/A"; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] unstable execution of mysql_db_query($db, $myQuery)
try using mysql_query( $qQuery, $dbConnection ); At 10:32 AM 2/15/01 -0600, Zhu George-CZZ010 wrote: I am using MySQL 3.22.32 and PHP 4.01PL2, but it seems that mysql_db_query($db, $myQuery) is not quite stable, actually, in my code, it is like mysql_db_query($db, $myQuery) or die "Something wrong during query"); 1 out of 15 (the same query), it will "die". Does anyone have any suggestion? Thanks, George -- 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] Is there a MOD function in PHP
Couldn't find one in the manual under arithmetic functions. -- Randy Perry sysTame Mac Consulting/Sales -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Is there a MOD function in PHP
Randall Perry wrote: Couldn't find one in the manual under arithmetic functions. % -Egon -- SIX Offene Systeme GmbH Stuttgart - Berlin Sielminger Strae 63 D-70771 Leinfelden-Echterdingen Fon +49 711 9909164 Fax +49 711 9909199 http://www.six.de Besuchen Sie uns auf der CeBIT 2001, Halle 6, Stand F62/4 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Is there a MOD function in PHP
Randall Perry wrote: Couldn't find one in the manual under arithmetic functions. You would've found it under operators, I think. It's % regards Wagner -- Three may keep a secret, if two of them are dead. -- 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] Reindexing Arrays
I have an array of search results which I am searching through and unset()ing unwanted search results. My question is once I have unset a result there is then a break in the numeric index and how do I stop this from happening or reindex the results. Like this.. $results = array(0 = array(more elements...), 1 = array(bla bla...) , 2 =array()); /* unset results index 1 */ unset($results[1]); /* Now the $results index is like this.. array(0 = array(more elements...), 2 =array()); */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Is there a MOD function in PHP
$remainder = 10 % 5; --- Randall Perry [EMAIL PROTECTED] wrote: Couldn't find one in the manual under arithmetic functions. -- Randy Perry sysTame Mac Consulting/Sales -- 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] = To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Exception handling
Hello, Is it impolite to ask about when approximately PHP will support Exception handling ? :) Thanks ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Is there a MOD function in PHP
on 2/15/01 12:01 PM, Mukul Sabharwal at [EMAIL PROTECTED] wrote: $remainder = 10 % 5; --- Randall Perry [EMAIL PROTECTED] wrote: Couldn't find one in the manual under arithmetic Thanks -- Randy Perry sysTame Mac Consulting/Sales -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Reindexing Arrays
Try this : ?php $foo = array('a','b','c'); unset($foo[1]); print_r($foo);// [0] = a [2] = c $bar = array('a','b','c'); $piece = array_splice ($bar, 1 ,1); print_r($piece); // [0] = b print_r($bar);// [0] = a [1] = c ? http://www.php.net/manual/en/function.array-slice.php http://www.php.net/manual/en/function.unset.php Regards, Philip On Thu, 15 Feb 2001, Nathan Cassano wrote: I have an array of search results which I am searching through and unset()ing unwanted search results. My question is once I have unset a result there is then a break in the numeric index and how do I stop this from happening or reindex the results. Like this.. $results = array(0 = array(more elements...), 1 = array(bla bla...) , 2 =array()); /* unset results index 1 */ unset($results[1]); /* Now the $results index is like this.. array(0 = array(more elements...), 2 =array()); */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] How to inverse the date sorting
Hello, Anybody here would know, how I could inverse the date sorting or ordering? This script below gives me for example: 2001-01-01 2001-01-15 2001-01-31 and so on... when I wish it would gives me: 2001-01-31 2001-01-15 2001-01-01 and so on... - ?php $db = mysql_connect("servername.com", "root", "password"); mysql_select_db("stats", $db); $sql = "select * from table_name WHERE TO_DAYS(NOW()) - TO_DAYS(date) = 21 order by 'date'"; $result = mysql_query( $sql ); while ( $row = mysql_fetch_array( $result ) ) { echo "trtdspan class=\"size1\"b$row[date]/bbrimg src=\"$row[indice_url]\"br$row[indice]hr noshade size=\"1\"/span/td/tr\n"; } ? - Thanks again for your help. Merci beaucoup, Yves -- Malouin Design Graphique http://www.malouin.qc.ca Qubec (Qubec) CANADA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: CVSROOT / cvsusers
thies Thu Feb 15 08:56:49 2001 EDT Modified files: /CVSROOTcvsusers Log: by request Index: CVSROOT/cvsusers diff -u CVSROOT/cvsusers:1.214 CVSROOT/cvsusers:1.215 --- CVSROOT/cvsusers:1.214 Mon Feb 12 04:05:12 2001 +++ CVSROOT/cvsusersThu Feb 15 08:56:49 2001 @@ -101,7 +101,7 @@ philross Phillip Ross[EMAIL PROTECTED] Oracle documentation and bugfixes, et al avi Avi Lewin [EMAIL PROTECTED] Cryptocard support afalout Andrej Falout [EMAIL PROTECTED] Informix stuff -sterling Sterling Hughes [EMAIL PROTECTED] Everything +sterling Sterling Hughes [EMAIL PROTECTED] +Everything mysql MySQL Team [EMAIL PROTECTED] Maintain MySQL client libs in PHP codebase leon Leon Atkinson [EMAIL PROTECTED] Documentation jymartin Joe Martin [EMAIL PROTECTED] OCI8 Development -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to inverse the date sorting
add a DESC to your order by clause... fairly simple SQL syntax, could be picked up from a myriad of SQL references and manuals $sql = "select * from table_name WHERE TO_DAYS(NOW()) - TO_DAYS(date) = 21 order by date DESC"; At 12:14 PM 2/15/01 -0500, Malouin Design Graphique wrote: Hello, Anybody here would know, how I could inverse the date sorting or ordering? This script below gives me for example: 2001-01-01 2001-01-15 2001-01-31 and so on... when I wish it would gives me: 2001-01-31 2001-01-15 2001-01-01 and so on... - ?php $db = mysql_connect("servername.com", "root", "password"); mysql_select_db("stats", $db); $sql = "select * from table_name WHERE TO_DAYS(NOW()) - TO_DAYS(date) = 21 order by 'date'"; $result = mysql_query( $sql ); while ( $row = mysql_fetch_array( $result ) ) { echo "trtdspan class=\"size1\"b$row[date]/bbrimg src=\"$row[indice_url]\"br$row[indice]hr noshade size=\"1\"/span/td/tr\n"; } ? - Thanks again for your help. Merci beaucoup, Yves -- Malouin Design Graphique http://www.malouin.qc.ca Qubec (Qubec) CANADA -- 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] javascript in PHP statements
I am new to php and I am wondering if it is possible to use a javascript variable in a php statement for example: // create sql statement $sql = "select * from main where businesstype = "consultancy" and top.upper.villagename = != "0";"; Is it possible to make this work if "top.upper.villagename" is my javascript variable this would save having to write many php pages as i could just use the a generic one with the javascript variable changing. Thanks Matt Davis. -- 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] freeTDS installation
Hi! I read the instruction and am not sure on whether to proceed or not. The instruction mentioned that you install/compile the FreeTDS first then compile PHP 2nd. So, does this mean I have to compile Apache as well? Thanks, Scott -- 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]