php-general Digest 7 May 2010 13:25:04 -0000 Issue 6731
php-general Digest 7 May 2010 13:25:04 - Issue 6731 Topics (messages 304969 through 304980): Re: âäº-è¿-è´¯âè¡|æ-æ¿|å±-æ³ 304969 by: Robert Cummings Re: Can't find my error 304970 by: Jason Pruim 304971 by: David McGlone 304972 by: Robert Cummings 304975 by: Jim Lucas 304977 by: Paul M Foster 304978 by: David McGlone 304979 by: David McGlone 304980 by: Paul M Foster Re: simplexml choking on apparently valid XML 304973 by: Dan Joseph Connection error expected but ... 304974 by: Al Mangkok 304976 by: Nathan Rixham Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Ashley Sheridan wrote: [/snip] If only I could speak Chinese and was gullible I'd love to take them up on the offer for whatever it is. Thanks, Ash http://www.ashleysheridan.co.uk My Chinese is a bit rusty, but I think it says, please reply on-list to this spam message! :| Cheers, Rob. :) -- http://www.interjinn.com Application and Templating Framework for PHP ---End Message--- ---BeginMessage--- On May 5, 2010, at 9:02 PM, David McGlone wrote: On Wednesday 05 May 2010 13:12:58 Dan Joseph wrote: On Wed, May 5, 2010 at 1:06 PM, David McGlone da...@dmcentral.net wrote: On Wednesday 05 May 2010 12:59:07 Dan Joseph wrote: On Wed, May 5, 2010 at 12:55 PM, David McGlone da...@dmcentral.net wrote: 26. if(isset($_GET['ProductID'])) 27. $this-mSelectedProduct = (init) $_GET['ProductID']; You've got (init) instead of (int). Its always those little characters causing trouble! Tell me about it. I kept telling myself for the last 4 hours I can find it, I can find it I don't need to ask the list Huh! I was wrong! LOL sometimes a second set of eyes is required. We've all been in your shoes! True. I need to learn to ask for help, but I don't want to fall into the habit of taking it for granted. I'm still learning so I need to try my hardest before I go getting an answer. Hey David, As a budding PHP developer (Been doing it off and on for the past 4 years now.. Mostly off though...) I got some great advice early on from tedd sperling... When I have a problem that I can't fix... I sit down and write the e-mail to the list... Thinking through all the info that might be helpful to help debug it... What I've tried, what Im expecting... Things of that nature... Usually by the time I'm done writing the e-mail I'e figured out the problem... Not always but once I get done with writing it, if I still can't figure it out I don't feel so bad hitting send and lighting up everyones inboxes with my mindless drivel :P ---End Message--- ---BeginMessage--- On Thursday 06 May 2010 20:49:47 Jason Pruim wrote: On May 5, 2010, at 9:02 PM, David McGlone wrote: On Wednesday 05 May 2010 13:12:58 Dan Joseph wrote: On Wed, May 5, 2010 at 1:06 PM, David McGlone da...@dmcentral.net wrote: On Wednesday 05 May 2010 12:59:07 Dan Joseph wrote: On Wed, May 5, 2010 at 12:55 PM, David McGlone da...@dmcentral.net wrote: 26. if(isset($_GET['ProductID'])) 27. $this-mSelectedProduct = (init) $_GET['ProductID']; You've got (init) instead of (int). Its always those little characters causing trouble! Tell me about it. I kept telling myself for the last 4 hours I can find it, I can find it I don't need to ask the list Huh! I was wrong! LOL sometimes a second set of eyes is required. We've all been in your shoes! True. I need to learn to ask for help, but I don't want to fall into the habit of taking it for granted. I'm still learning so I need to try my hardest before I go getting an answer. Hey David, As a budding PHP developer (Been doing it off and on for the past 4 years now.. Mostly off though...) I got some great advice early on from tedd sperling... When I have a problem that I can't fix... I sit down and write the e-mail to the list... Thinking through all the info that might be helpful to help debug it... What I've tried, what Im expecting... Things of that nature... Usually by the time I'm done writing the e-mail I'e figured out the problem... Not always but once I get done with writing it, if I still can't figure it out I don't feel so bad hitting send and lighting up everyones inboxes with my mindless drivel :P That makes sense. If I carefully think about what Tedd said, I see it this way: when writing the E-Mail it will take us mentally through the steps as we are typing them and it will probably get us to realize where it went wrong. I got sortof a joke I thought about
php-general Digest 8 May 2010 03:35:09 -0000 Issue 6732
php-general Digest 8 May 2010 03:35:09 - Issue 6732 Topics (messages 304981 through 305005): Re: Can't find my error 304981 by: Jan G.B. 304984 by: Robert Cummings 304985 by: tedd 304986 by: Robert Cummings 304987 by: tedd 304988 by: Robert Cummings 304989 by: Bob McConnell 304999 by: David McGlone 305002 by: David McGlone Re: åÐ-¡¨-¼·å|»®-åÉ|ó-ñ@ 304982 by: Bill Guion Re: Two color ... while iteration [X-PHP] 304983 by: tedd Re: Can't find my error [X-PHP] 304990 by: tedd 305000 by: David McGlone Problem with IE7 caching 304991 by: Charlene Wroblewski 304992 by: Karl DeSaulniers 304997 by: Charlene Wroblewski 304998 by: Karl DeSaulniers 305001 by: Phpster 305003 by: Phpster 305005 by: Charlene Wroblewski Re: simplexml choking on apparently valid XML 304993 by: Brian Dunning 304994 by: Nathan Nobbe Finding similar results with php from mysql 304995 by: Merlin Morgenstern 304996 by: Al 305004 by: David McGlone Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- 2010/5/6 David McGlone da...@dmcentral.net: On Wednesday 05 May 2010 16:19:35 Paul M Foster wrote: On Wed, May 05, 2010 at 01:03:41PM -0400, David McGlone wrote: On Wednesday 05 May 2010 12:51:00 Ashley Sheridan wrote: On Wed, 2010-05-05 at 12:55 -0400, David McGlone wrote: I've checked and checked and re-checked and I can't figure out what I've done wrong. I'm getting a parse error: snip WOW I have spent at least 4 hours reading and re-reading it and it took you 3 seconds. That was the problem. How, how, how could I have overlooked that so many times Thank you Ashley, I should have asked you 3 hours ago. ;-) Yeah, David, the rest of us are really disappointed in you. I mean, it's not like that's ever happened to *us*. ;-} I've been studying PHP for at least 2 years straight now, after dabbling in it for about a year 6 years ago. So even though I've had my nose to the grind for a good 2 years now, I don't think I can call my mistake a rookie mistake. Thats what's frustrating to me. LOL -- Blessings, David M. I would take this as a hint to prefer intval() instead of casts. initval($foo) would have drawn a fatal error - can't be overseen. ;) Regards ---End Message--- ---BeginMessage--- Jan G.B. wrote: 2010/5/6 David McGlone da...@dmcentral.net: On Wednesday 05 May 2010 16:19:35 Paul M Foster wrote: On Wed, May 05, 2010 at 01:03:41PM -0400, David McGlone wrote: On Wednesday 05 May 2010 12:51:00 Ashley Sheridan wrote: On Wed, 2010-05-05 at 12:55 -0400, David McGlone wrote: I've checked and checked and re-checked and I can't figure out what I've done wrong. I'm getting a parse error: snip WOW I have spent at least 4 hours reading and re-reading it and it took you 3 seconds. That was the problem. How, how, how could I have overlooked that so many times Thank you Ashley, I should have asked you 3 hours ago. ;-) Yeah, David, the rest of us are really disappointed in you. I mean, it's not like that's ever happened to *us*. ;-} I've been studying PHP for at least 2 years straight now, after dabbling in it for about a year 6 years ago. So even though I've had my nose to the grind for a good 2 years now, I don't think I can call my mistake a rookie mistake. Thats what's frustrating to me. LOL -- Blessings, David M. I would take this as a hint to prefer intval() instead of casts. initval($foo) would have drawn a fatal error - can't be overseen. ;) Casts are an order of magnitude faster than function calls. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP ---End Message--- ---BeginMessage--- At 6:40 AM -0400 5/7/10, David McGlone wrote: On Thursday 06 May 2010 23:47:23 Jim Lucas wrote: Robert Cummings wrote: David McGlone wrote: On Thursday 06 May 2010 20:49:47 Jason Pruim wrote: On May 5, 2010, at 9:02 PM, David McGlone wrote: On Wednesday 05 May 2010 13:12:58 Dan Joseph wrote: On Wed, May 5, 2010 at 1:06 PM, David McGlone da...@dmcentral.net On Wednesday 05 May 2010 12:59:07 Dan Joseph wrote: On Wed, May 5, 2010 at 12:55 PM, David McGlone da...@dmcentral.net wrote: -snip- mindless chater We are surely a different breed ;-) -- Blessings, David M. To all: Yes, the breed that finds such chatter assuming. Careful, we might drool on our pocket protectors. :-) Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com ---End Message--- ---BeginMessage--- tedd wrote: At 6:40
php-general Digest 5 May 2010 16:55:13 -0000 Issue 6728
php-general Digest 5 May 2010 16:55:13 - Issue 6728 Topics (messages 304896 through 304907): Re: Inserting rows with missing IDs 304896 by: Nathan Rixham 304904 by: tedd how to check for bandwidth limitations when uploading files? 304897 by: Robert P. J. Day 304898 by: Jochen Schultz 304899 by: Tommy Pham 304900 by: Robert P. J. Day 304905 by: tedd strtotime woes 304901 by: Philip Thompson 304902 by: Peter Lind 304906 by: Philip Thompson Re: In need of CVS/SVN checkout script for Production servers [solved] 304903 by: tedd Can't find my error 304907 by: David McGlone Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Richard Quadling wrote: On 3 May 2010 14:34, Andre Polykanine an...@oire.org wrote: Hello everyone, It's not a strictly PHP question, however since I use that with PHP, I'm asking it there. How can I accomplish the task of inserting rows into MySql database with missing IDs? Say, I have rows with IDs 1, 2, 3, 5, 9, 12, 17, and 195. How do I make the check that allows to insert firstly the missing IDs and only then apply the auto-increment? Thanks! You can also reseed the autoinc column back to 0 and that will start filling in the gaps. ALTER TABLE tablename AUTO_INCREMENT = 0 may work for you (http://arstechnica.com/civis/viewtopic.php?f=20t=123689 via http://tinyurl.com/3amlo2u) quite sure that once mysql hit's the max int limit it starts filling in the gaps too - like ~96.4% sure have to agree though, one shouldn't have any dependency on sequential numbers (unless it's a number table!) best, nathan ---End Message--- ---BeginMessage--- Richard Quadling wrote: On 3 May 2010 14:34, Andre Polykanine an...@oire.org wrote: Hello everyone, It's not a strictly PHP question, however since I use that with PHP, I'm asking it there. How can I accomplish the task of inserting rows into MySql database with missing IDs? Say, I have rows with IDs 1, 2, 3, 5, 9, 12, 17, and 195. How do I make the check that allows to insert firstly the missing IDs and only then apply the auto-increment? Thanks! You can also reseed the autoinc column back to 0 and that will start filling in the gaps. ALTER TABLE tablename AUTO_INCREMENT = 0 may work for you (http://arstechnica.com/civis/viewtopic.php?f=20t=123689 via http://tinyurl.com/3amlo2u) quite sure that once mysql hit's the max int limit it starts filling in the gaps too - like ~96.4% sure have to agree though, one shouldn't have any dependency on sequential numbers (unless it's a number table!) best, nathan And if they really want just a sequential number ID that they DO NOT depend upon, they can always drop the id from the table and then recreated it -- that way it will be automatically renumbered. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com ---End Message--- ---BeginMessage--- probably not really a PHP question but i'll take a chance, anyway. i want to examine the network throughput i can get when continually uploading files from a PHP script via a POST request using the HTTP_Request2 class. i have a client-side script that simply takes files, creates a short POST request, and submits it to a server-side PHP script that takes the uploaded file and saves it. no big deal. as a test, i created a random 5M file, then looped 100 times submitting the same file, and timed it. while the system and user time was only a few seconds total, real (clock on the wall) time was 2.5 minutes. this suggests that the bottleneck is simply network transfer speed. while i'm doing these uploads, is there a way to monitor network throughput? if this is truly the bottleneck, the only real solution will be to pay a premium for faster network access, i suppose. but i'd just like to be able to produce some numbers or evidence that that's the actual problem. thoughts? rday ---End Message--- ---BeginMessage--- OS? Robert P. J. Day schrieb: probably not really a PHP question but i'll take a chance, anyway. i want to examine the network throughput i can get when continually uploading files from a PHP script via a POST request using the HTTP_Request2 class. i have a client-side script that simply takes files, creates a short POST request, and submits it to a server-side PHP script that takes the uploaded file and saves it. no big deal. as a test, i created a random 5M file, then looped 100 times submitting the same file, and timed it. while the system and user time was only a few seconds total, real (clock on the wall) time was 2.5
php-general Digest 2 May 2010 08:11:32 -0000 Issue 6723
php-general Digest 2 May 2010 08:11:32 - Issue 6723 Topics (messages 304820 through 304840): Re: Getting root privs 304820 by: Shawn McKenzie Re: Two color rows in table inside while iteration -- just say no to mod 304821 by: Richard Quadling Re: Any One See where this is going wrong? 304822 by: Gary 304825 by: Richard Quadling 304829 by: tedd 304831 by: Adam Richardson 304832 by: Gary 304837 by: Adam Richardson 304838 by: Brandon Rampersad Re: SharePoint 304823 by: Richard Quadling Re: A stupid question about classes 304824 by: Andre Polykanine 304826 by: Richard Quadling 304830 by: Andre Polykanine Re: multi dimensional array question 304827 by: Richard Quadling Re: Project TIME calculated, in PHP 304828 by: Richard Quadling 304840 by: Peter Lind wondering how to catch notice errors properly 304833 by: Rene Veerman 304834 by: Rene Veerman Re: Object or such for building a directory tree? 304835 by: Michelle Konzack pecl install pam and the current bug 304836 by: fakessh Re: Two color rows in table inside while iteration 304839 by: Paul M Foster Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On 04/30/2010 09:53 AM, Nilesh Govindarajan wrote: That was what my basic idea about implementing it, but just put up a discussion here to see if there is really any other method except sudo- and there is that cron one as suggested by Jim Lucas. Use the sudoers file to allow your apache user to run specific commands with optional wildcard parameters: http://linuxmanpages.com/man5/sudoers.5.php -- Thanks! -Shawn http://www.spidean.com ---End Message--- ---BeginMessage--- On 30 April 2010 21:20, Daevid Vincent dae...@daevid.com wrote: -Original Message- From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Modulus is the most elegant solution I reckon. Imagine if you only needed to highlight every 3rd row, or 4th? Easy to change the modulus for it, not so easy to re-work a binary switch. -Original Message- From: Richard Quadling [mailto:rquadl...@googlemail.com] The modulus is a good option when there are more than 2 states. Say a 5 row fade ... $a=0; while ($row=mysql_fetch_...){ echo tr class=??\alternate-row-.(1 + (++$a%5)).\... } giving alternate-row-1, alternate-row-2, alternate-row-3, alternate-row-4 and alternate-row-5 Okay, how many tables do you EVER see with more than TWO colors? Come on now. Show me some URL's to REAL sites (not some contrived examples) that use multiple row colors or fades in a rotating fashion. Not talking about a highlight roll-over, nor am I talking about highlighting rows of certain criteria in different colors, as both of those are not the problem for this solution. I'm talking about a straight up table that cycles each row more than 2 colors. 99% of your tables are 2 colors, and flipping a bit (i.e. Boolean) is WAY faster to compute than modulus and also easier to understand. http://www.youtube.com/watch?v=pXhKzY0BKwY ;-) (I say that out of love!) d -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Ha. OK, I actually do use a bit toggle for assigning a CSS class to the alternative rows. But I did once use % where the table represented a top10 list. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling ---End Message--- ---BeginMessage--- Adam Richardson simples...@gmail.com wrote in message news:aanlktil-gwsrxmbbwkcv7gic_ybzv9t4s7eurhpyd...@mail.gmail.com... If the OP does clean his $_POST before putting the results in his database, his database will look like 'poo' if the wrong person comes along. Gary had mentioned in his initial post he was testing on a local machine and would add the checks after resolving this issue. Also, the OP's code reads: ($image_type == 'image/pjpeg') || ($image_type == 'image/png') That should be: ($image_type == 'image/jpeg') || ($image_type == 'image/png') Tedd, Gary's original code does include jpeg AND pjpeg types (if you omit pjpeg's, you'll miss some images.) That said, Gary, Tedd did point out some important issues with the logic in your code. Additionally, you were asked politely to not top post, but you continued to do so. If you expect us
php-general Digest 1 May 2010 18:54:30 -0000 Issue 6722
php-general Digest 1 May 2010 18:54:30 - Issue 6722 Topics (messages 304802 through 304819): SharePoint 304802 by: Robbert van Andel 304803 by: Robbert van Andel 304809 by: Tommy Pham Re: How to Force IE to download text file? 304804 by: Ali Asghar Toraby Parizy Object or such for building a directory tree? 304805 by: Michelle Konzack 304810 by: tedd Re: Any One See where this is going wrong? 304806 by: Jim Lucas 304807 by: tedd 304808 by: Gary 304811 by: tedd 304813 by: Gary 304814 by: Gary 304817 by: Adam Richardson Re: multi dimensional array question 304812 by: Programming Guides 304819 by: Nick Balestra A stupid question about classes 304815 by: Andre Polykanine 304816 by: Nilesh Govindarajan Project TIME calculated, in PHP 304818 by: justino garcia Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- I've been trying to connect to our SharePoint server's webservices with PHP. I downloaded the nusoap library and have been trying to make a connection using sample code from various websites. I keep getting the following error: h1You are not authorized to view this page/h1 You do not have permission to view this directory or page using the credentials that you supplied because your Web browser is sending a WWW-Authenticate header field that the Web server is not configured to accept. h2HTTP Error 401.2 - Unauthorized: Access is denied due to server configuration.brInternet Information Services (IIS)/h2 My code looks like this: require_once('/usr/share/php/nusoap/nusoap.php'); /* Your username and password, separated by a colon Domain may be optional, depending on your setup */ $auth = username:password; /* Location of the Lists.asmx file If the list is in a subsite, the subsite must be in the path */ $wsdl = http://domain.com/depts/is/private/_vti_bin/Lists.asmx?WSDL;; /* GUID of the list */ $guid = Shared Documents; /* Setup NuSOAP Sharepoint requires NTLM Authorization You need a fairly recent version of CURL installed for this */ try { $client = new nusoap_client($wsdl,true); $client-setCredentials(,,ntlm); $client-setUseCurl(true); $client-useHTTPPersistentConnection(); $client-setCurlOption(CURLOPT_USERPWD, $auth); //$client-soap_defencoding = 'UTF-8'; $xml = ' soap:Envelope xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; soap:Body GetListItems xmlns=http://schemas.microsoft.com/sharepoint/soap/; listName' . $guid . '/listName viewNameAll Documents/viewName query xsd:schemaschema/xsd:schemaxml/query viewFields xsd:schemaschema/xsd:schemaxml/viewFields rowLimitstring/rowLimit queryOptions xsd:schemaschema/xsd:schemaxml/queryOptions webIDstring/webID /GetListItems /soap:Body /soap:Envelope '; $result = $client-call(GetListItems,$xml); if(isset($fault)) { echo pError: . $fault . /p\n; } echo pre\$result = . htmlspecialchars(print_r($result,true)) . /pre\n; } catch(Exception $e) { echo p . $e-getMessage() . /p\n; } Our SharePoint server uses integrated authentication. I've tried several permutations of the username, including just the username, domain\username and usern...@domain. All are returning the same error. My guess is that PHP is sending the username/password combination in a way that SharePoint doesn't like. Has anyone been able to connect to SharePoint's web services and if so, how? Thanks ---End Message--- ---BeginMessage--- I've been trying to connect to our SharePoint server's webservices with PHP. I downloaded the nusoap library and have been trying to make a connection using sample code from various websites. I keep getting the following error: h1You are not authorized to view this page/h1 You do not have permission to view this directory or page using the credentials that you supplied because your Web browser is sending a WWW-Authenticate header field that the Web server is not configured to accept. h2HTTP Error 401.2 - Unauthorized: Access is denied due to server configuration.brInternet Information Services (IIS)/h2 My code looks like this: require_once('/usr/share/php/nusoap/nusoap.php'); /* Your username and password, separated by a colon Domain may be optional, depending on your setup */ $auth = username:password; /* Location of the Lists.asmx file If the list is in a subsite
php-general Digest 30 Apr 2010 17:14:11 -0000 Issue 6720
php-general Digest 30 Apr 2010 17:14:11 - Issue 6720 Topics (messages 304765 through 304786): Re: Getting root privs 304765 by: Jim Lucas 304766 by: Nilesh Govindarajan 304779 by: Paul M Foster 304780 by: Ashley Sheridan 304781 by: Nilesh Govindarajan 304782 by: Nilesh Govindarajan 304783 by: Ashley Sheridan Re: Two color rows in table inside while iteration 304767 by: Daevid Vincent 304771 by: Richard Quadling 304772 by: Jay Blanchard 304776 by: Paul M Foster 304777 by: Ashley Sheridan 304778 by: Jay Ess Re: CURL cannot connect to URL - IP address - after successful connection 304768 by: Pete Ford 304769 by: ioannes.btinternet.com Re: In need of CVS/SVN checkout script for Production servers 304770 by: David Otton ldap add Invalid DN syntax 304773 by: Manolis Vlachakis 304774 by: Ashley Sheridan 304775 by: Manolis Vlachakis How to simplify the management of 250+ nodes and 1000+ users , in Drupal 304784 by: ebhakt How to Force IE to download text file? 304785 by: Ali Asghar Toraby Parizy 304786 by: Andre Polykanine Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Nilesh Govindarajan wrote: Hi, As you know there are lot of control panels lying around like Cpanel, Lxadmin, most of them based on PHP. The control panels allow editing of system files which requires root privileges, can somebody tell me how to gain root privileges inside the script so that it can be useful if I want to give my users a DNS editing interface instead of loading a big bloated control panel. We use an interface that writes everything to a DB. Then, every 5 minutes, a cron job comes around and dumps the db and builds the zone files for us. Might try something similar. It would be a lot safer then giving root access via PHP... :) -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare ---End Message--- ---BeginMessage--- On 04/30/2010 11:26 AM, Jim Lucas wrote: Nilesh Govindarajan wrote: Hi, As you know there are lot of control panels lying around like Cpanel, Lxadmin, most of them based on PHP. The control panels allow editing of system files which requires root privileges, can somebody tell me how to gain root privileges inside the script so that it can be useful if I want to give my users a DNS editing interface instead of loading a big bloated control panel. We use an interface that writes everything to a DB. Then, every 5 minutes, a cron job comes around and dumps the db and builds the zone files for us. Might try something similar. It would be a lot safer then giving root access via PHP... :) Hmm that's a great idea. But my question is in general, suppose I get some freelance job to write a control panel for managing httpd, etc. Same procedure can be used ? I think so ? -- Nilesh Govindarajan Site Server Administrator www.itech7.com मेरा भारत महान ! मम भारत: महत्तम भवतु ! ---End Message--- ---BeginMessage--- On Fri, Apr 30, 2010 at 12:11:17PM +0530, Nilesh Govindarajan wrote: On 04/30/2010 11:26 AM, Jim Lucas wrote: Nilesh Govindarajan wrote: Hi, As you know there are lot of control panels lying around like Cpanel, Lxadmin, most of them based on PHP. The control panels allow editing of system files which requires root privileges, can somebody tell me how to gain root privileges inside the script so that it can be useful if I want to give my users a DNS editing interface instead of loading a big bloated control panel. We use an interface that writes everything to a DB. Then, every 5 minutes, a cron job comes around and dumps the db and builds the zone files for us. Might try something similar. It would be a lot safer then giving root access via PHP... :) Hmm that's a great idea. But my question is in general, suppose I get some freelance job to write a control panel for managing httpd, etc. Same procedure can be used ? I think so ? If you can find an open source control panel (like webmin), you could download the code and examine it. Paul -- Paul M. Foster ---End Message--- ---BeginMessage--- On Fri, 2010-04-30 at 10:40 -0400, Paul M Foster wrote: On Fri, Apr 30, 2010 at 12:11:17PM +0530, Nilesh Govindarajan wrote: On 04/30/2010 11:26 AM, Jim Lucas wrote: Nilesh Govindarajan wrote: Hi, As you know there are lot of control panels lying around like Cpanel, Lxadmin, most of them based on PHP. The control panels allow editing of system files
php-general Digest 1 May 2010 05:54:11 -0000 Issue 6721
php-general Digest 1 May 2010 05:54:11 - Issue 6721 Topics (messages 304787 through 304801): Re: How to Force IE to download text file? 304787 by: Michael Shadle Re: Two color rows in table inside while iteration 304788 by: tedd 304789 by: tedd 304790 by: Ashley Sheridan 304791 by: tedd 304793 by: Ashley Sheridan Re: Two color rows in table inside while iteration -- just say no to mod 304792 by: Daevid Vincent 304795 by: Jason Pruim multi dimensional array question 304794 by: Nick Balestra 304796 by: Piero Steinger 304797 by: Nick Balestra Any One See where this is going wrong? 304798 by: Gary 304799 by: Ashley Sheridan 304800 by: Gary 304801 by: kranthi Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Fri, Apr 30, 2010 at 9:19 AM, Ali Asghar Toraby Parizy aliasghar.tor...@gmail.com wrote: I have written this code to export data to a text file and asks user to save generated file. It works with Firefox perfectly, but IE shows content of file instead of prompting the download window. How can I force IE to show the download dialog? ?php Header(Content-disposition: attachement; filename=data.txt); Header(Content-type: text/plain); echo $some_data; ? We usually do something like this. Although I am not sure about text files. header(Content-Disposition: attachment; filename=\.urldecode(basename($file)).\;); header(Content-Type: application/force-download); ---End Message--- ---BeginMessage--- At 10:34 AM -0400 4/30/10, Paul M Foster wrote: On Thu, Apr 29, 2010 at 05:34:38PM -0400, tedd wrote: Please critically review my example. +1 This thread came up before, and tedd's solution was the least complex, as far as I could tell. I shamelessly stole his code and regularly use it in my own projects. ;-} Paul Paul: Thanks for the plug. All the code I provide on this list and on my various web sites is for free for anyone, except for governments (i.e., local, state, federal, other), to use, review, and/or comment as they wish without any obligation to me. Oh, as for governments if you want a copy of anything please contact me directly, I have a few forms for you to fill out. The point of sharing is to improve product -- agile works. My livelihood is not compromised because someone is using a small snip-it of mine. Hopefully my real code (the stuff I sell to clients) is more involved and has more value than that. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com ---End Message--- ---BeginMessage--- At 4:37 PM +0200 4/30/10, Jay Ess wrote: Paul M Foster wrote: +1 This thread came up before, and tedd's solution was the least complex, as far as I could tell. I shamelessly stole his code and regularly use it in my own projects. ;-} Or if one choose to use Smarty template. tr bgcolor={cycle values=#ee,#d0d0d0} http://www.smarty.net/manual/en/language.function.cycle.php Yeah, like that keeps presentation separate from data while making things simpler, right? I don't think so. Embedding styling attributes in html is simply not following best practices. For example, if you have 100 pages of the above embedded code and the client says Hey, let's change the color of that table -- then you are going to have to change 100 pages of code whereas if you followed best practices then you would change only one rule in css. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com ---End Message--- ---BeginMessage--- On Fri, 2010-04-30 at 13:59 -0400, tedd wrote: At 4:37 PM +0200 4/30/10, Jay Ess wrote: Paul M Foster wrote: +1 This thread came up before, and tedd's solution was the least complex, as far as I could tell. I shamelessly stole his code and regularly use it in my own projects. ;-} Or if one choose to use Smarty template. tr bgcolor={cycle values=#ee,#d0d0d0} http://www.smarty.net/manual/en/language.function.cycle.php Yeah, like that keeps presentation separate from data while making things simpler, right? I don't think so. Embedding styling attributes in html is simply not following best practices. For example, if you have 100 pages of the above embedded code and the client says Hey, let's change the color of that table -- then you are going to have to change 100 pages of code whereas if you followed best practices then you would change only one rule in css. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com I agree. Inline styles are useful in a few fringe
php-general Digest 29 Apr 2010 10:46:06 -0000 Issue 6718
php-general Digest 29 Apr 2010 10:46:06 - Issue 6718 Topics (messages 304737 through 304749): Re: Security/Development Question 304737 by: Andre Polykanine 304738 by: Paul M Foster 304739 by: Robert Cummings 304740 by: Programming Guides 304741 by: Karl DeSaulniers 304743 by: Ross McKay 304744 by: Ashley Sheridan Re: CURL cannot connect to URL - IP address - after successful connection 304742 by: ioannes.btinternet.com 304745 by: Tommy Pham 304749 by: Gary . Malware Question 304746 by: Ashley Sheridan 304747 by: Daniel Brown 304748 by: Ross McKay Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Hello David, I'm not a PHP god but I would never ever do such things.I can't even imagine what can be the reason of passing an SQL query through a form... -- With best regards from Ukraine, Andre Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: m_elensule - Original message - From: David Stoltz dsto...@shh.org To: php-gene...@lists.php.net php-gene...@lists.php.net Date: Wednesday, April 28, 2010, 11:54:56 PM Subject: [PHP] Security/Development Question Hi folks, This isn't really a PHP question per se, but could apply to any language... I have a public facing web server, which we have a software component that helps protect us from SQL Injection, and the like. We recently have added a very small web application that is vendor supported. They said it's not working, so I investigated. I found that our software protection was blocking their pages because they are actually passing entire SQL queries in their form POSTs. Now, the app is SSL protected, and they claim the queries are not executed - only inserted into the database to be used later. They also said it's protected by the ASP.NET framework authenticationnot sure about any of that. My concern is passing SQL queries in this way is not best practice - am I wrong? Please let me know how you would react to this? See below for the stuff they are passing in the POST (obvious things like table names have been changed): /wEWBQLciq6UBwLEhISFCwLa2223bD3wK3+56LBAKc37iSDEsHMFjpB6o1vHld19wT+Tt3sY 8ECRITICAL_RESULTonDeclare @critical varchar (40) set @critical = (select top 1 code from table where id = 'clr7' and thename = 'critical') sELECT OPR_SECD.REC USER_REC_NO, RESULT.*, (SELECT RESULT_DESC FROM table WHERE code = RESULT.RES_MSTR_CODE) [DESC], [ORDER].*, (SELECT VALUE FROM table WHERE this_CODE = 'Email' AND USER_REC = OPR_SECD.RECNUM) MBMD_EMAIL, OPR_SECD.OPR_INITIAL FROM RESULTING LEFT JOIN [ORDER] ON RESULTING.ORDER_REC = [ORDERBY].RECNUM LEFT JOIN OPR_SECD ON [ORDER].DR_CODE = OPR_SECD.XREF_CODE where (RESULT.FLAG_TEXT) = @critical AND RESULT.REC = @IDSave ---End Message--- ---BeginMessage--- On Wed, Apr 28, 2010 at 04:54:56PM -0400, David Stoltz wrote: Hi folks, This isn't really a PHP question per se, but could apply to any language... I have a public facing web server, which we have a software component that helps protect us from SQL Injection, and the like. We recently have added a very small web application that is vendor supported. They said it's not working, so I investigated. I found that our software protection was blocking their pages because they are actually passing entire SQL queries in their form POSTs. Now, the app is SSL protected, and they claim the queries are not executed - only inserted into the database to be used later. They also said it's protected by the ASP.NET framework authenticationnot sure about any of that. My concern is passing SQL queries in this way is not best practice - am I wrong? Please let me know how you would react to this? See below for the stuff they are passing in the POST (obvious things like table names have been changed): /wEWBQLciq6UBwLEhISFCwLa2223bD3wK3+56LBAKc37iSDEsHMFjpB6o1vHld19wT+Tt3sY 8ECRITICAL_RESULTonDeclare @critical varchar (40) set @critical = (select top 1 code from table where id = 'clr7' and thename = 'critical') sELECT OPR_SECD.REC USER_REC_NO, RESULT.*, (SELECT RESULT_DESC FROM table WHERE code = RESULT.RES_MSTR_CODE) [DESC], [ORDER].*, (SELECT VALUE FROM table WHERE this_CODE = 'Email' AND USER_REC = OPR_SECD.RECNUM) MBMD_EMAIL, OPR_SECD.OPR_INITIAL FROM RESULTING LEFT JOIN [ORDER] ON RESULTING.ORDER_REC = [ORDERBY].RECNUM LEFT JOIN OPR_SECD ON [ORDER].DR_CODE = OPR_SECD.XREF_CODE where
php-general Digest 30 Apr 2010 05:11:42 -0000 Issue 6719
php-general Digest 30 Apr 2010 05:11:42 - Issue 6719 Topics (messages 304750 through 304764): Re: Security/Development Question 304750 by: tedd Re: Two color rows in table inside while iteration 304751 by: tedd 304752 by: Juan Rodriguez Monti 304754 by: Al 304759 by: tedd 304763 by: shiplu Re: Malware Question 304753 by: Al 304757 by: Gary . 304762 by: Al Re: CURL cannot connect to URL - IP address - after successful connection 304755 by: ioannes.btinternet.com 304756 by: Gary . In need of CVS/SVN checkout script for Production servers 304758 by: Daevid Vincent Admin Interface 304760 by: Brandon Rampersad 304761 by: Karl DeSaulniers Getting root privs 304764 by: Nilesh Govindarajan Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- At 4:54 PM -0400 4/28/10, David Stoltz wrote: My concern is passing SQL queries in this way is not best practice - am I wrong? Please let me know how you would react to this? David : First, you are not wrong. Second, that's exactly the type of security risk you want to protect yourself from. Third, never trust anything coming from client-side (i.e., POST, GET, or COOKIE). Now, they (the vendor) can throw all the layers of confusion/nonsense (it's SSL, APS.NET, or will happen later) on this as they want, but the point remains this is permitting client-side access to a database and that is NOT good. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com ---End Message--- ---BeginMessage--- At 8:29 AM -0300 4/28/10, Juan Rodriguez Monti wrote: Hello Guys, I would like to implement a two color row table for some queries that I'm doing. I use PHP to query a DB, then I use while to print all its results. I have a code pretty similar to this one : $results = Here the QUERY; echo html; echo head; echo 'link rel=stylesheet type=text/css href=style.css /'; echo /head; echo body; echo 'div id=container'; echo centerh2Results/h2/centerbr /; echo (table border='1'); echo tdstrongAt1/strong/td tdstrongAt2/strong/td tdstrongAt3/strong/td $ while ($row = while condition )) { echo (tr); echo td$row[0]/tdtd$row[1]/td td$row[2]/td td$row[3]/tdtd$row[4]/td ; echo /div; echo /body; echo /html; I just want to show you how I write the table. What I would like to know is what do you suggest to do a two color row format. Thanks!, Juan Juan: Everyone has done this at one time or another -- this is my solution. http://webbytedd.com/b/color-rows/ Plus, it validates and keeps things simple. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com ---End Message--- ---BeginMessage--- 2010/4/29 tedd tedd.sperl...@gmail.com: At 8:29 AM -0300 4/28/10, Juan Rodriguez Monti wrote: Hello Guys, I would like to implement a two color row table for some queries that I'm doing. I use PHP to query a DB, then I use while to print all its results. I have a code pretty similar to this one : $results = Here the QUERY; echo html; echo head; echo 'link rel=stylesheet type=text/css href=style.css /'; echo /head; echo body; echo 'div id=container'; echo centerh2Results/h2/centerbr /; echo (table border='1'); echo tdstrongAt1/strong/td tdstrongAt2/strong/td tdstrongAt3/strong/td $ while ($row = while condition )) { echo (tr); echo td$row[0]/tdtd$row[1]/td td$row[2]/td td$row[3]/tdtd$row[4]/td ; echo /div; echo /body; echo /html; I just want to show you how I write the table. What I would like to know is what do you suggest to do a two color row format. Thanks!, Juan Juan: Everyone has done this at one time or another -- this is my solution. http://webbytedd.com/b/color-rows/ Plus, it validates and keeps things simple. Cheers, tedd Tedd, Thanks. I'm gonna check it. I finally solved it using: if ( CONDITIONS )) { $results = query( QUERY ); $colors = array('#97b7cd','#96bf8c'); $index= 0; echo html; echo head; echo 'link rel=stylesheet type=text/css href=is.css /'; echo /head; echo body; echo 'div id=container'; echo table border='1'; echo tdstronga1/strong/td tdstronga2/strong/td tdstronga3/strong/td tdstronga4/strong/td tdstronga5/strong/td ; while ($row = CONDITIONS )) { echo 'tr style
php-general Digest 28 Apr 2010 06:39:57 -0000 Issue 6716
php-general Digest 28 Apr 2010 06:39:57 - Issue 6716 Topics (messages 304680 through 304694): Re: Error handling strategies (db related) 304680 by: Gary . 304682 by: Andrew Ballard Re: php quiz script/tutorial 304681 by: Dotan Cohen 304683 by: Adam Richardson auto indentation 304684 by: David McGlone 304685 by: shiplu 304686 by: Ashley Sheridan 304687 by: D. Dante Lorenso 304688 by: Programming Guides 304689 by: Paul M Foster 304690 by: David McGlone 304691 by: David McGlone 304692 by: Programming Guides 304693 by: Paul M Foster What is wrong with this code? 304694 by: Gary . Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On 4/27/10, tedd wrote: At 4:23 PM +0100 4/27/10, Nathan Rixham wrote: I'm still shocked you guys are still writing code that has errors in it, what's worse is you know about the errors, and instead of fixing them you're just telling the user about it! :p Here's my code that doesn't contain errors: ?php ? Wow! What license are you applying to that? Can I re-use it without fear or being sued for copyright infringement? ---End Message--- ---BeginMessage--- On Tue, Apr 27, 2010 at 12:23 PM, tedd tedd.sperl...@gmail.com wrote: At 4:23 PM +0100 4/27/10, Nathan Rixham wrote: I'm still shocked you guys are still writing code that has errors in it, what's worse is you know about the errors, and instead of fixing them you're just telling the user about it! :p Here's my code that doesn't contain errors: ?php ? Cheers, ted -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Watch out for that new warning message: br / bWarning/b: Deadbeat script. Your code does not do anything useful in bteddscript.php/b on line b1/bbr / :-) Andrew ---End Message--- ---BeginMessage--- On 26 April 2010 18:12, Paul Jinks p...@pauljinks.co.uk wrote: I'm considering my options for making quizzes mostly multiple choice type of thing, but also 'filling in the gaps'. This is in support of educational materials I'm working on. So far I've looked at Flash and javascript but have concerns about accessibility for both of these. Does anyone have any experience of writing quizzes with php and if so, can you recommend any resources to get me started? TIA Paul HTML has a form element with radio buttons, text fields, and more. Use that. -- Dotan Cohen http://bido.com http://what-is-what.com ---End Message--- ---BeginMessage--- On Tue, Apr 27, 2010 at 12:55 PM, tedd tedd.sperl...@gmail.com wrote: At 4:12 PM +0100 4/26/10, Paul Jinks wrote: I'm considering my options for making quizzes mostly multiple choice type of thing, but also 'filling in the gaps'. This is in support of educational materials I'm working on. So far I've looked at Flash and javascript but have concerns about accessibility for both of these. Does anyone have any experience of writing quizzes with php and if so, can you recommend any resources to get me started? TIA Paul Paul: I have written surveys/quizzes, but have not found a lot of resources for it. I use javascript usually to handle minor user things, such as Please answer the question before moving on or Rank these items in order of importance, or other such immediate demands of the user, but still the user input not to be trusted. IOW, you still have to scrub everything. While I could use Flash, I choose not for it would simply make my work-load harder. Quizzes and such are just a long cascade of forms. I usually use one form and populate it with questions (content and type) from a database. Then when the user submits their data, I then save the answer as a independent record with ties to the test, question and responder. The database design takes some thought to set up correctly. In the end, there is not really anything that hard about this, it's just collecting information from the user via a form and storing that information in a database. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php If you were going to use Flash, I'd go the Flex route as it makes short work of this kind of view. Ted already mentioned the DB route using PHP, but you could also use PHP to set up an XML schema that represents quizes (e.g., quizquestion id=1textWill this work?/textoptionsoptionYes
php-general Digest 27 Apr 2010 04:54:58 -0000 Issue 6714
php-general Digest 27 Apr 2010 04:54:58 - Issue 6714 Topics (messages 304619 through 304638): Re: What's your game? (X-PHP) 304619 by: Dan Joseph 304620 by: Ashley Sheridan 304621 by: Dan Joseph 304623 by: Ashley Sheridan 304624 by: Dan Joseph 304626 by: Bob McConnell 304628 by: Williams, Dewey Re: Weird problem with is_file() 304622 by: Michelle Konzack 304625 by: Peter Lind Re: getting content exceprts from the database 304627 by: Nathan Rixham Admin Panel Ebook 304629 by: Brandon Rampersad Contact form 304630 by: Watson Blair 304631 by: Adam Richardson 304632 by: Dan Joseph 304633 by: Watson Blair 304634 by: Ashley Sheridan 304635 by: Watson Blair 304636 by: Brandon Rampersad Re: CURL cannot connect to URL - IP address - after successful connection 304637 by: Tommy Pham ¡°Îå²½Á¬¹á¡±¹ÉȨ¼¤Àø·¨ 304638 by: aopi Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Mon, Apr 26, 2010 at 7:48 AM, Richard Quadling rquadl...@googlemail.comwrote: On 25 April 2010 14:16, tedd t...@sperling.com wrote: What's your game? My wife and I play enjoy Baulder's Gate on the PS2 and I like the Lego (Star Wars, Batman, etc.) games on the PSP. The kids like to play Ice Age and Cars but crash a lot and end up shouting at each other. Ice Age was a fine game! I played that one a few years ago. I'd like to see another Diablo styled game come out in the modern setting. -- -Dan Joseph www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month. Promo Code NEWTHINGS for 10% off initial order http://www.facebook.com/canishosting http://www.facebook.com/originalpoetry ---End Message--- ---BeginMessage--- On Mon, 2010-04-26 at 12:41 -0400, Dan Joseph wrote: On Mon, Apr 26, 2010 at 7:48 AM, Richard Quadling rquadl...@googlemail.comwrote: On 25 April 2010 14:16, tedd t...@sperling.com wrote: What's your game? My wife and I play enjoy Baulder's Gate on the PS2 and I like the Lego (Star Wars, Batman, etc.) games on the PSP. The kids like to play Ice Age and Cars but crash a lot and end up shouting at each other. Ice Age was a fine game! I played that one a few years ago. I'd like to see another Diablo styled game come out in the modern setting. Diablo 3 is out soon... Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- On Mon, Apr 26, 2010 at 12:36 PM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: Diablo 3 is out soon... Thanks, Ash http://www.ashleysheridan.co.uk oh cool, I did not realize.. have they set a release date yet? I didn't see one on gamestop.com... -- -Dan Joseph www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month. Promo Code NEWTHINGS for 10% off initial order http://www.facebook.com/canishosting http://www.facebook.com/originalpoetry ---End Message--- ---BeginMessage--- On Mon, 2010-04-26 at 12:48 -0400, Dan Joseph wrote: On Mon, Apr 26, 2010 at 12:36 PM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: Diablo 3 is out soon... Thanks, Ash http://www.ashleysheridan.co.uk oh cool, I did not realize.. have they set a release date yet? I didn't see one on gamestop.com... Not yet, but there's trailers on YouTube and it looks good so far. A few more classes, different mobs, it looks good! Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- On Mon, Apr 26, 2010 at 12:52 PM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: Not yet, but there's trailers on YouTube and it looks good so far. A few more classes, different mobs, it looks good! The screenshots look great as well. I am going to check YouTube for trailers. Maybe after they get Starcraft going they'll get this out. -- -Dan Joseph www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month. Promo Code NEWTHINGS for 10% off initial order http://www.facebook.com/canishosting http://www.facebook.com/originalpoetry ---End Message--- ---BeginMessage--- The last game I played was catch. My oldest grandson and I borrowed his cousin's Harlem Globetrotters miniature basketball. I taught him how to use spin to deflect the ball path when it bounced. I actually don't recall the last time I played an electronic game. Bob McConnell ---End Message--- ---BeginMessage--- The only online games I play are Guild Wars and - now - Dungeons and Dragons Online (FREE!). I haven't played vgaplanets in ages - too few servers to get a decent game. Not certain I can even install my original 3.5 inch disk anymore
php-general Digest 25 Apr 2010 12:36:41 -0000 Issue 6711
php-general Digest 25 Apr 2010 12:36:41 - Issue 6711 Topics (messages 304532 through 304545): Re: PHP not being read? 304532 by: Gary 304533 by: Karl DeSaulniers 304534 by: Gary 304535 by: Karl DeSaulniers 304536 by: Gary 304537 by: Karl DeSaulniers 304538 by: Peter Lind Re: replying to list (I give up) 304539 by: Per Jessen 304542 by: Michiel Sikma 304543 by: Michelle Konzack Recommendation for online PHP editor please 304540 by: Angus Mann 304541 by: Karl DeSaulniers 304544 by: mrfroasty 304545 by: Ashley Sheridan Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Michiel Thank you for your reply, but that is not it. I took it down to ?php $seconds=1; echo $seconds; ? Total code, and got nothing, blank screen. (this is just a silly exercise where I was going to input a date of birth and produce age in seconds) When I put the exact same code on my other machine, it showed numbers and calculations, most important, it showed something at all. This is an issue with configuration or settings somewhere, or perhaps my XAMPP is corrupt. Thank you for your reply. Gary Michiel Sikma mich...@thingmajig.org wrote in message news:y2s6cda1ded1004241703w90e8790ay46bb77c4e1162...@mail.gmail.com... On 25 April 2010 00:45, Gary g...@paulgdesigns.com wrote: What would cause a machine not to read/process php? I have a laptop that I have been ever increasing using for php scripting. I decided to do a simple experiment, it started out something like: $seconds=1; $minutes=$seconds*60; $hours=$minutes*60; $days=$hours*24; echo $seconds; echo $minutes; echo $hours; echo $days; -snip- A text editor with syntax highlighting would certainly help. There's a double quote right in front of the $hours variable on the fourth line. That's an unterminated string literal, a syntax error, which would cause PHP to abort entirely. Your php's error log probably has a message in it to this extent. The reason why you got a number of different results is probably because you added another double quote further down in later versions. But if that's somehow not it, post the entire source code of your file on a site like http://pastie.org/ so we can have a closer look. Michiel __ Information from ESET Smart Security, version of virus signature database 5057 (20100424) __ The message was checked by ESET Smart Security. http://www.eset.com __ Information from ESET Smart Security, version of virus signature database 5057 (20100424) __ The message was checked by ESET Smart Security. http://www.eset.com ---End Message--- ---BeginMessage--- Hi Gary, It is probably because you have the file named .html and not .php. I took your code: ?php $seconds=1; echo $seconds; ? and put it an a .html and .php file and put it on my server. With the.php file, I got a result of 1 for the .html file I got a blank screen. HTH, Karl On Apr 24, 2010, at 7:24 PM, Gary wrote: Michiel Thank you for your reply, but that is not it. I took it down to ?php $seconds=1; echo $seconds; ? Total code, and got nothing, blank screen. (this is just a silly exercise where I was going to input a date of birth and produce age in seconds) When I put the exact same code on my other machine, it showed numbers and calculations, most important, it showed something at all. This is an issue with configuration or settings somewhere, or perhaps my XAMPP is corrupt. Thank you for your reply. Gary Michiel Sikma mich...@thingmajig.org wrote in message news:y2s6cda1ded1004241703w90e8790ay46bb77c4e1162...@mail.gmail.com... On 25 April 2010 00:45, Gary g...@paulgdesigns.com wrote: What would cause a machine not to read/process php? I have a laptop that I have been ever increasing using for php scripting. I decided to do a simple experiment, it started out something like: $seconds=1; $minutes=$seconds*60; $hours=$minutes*60; $days=$hours*24; echo $seconds; echo $minutes; echo $hours; echo $days; -snip- A text editor with syntax highlighting would certainly help. There's a double quote right in front of the $hours variable on the fourth line. That's an unterminated string literal, a syntax error, which would cause PHP to abort entirely. Your php's error log probably has a message in it to this extent. The reason why you got a number of different results is probably because you added another double quote further down in later versions. But if that's somehow not it, post the entire source code of your file on a site
php-general Digest 21 Apr 2010 12:03:02 -0000 Issue 6704
php-general Digest 21 Apr 2010 12:03:02 - Issue 6704 Topics (messages 304273 through 304304): Re: Hello everybody - php newbie from switzerland 304273 by: Dan Joseph 304284 by: David McGlone How to enable mail function with postfix supported. 304274 by: ttplayer 304277 by: Paul M Foster 304279 by: Per Jessen Re: Mail Function Using PEAR Issues 304275 by: Alice Wei 304276 by: Alice Wei 304281 by: Peter Lind 304282 by: Ken Guest Re: How to do i18n better? 304278 by: Per Jessen PHP imap_open login delay (Cyrus IMAP) 304280 by: Evgeniy Arbatov replying to list 304283 by: David McGlone 304285 by: Michiel Sikma 304287 by: Daniel Egeberg 304288 by: Ashley Sheridan 304289 by: Karl DeSaulniers 304291 by: David McGlone 304292 by: David McGlone 304293 by: David McGlone 304295 by: Andre Polykanine 304296 by: Per Jessen 304298 by: Karl DeSaulniers 304300 by: Nick Balestra 304301 by: Ashley Sheridan 304303 by: Peter Lind 304304 by: David Robley Re: Date Math 304286 by: Michiel Sikma Want a answer about php-cgi 304290 by: Sharl.Jimh.Tsin 304297 by: shiplu 304299 by: Sharl.Jimh.Tsin 304302 by: Sharl.Jimh.Tsin ViaFirma php Client 304294 by: Ruben Crespo Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Tue, Apr 20, 2010 at 6:08 PM, Nick Balestra n...@beyounic.com wrote: I am NIck, from Locarno (southern switzerland) i am getting into php development for my own start-up company, maybe there are other people near me that would be nice to know for networking and alike. I will post here all my questions if i don't find any answer already on this list. Hi Nick, Welcome to the community! -- -Dan Joseph www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month. Promo Code NEWTHINGS for 10% off initial order http://www.facebook.com/canishosting http://www.facebook.com/originalpoetry ---End Message--- ---BeginMessage--- On Wed, 2010-04-21 at 00:08 +0200, Nick Balestra wrote: Hello everybody, I am NIck, from Locarno (southern switzerland) i am getting into php development for my own start-up company, maybe there are other people near me that would be nice to know for networking and alike. I will post here all my questions if i don't find any answer already on this list. Welcome to the list Nick. Words of Wisdom: Don't ask if PHP supports threading. ;-) -- Blessings, David M. ---End Message--- ---BeginMessage--- Hello, The PHP mail function works well with sendmail installed, however, when I install the postfix instead of sendmail , the PHP mail function can't work normally. Why? How can I do with the problem? Should I change the group postfix or apache with the command chgrp? Thank you.---End Message--- ---BeginMessage--- On Wed, Apr 21, 2010 at 10:16:50AM +0800, ttplayer wrote: Hello, The PHP mail function works well with sendmail installed, however, when I install the postfix instead of sendmail , the PHP mail function can't work normally. Why? How can I do with the problem? Should I change the group postfix or apache with the command chgrp? Thank you. Postfix is meant to function almost identically to sendmail, and usually has its own sendmail command which calls postfix. However, if you don't configure postfix properly, it won't work properly. That said, what do you mean by, can't work normally? Paul -- Paul M. Foster ---End Message--- ---BeginMessage--- ttplayer wrote: Hello, The PHP mail function works well with sendmail installed, however, when I install the postfix instead of sendmail , the PHP mail function can't work normally. Why? How can I do with the problem? Start by describing the problem in detail. Postfix comes with its own sendmail equivalent, yuo should not have any problem using postfix. I certainly don't. -- Per Jessen, Zürich (8.2°C) ---End Message--- ---BeginMessage--- Subject: Re: [PHP] Mail Function Using PEAR Issues From: a...@ashleysheridan.co.uk To: peter.e.l...@gmail.com CC: aj...@alumni.iu.edu; php-gene...@lists.php.net Date: Tue, 20 Apr 2010 21:16:03 +0100 On Tue, 2010-04-20 at 22:17 +0200, Peter Lind wrote: On 20 April 2010 20:17, Alice Wei aj...@alumni.iu.edu wrote: From: peter.e.l...@gmail.com Date: Mon, 19 Apr 2010 10:15:08 +0200 Subject: Re: [PHP] Mail Function Using PEAR Issues To: aj...@alumni.iu.edu CC: php-gene...@lists.php.net Most, if not all, mail servers keep log files. You should look for the log files to see if the mail
php-general Digest 20 Apr 2010 23:38:13 -0000 Issue 6703
php-general Digest 20 Apr 2010 23:38:13 - Issue 6703 Topics (messages 304244 through 304272): Re: Mail Function Using PEAR Issues 304244 by: Ken Guest 304259 by: Alice Wei 304268 by: Peter Lind 304269 by: Ashley Sheridan Excel Report Formatting 304245 by: Php Developer 304246 by: Tommy Pham 304247 by: Jay Blanchard 304250 by: Tommy Pham 304251 by: Jay Blanchard 304252 by: Dan Joseph 304253 by: Php Developer 304255 by: Ashley Sheridan 304258 by: Tommy Pham 304261 by: Jay Blanchard 304265 by: Php Developer 304266 by: Ashley Sheridan 304270 by: Jay Blanchard 304272 by: Tommy Pham Date Math 304248 by: Floyd Resler 304249 by: Dan Joseph 304264 by: tedd 304267 by: Paul M Foster Re: How to do i18n better? 304254 by: Ashley Sheridan 304260 by: Per Jessen 304263 by: Ashley Sheridan Re: Class constants 304256 by: Nathan Rixham Re: Directory permissions question 304257 by: Nathan Rixham Re: Get Power Saving Settings of the Server 304262 by: kranthi Hello everybody - php newbie from switzerland 304271 by: Nick Balestra Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Tue, Apr 20, 2010 at 2:10 AM, David McGlone da...@dmcentral.net wrote: On Mon, 2010-04-19 at 08:25 -0400, Alice Wei wrote: I have not changed any of my SMTP settings since my new installation of PHP with Pear. So, I am not sure what the settings are supposed to be. Would I need to install anything else even when the Pear Mail package has been installed? You might, depending on if you need to use the Mail_Mime or Mail_Queue packages also (for sending emails with attachments etc etc or for sending mails in bulk). Also there's some rather nice new functionality in the more recent versions of Mail and Net_SMTP that enable you to log the ESMTP Id of mails you have submitted to a mail server (along with the SMTP greeting sent by that server when you connect to it). Alice, I never use the PEAR install from my distro, I always download and install PEAR into my working folder. The benefit of doing it this way is so that when you move your project to a different server, nothing will break and you don't have to change anything. Sometimes when I create a new project, I'll just copy the PEAR folder from an older project to the new one. The only thing you may have to change in your PHP code is the path to the PEAR libs only if you don't put them in the same place every time. When some bug is fixed or dependencies of some of those PEAR packages change I think you'll find your attitude towards that will change - there's a pear installer so you don't have to update and track the dependencies by hand - you do regularly update your packages don't you? It's smart to do so because at the very least you don't have to implement work-arounds for bugs that have been fixed in later versions of those packages - and in the worst-case scenario it means you're not using versions that have PEAR Security Advisories issued against them. I believe it's possible to have seperate pear config files per project so you're not limited to having to use the same versions of packages across all projects. If you're using more than a handful of PEAR packages in your project you might want to write your own meta-package for the project; that way you don't have to install all those packages individually; you just do something like $pear install myProject.xml and the pear installer will download and install whichever pear packages you have described in your xml file. Details on doing this are at http://pear.php.net/manual/en/guide.users.dependencytracking.php For the record, this is the example script that I submitted to http://www.web-development-blog.com/archives/php-mail-scripts-using-smtp-transport-a-guide-for-beginners/ for demonstrating how to use the PEAR packages for sending a mail with a file attached.: ?php require_once Mail.php; require_once Mail/mime.php; $from = Fred Flintstone fli...@example.com“; $to = “Barney Rubble barn...@example.net“; $subject = “Mail Subject”; $message = “this is the text of the mail, sent using PEAR’s Mail packages.”; $host = “smtp.example.com”; $port = “25″; $headers = array (‘From’ = $from, ‘To’ = $to, ‘Subject’ = $subject); $smtp = Mail::factory(’smtp’, array (‘host’ = $host, ‘port’ = $port)); $mime = new Mail_mime(); $mime-setTxtBody($message); $mime-addAttachment(“/home/ken/logo.png”, ‘image/png’); $body = $mime-get(); $mail = $smtp-send($to, $mime-headers($headers), $body); if (PEAR
php-general Digest 19 Apr 2010 13:56:40 -0000 Issue 6701
php-general Digest 19 Apr 2010 13:56:40 - Issue 6701 Topics (messages 304189 through 304209): Re: Mail Function Using PEAR Issues 304189 by: Kevin Kinsey 304190 by: Alice Wei 304191 by: Karl DeSaulniers 304192 by: Kevin Kinsey 304194 by: Peter Lind 304205 by: Alice Wei Re: How to do i18n better? 304193 by: Peter Lind 304199 by: Michiel Sikma 304202 by: Andre Polykanine 304203 by: Per Jessen 304209 by: Robert Cummings Class constants 304195 by: Gary . 304196 by: Peter Lind 304204 by: Gary . 304206 by: Peter Lind 304207 by: Ashley Sheridan Get Power Saving Settings of the Server 304197 by: kranthi 304198 by: Richard Re: PHP include security 304200 by: Michiel Sikma Re: Does PHP support multi-thread ? 304201 by: Richard Quadling Array to csv or excel in php 304208 by: Manolis Vlachakis Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Karl DeSaulniers wrote: Hey Alice, Again, try throwing the MIME in. $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=utf-8' . \r\n; Also: $headers .= 'Errors-to: myworkingemailaddr...@foo.com' . \r\n; Which I suggested on your previous thread. Also, I see you have $from set to equal localhost. Many SMTP servers will reject this I *think*, because localhost is a hostname, not a working mailbox. Try making $from equal to a real working address - possibly the same one as your Errors-to: header.. My $0.02, KDK On Apr 18, 2010, at 10:11 AM, Alice Wei wrote: Hi, After several days, I have rebuilt my system on Linux using Ubuntu, installed PEAR and such. Thankfully, when I execute the code, it no longer gives me the error that the class is not found. Yet, when I submit the form now, I can always see the confirmation message telling me that my message has been sent, but I cannot see it even in another mailbox. Here is the code: require_once(Mail.php); $mail = Mail::factory(mail); $your_name = $_POST['your_name']; $email = $_POST['email']; $question = $_POST['question']; $comments= $_POST['comments']; $submit = $_POST['submit']; $from = localhost; $to = $email; $subject = Comments; $body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments; $host = localhost; $headers = array ('From' = $from,'To' = $to,'Subject' = $subject); $mail -send($to, $headers, $body); if (PEAR::isError($mail)) echo p . $mail-getMessage() . /p; else { echo pMessage successfully sent!/p div id='main' h1Thank You For Contacting Us/h1 pWe will contact you within the next b24 business hours/b./p pHere is what you have input:/p ulliYour Name is b . $your_name . /b/li liYour Email is b . $email . /b/li liYou contacted us because you have a b . $question . /b/li liHere are your comments: b . $comments . /b/li/ul h1Have a Nice Day!/h1/div; } } Can anyone on the list please give me some pointers on what might have been wrong here? I have not edited anything in the php.ini file regarding SMTP. Thanks. Alice ---End Message--- ---BeginMessage--- Date: Sun, 18 Apr 2010 21:02:29 -0500 From: k...@daleco.biz To: aj...@alumni.iu.edu CC: k...@designdrumm.com; php-gene...@lists.php.net Subject: Re: [PHP] Mail Function Using PEAR Issues Karl DeSaulniers wrote: Hey Alice, Again, try throwing the MIME in. $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=utf-8' . \r\n; Also: $headers .= 'Errors-to: myworkingemailaddr...@foo.com' . \r\n; Which I suggested on your previous thread. Also, I see you have $from set to equal localhost. Many SMTP servers will reject this I *think*, because localhost is a hostname, not a working mailbox. Try making $from equal to a real working address - possibly the same one as your Errors-to: header.. My $0.02, KDK On Apr 18, 2010, at 10:11 AM, Alice Wei wrote: Hi, After several days, I have rebuilt my system on Linux using Ubuntu, installed PEAR and such. Thankfully, when I execute the code, it no longer gives me the error that the class is not found. Yet, when I submit the form now, I can always see the confirmation message telling me that my message has been sent, but I cannot see it even in another mailbox. Here is the code: require_once(Mail.php); $mail = Mail::factory(mail); $your_name = $_POST['your_name']; $email = $_POST['email']; $question = $_POST['question']; $comments= $_POST['comments
php-general Digest 18 Apr 2010 12:59:40 -0000 Issue 6699
php-general Digest 18 Apr 2010 12:59:40 - Issue 6699 Topics (messages 304163 through 304170): Re: How define if javascript is on with php 304163 by: Paulo-WORK 304166 by: Manuel Lemos Re: PHP include security 304164 by: Micky Hulse 304165 by: Micky Hulse compile php 5.3.2 with php-fpm error,HELP ME 304167 by: Sharl.Jimh.Tsin 304168 by: Daniel Egeberg 304169 by: Sharl.Jimh.Tsin Replacing a special character 304170 by: Michael Stroh Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On 17/04/2010 23:13, tedd wrote: At 11:43 AM +0200 4/17/10, Michiel Sikma wrote: By having regular content and overriding it with Javascript It's probably best that you use the term progressive enhancement rather than overriding. The point being is that you have a site that delivers it's content for those with javascript turned off and those who have javascript turned on, can enjoy an enhanced version of the presentation, but not have something provided that other's can't get. Cheers, tedd I agree. Now that i know what to do, the end result will be displaying exactlly the same content and look regardless if JS is on or off. ---End Message--- ---BeginMessage--- Hello, on 04/16/2010 08:50 AM Paulo-WORK said the following: Hello and thanks for any replies that this message may get. I have a issue to solve regarding PHP. My website relies heavlly on jquery and does not dowgrade properly. I use codeigniter framework as this website has a backend . Is it possible to detect if js is on with php? And if so can it be set into a variable? Paulo Carvalho This class does exactly what you are asking: http://www.phpclasses.org/package/5297-PHP-Check-whether-Javascript-is-enabled-in-the-browser.html -- Regards, Manuel Lemos Find and post PHP jobs http://www.phpclasses.org/jobs/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ ---End Message--- ---BeginMessage--- Hi Michiel! Thanks for the help, I really appreciate it. :) It depends. What's exactly do you want to prevent? It doesn't seem like a ...snip... include, say, additional HTML content, use file_get_contents() instead. Very good points. My goal was to write a plugin that would allow me to include some static HTML template file and get the ?php include...? tags out of my CMS template. With that said, I think the only people using this code will be the developers of the templates, and not your standard user. I opted to use output buffering and readfile() for the speed, and include() would be an option if developers want to execute the code in the included file. Would file_get_contents() be faster than readfile and output buffering? Would using file_get_conents() and eval() be faster than using include() and output buffering? Without boring you all to death, I am mostly interested in learning new stuff! I actually don't think anyone will use this code other than myself. :D But I definitely agree with all your points. Thanks so much for you help! Have a great day! Cheers, Micky ---End Message--- ---BeginMessage--- What do ya'll think? Any suggestions? Sorry for the duplicate posting... I had some problems signing-up for the list. :( Also, I moved my test code to sniplr: http://snipplr.com/view/32192/php-security-include-path-cleansing/ TIA! Cheers M ---End Message--- ---BeginMessage--- Hi,everyone i download the php source tarball from php.net. and check out lastest version of php-fpm from SVN. then,i run the ./configure --prefix=/usr/local/php --bindir=/usr/local/bin --sbindir=/usr/local/sbin --sysconfdir=/etc/sysconfig --enable-embed=shared --enable-fpm --enable-safe-mode --enable-sigchild --enable-magic-quotes --enable-fd-setsize=100 --enable-calendar --enable-dba=shared --enable-exif --enable-ftp --enable-gd-native-ttf --enable-intl --enable-mbstring --enable-embedded-mysqli --enable-pcntl --disable-phar --enable-shmop --enable-soap --enable-sockets --enable-wddx --enable-zip --enable-zend-multibyte --with-libxml-dir --with-libevent-dir=/usr/local/libevent --with-fpm-user=php --with-fpm-group=php --with-config-file-path=/etc --with-exec-dir=/usr/local/bin --with-openssl --with-kerberos --with-pcre-regex --with-zlib --with-bz2 --with-curl --with-gd --with-mhash --with-imap --with-imap-ssl --with-ldap --with-ldap-sasl --with-mcrypt --with-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-mysqli=/usr/local/bin/mysql_config --with-pdo-mysql=/usr/local/bin/mysql_config --with-xmlrpc --with-pear it seems to be ok,and run make command.it looks like NO error appears,too but when i run the make install,it gives some
php-general Digest 17 Apr 2010 10:03:29 -0000 Issue 6697
php-general Digest 17 Apr 2010 10:03:29 - Issue 6697 Topics (messages 304151 through 304158): Re: PHP and schedules tasks/events 304151 by: Ryan Sun Re: changing NULL behavior in PHP arithmetic 304152 by: Shawn McKenzie 304155 by: cr.vegelin.gmail.com Re: Include security? 304153 by: Micky Hulse PHP include security 304154 by: Micky Hulse 304157 by: Michiel Sikma Re: How define if javascript is on with php 304156 by: Michiel Sikma Re: limit to var_dump? 304158 by: Michiel Sikma Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- you can setup a schedule table in db and have a cron php script check the db every time and send email if the current time is around the scheduled_at time and close the schedule after you send the email On Fri, Apr 16, 2010 at 5:35 PM, Adam Richardson simples...@gmail.com wrote: On Fri, Apr 16, 2010 at 5:15 PM, Don Wieland d...@dwdataconcepts.comwrote: On Apr 16, 2010, at 1:26 PM, Bastien Koert wrote: Run a cronjob at midnight and send the email. Track who it got sent to, so you don't duplicate it. Easy peasy! This is fine if the email is to be sent at midnight. I am looking for more refinement. For example: A user signs up for an event - 4/16/2010 @ 10:45am There is an option: Send me a reminder email X minutes/hours/days/weeks/months/years prior to the Event. so: 30 minute(s) = email sent at 4/16/2010 @ 10:15am 2 hour(s) = email sent at 4/16/2010 @ 8:45am 3 day(s) = email sent at 4/13/2010 @ 10:45am 1 week(s) = email sent at 4/9/2010 @ 10:45am 1 month(s) = email sent at 3/16/2010 @ 10:45am 1 year(s) = email sent at 4/16/2009 @ 10:45am This is really what I need... Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 305-2771 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php What about making ics files available for download? Users could easily import the event into the calendar of choice, and they could also (using the calendar software they're already familiar with) set the alarm. For instance, I can set the calendar on my cell to ring my phone to alert me to events (my preference over email reminders for important events because I sometimes get flooded with email.) Your scripts could generate the files containing event info and then automatically start the download. This allows the users to determine the mode of alarm that works best for them in their native calendar app, and you're still greatly facilitating the process by providing all of the info so they merely have to drag and drop for many apps. I realize you asked specifically for a server-side email alarm solution (I apologize for the tangent if your needs preclude this type of approach), but I thought I'd toss out the idea as this approach has proved more effective and efficient for websites I maintain. Adam -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com ---End Message--- ---BeginMessage--- On 04/15/2010 02:46 AM, cr.vege...@gmail.com wrote: Hi All, Is there an option in PHP to change the behavior of NULL in PHP functions ? Now PHP uses NULL as a 0 (zero) for arithmetic, for example: NULL + 6 = 6 NULL * 6 = 0 NULL / 6 = 0 6 / NULL = Division by zero What I need is the same behavior as #N/A (or =NA()) in Excel, where: #N/A + 6 = #N/A #N/A * 6 = #N/A #N/A / 6 = #N/A 6 / #N/A = #N/A because arithmetic operations with Unknown operands should result to Unknown ... TIA, Cor In what cases do you have a null var? -- Thanks! -Shawn http://www.spidean.com ---End Message--- ---BeginMessage--- - Original Message - From: Shawn McKenzie nos...@mckenzies.net To: cr.vege...@gmail.com Cc: php-gene...@lists.php.net Sent: Saturday, April 17, 2010 3:41 AM Subject: Re: changing NULL behavior in PHP arithmetic On 04/15/2010 02:46 AM, cr.vege...@gmail.com wrote: Hi All, Is there an option in PHP to change the behavior of NULL in PHP functions ? Now PHP uses NULL as a 0 (zero) for arithmetic, for example: NULL + 6 = 6 NULL * 6 = 0 NULL / 6 = 0 6 / NULL = Division by zero What I need is the same behavior as #N/A (or =NA()) in Excel, where: #N/A + 6 = #N/A #N/A * 6 = #N/A #N/A / 6 = #N/A 6 / #N/A = #N/A because arithmetic operations with Unknown operands should result to Unknown ... TIA, Cor In what cases do you have a null var? Hi Shawn, I am dealing with time series. As an example, assume rows per year with 12 monthly values. For 2009 all values are known, and numeric. For 2010 some values
php-general Digest 17 Apr 2010 22:13:11 -0000 Issue 6698
php-general Digest 17 Apr 2010 22:13:11 - Issue 6698 Topics (messages 304159 through 304162): Re: How define if javascript is on with php 304159 by: Ashley Sheridan 304162 by: tedd solution 304160 by: Paulo-WORK 304161 by: lala Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Sat, 2010-04-17 at 11:43 +0200, Michiel Sikma wrote: On 16 April 2010 19:02, tedd tedd.sperl...@gmail.com wrote: At 3:46 PM +0200 4/16/10, Michiel Sikma wrote: On 16 April 2010 14:06, Paulo-WORK pauloworkm...@googlemail.com wrote: -snip- Paulo: I agree. Here's a working example with everything you need: http://sperling.com/examples/javascript-detection/ Cheers, tedd Another important thing to consider is that the web is meant to be accessible to even those using a screen reader. Screen readers don't support Javascript (to my knowledge) and instead rely on properly written HTML. By having regular content and overriding it with Javascript, you're ensuring that the visually impaired, among others, can also use your site. Michiel Visually impaired aren't the only people that Javascript poses a problem for. Consider someone with Arthritis or severe RSI who cannot use a mouse as easily, if at all, as most people. A lot of Javascript uses event handlers like onclick and onmouseover, which are specifically geared towards using a mouse and won't work on a browser that is being navigated by a keyboard. Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- At 11:43 AM +0200 4/17/10, Michiel Sikma wrote: By having regular content and overriding it with Javascript It's probably best that you use the term progressive enhancement rather than overriding. The point being is that you have a site that delivers it's content for those with javascript turned off and those who have javascript turned on, can enjoy an enhanced version of the presentation, but not have something provided that other's can't get. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com ---End Message--- ---BeginMessage--- I have reached a solution for my problem with js. Following all the sugestions and using jquery turned out to be quite simple. using .ide( ) and .show( ) i am able to change the #div with Js enabled content and no js. So defining with css for example: #main{display:none;} #main_nojs{display:block;} if js is enabled on load Jquery will .hide( #min_nojs) and -.show(#main) if is off #main is already defined as display:none and #main_nojs as display:block. Paulo Carvalho ---End Message--- ---BeginMessage--- Paulo-WORK wrote: I have reached a solution for my problem with js. Following all the sugestions and using jquery turned out to be quite simple. using .ide( ) and .show( ) i am able to change the #div with Js enabled content and no js. So defining with css for example: #main{display:none;} #main_nojs{display:block;} if js is enabled on load Jquery will .hide( #min_nojs) and -.show(#main) if is off #main is already defined as display:none and #main_nojs as display:block. Paulo Carvalho Here's how some others solved the problem. http://thedailywtf.com/articles/bulletproof-javascript-detection.aspx I took out all my money (both cents) and put it under my mattress ;D Mike Wright ---End Message---
php-general Digest 16 Apr 2010 09:38:25 -0000 Issue 6695
php-general Digest 16 Apr 2010 09:38:25 - Issue 6695 Topics (messages 304122 through 304128): Re: Zip Search 304122 by: Nathan Nobbe 304123 by: Jason Pruim Re: Basic switch statement 304124 by: Jason Pruim 304125 by: Jason Pruim 304126 by: Adam Richardson 304128 by: Jan G.B. Re: class attributes and __construct 304127 by: Larry Garfield Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Thu, Apr 15, 2010 at 1:51 PM, Tommy Pham tommy...@gmail.com wrote: -Original Message- From: Nathan Nobbe [mailto:quickshif...@gmail.com] Sent: Thursday, April 15, 2010 12:41 PM To: Jack Cc: php-gene...@lists.php.net Subject: Re: [PHP] Zip Search On Thu, Apr 15, 2010 at 1:21 PM, Jack dewebd...@gmail.com wrote: Hello All, Can anyone recommend a good open source zip code search application and database? depends on what you want, u.s., canada mexico are pretty easy to find but for other non domestic countries if you find something good feel free to share :) for a nice freebie that works on u.s. locations, snag the geoip extension from pecl - http://php.net/manual/en/book.geoip.php -nathan IIRC, geoip is lookup based on host name or IP address for country, region, city, etc... similar to whois for DNS. I think the OP wants to look geographic information, such as city, county, state/province, etc..., based on a given zip code like 92723. ahh, perhaps a hasty reply on my part - heres a nice freebie mentioned by geoip - http://geocoder.ibegin.com/downloads.php -nathan ---End Message--- ---BeginMessage--- On Apr 15, 2010, at 3:21 PM, Jack wrote: Hello All, Can anyone recommend a good open source zip code search application and database? If it's us zip's you want... I'd go straight to the source... http://www.usps.com/zip4/welcome.htm?from=home_headerpage=findazipcode The post office also does have API's for hooking into it if you can handle the restrictions since they are the government :) ---End Message--- ---BeginMessage--- On Apr 15, 2010, at 8:55 AM, tedd wrote: At 4:13 PM -0400 4/14/10, Al wrote: Incidentally, about formatting scripts, one of the reasons I like phpEdit is that it has a terrific code beautifier. You can set it for phpDoc or Pear rendering. And, it auto indents, etc. as you enter stuff. Al... Unfortunately, there is no phpEdit version for the Mac. Currently, I use GoLive (without all the WYSIWYG bloatware), but it limitations are showing. I like Eclipse, but the learning curve is high and has more features than I need. Hey tedd I just recently started using netbeans and it looks like it may fit the bill... it's simple enough to understand but can be extended if you want to. It also runs better on my Mac then Eclipse ever did. Just something that might be worth checking out :) ---End Message--- ---BeginMessage--- On Apr 15, 2010, at 9:24 AM, Ashley Sheridan wrote: On Thu, 2010-04-15 at 08:55 -0400, tedd wrote: Have you tried Coder on the Mac? Most developers I know who use Macs (it's not the oxymoron it sounds! :p ) Most Mac people would say the morons use Windows ;) But that's another story for another list! :) ---End Message--- ---BeginMessage--- On Thu, Apr 15, 2010 at 5:55 PM, Jason Pruim li...@pruimphotography.comwrote: On Apr 15, 2010, at 8:55 AM, tedd wrote: At 4:13 PM -0400 4/14/10, Al wrote: Incidentally, about formatting scripts, one of the reasons I like phpEdit is that it has a terrific code beautifier. You can set it for phpDoc or Pear rendering. And, it auto indents, etc. as you enter stuff. Al... Unfortunately, there is no phpEdit version for the Mac. Currently, I use GoLive (without all the WYSIWYG bloatware), but it limitations are showing. I like Eclipse, but the learning curve is high and has more features than I need. Hey tedd I just recently started using netbeans and it looks like it may fit the bill... it's simple enough to understand but can be extended if you want to. It also runs better on my Mac then Eclipse ever did. Just something that might be worth checking out :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php +1 Netbeans -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com ---End Message--- ---BeginMessage--- 2010/4/16 Adam Richardson simples...@gmail.com: On Thu, Apr 15, 2010 at 5:55 PM, Jason Pruim li...@pruimphotography.comwrote: On Apr 15, 2010, at 8:55 AM, tedd wrote: At 4:13 PM -0400 4/14/10, Al wrote
php-general Digest 15 Apr 2010 07:46:44 -0000 Issue 6693
php-general Digest 15 Apr 2010 07:46:44 - Issue 6693 Topics (messages 304098 through 304105): Re: PHP MYSQL sorting 304098 by: Ernie Kemp Re: Basic switch statement 304099 by: Al 304100 by: Al 304101 by: Paul M Foster 304103 by: Ashley Sheridan 304104 by: Paul M Foster Re: problems with feature '--with-pdo-oci' RPM (spec) 304102 by: Kevin Kinsey changing NULL behavior in PHP arithmetic 304105 by: cr.vegelin.gmail.com Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Thanks for your thoughts. Ajax is the way to go... Thanks, .../Ernie -Original Message- From: tedd [mailto:tedd.sperl...@gmail.com] Sent: April-12-10 10:18 AM To: Ernie Kemp; 'PHP General List' Subject: Re: [PHP] PHP MYSQL sorting At 8:16 PM -0400 4/11/10, Ernie Kemp wrote: Simple idea I thought. I need a webpage that displays a drop down list of number with a checkbox on the side that when checked will select the database again only in descending order. Small database with maybe 100 records. The user can click the submit button when they have located the correct number. The trick is to make the checkbox trigger a new Select statement. Thanks. Ernie: form name=myForm action= input type=checkbox name=sort id=sort onClick=getData(this) /form The javascript getData() will have to launch a php script to get the data again OR you can simply sort the data yourself using sort(). Here's another idea using jQuery: http://webbytedd.com/jquery/sortable-table/ Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.801 / Virus Database: 271.1.1/2806 - Release Date: 04/12/10 02:32:00 ---End Message--- ---BeginMessage--- On 4/14/2010 12:28 PM, tedd wrote: At 5:06 PM -0400 4/13/10, Robert Cummings wrote: Nathan Rixham wrote: well that's one job I'm not getting :p Well you DID get 66.7%. I've met coders that would stare at the answer and still not understand :D Cheers, Rob. Well.. count me among those staring. I just don't get those type of things until I see them actually work. My logic works the other way -- when presented with a logic problem, I come up with a solution that works the way I think and I always to solve the problem presented. Perhaps my solution isn't as clever nor as cryptic as others, but it's always easier to read and understand. Cheers, tedd I'm with you Tedd. I'm forever cussing myself when I use a super clever trick to solve a logic problem and then later can't figure out how the damn thing worked even though I documented it. Incidentally, about formatting scripts, one of the reasons I like phpEdit is that it has a terrific code beautifier. You can set it for phpDoc or Pear rendering. And, it auto indents, etc. as you enter stuff. Al... ---End Message--- ---BeginMessage--- On 4/14/2010 12:28 PM, tedd wrote: At 5:06 PM -0400 4/13/10, Robert Cummings wrote: Nathan Rixham wrote: well that's one job I'm not getting :p Well you DID get 66.7%. I've met coders that would stare at the answer and still not understand :D Cheers, Rob. Well.. count me among those staring. I just don't get those type of things until I see them actually work. My logic works the other way -- when presented with a logic problem, I come up with a solution that works the way I think and I always to solve the problem presented. Perhaps my solution isn't as clever nor as cryptic as others, but it's always easier to read and understand. Cheers, tedd I'm with you Tedd. I'm forever cussing myself when I use a super clever trick to solve a logic problem and then later can't figure out how the damn thing worked even though I documented it. Incidentally, about formatting scripts, one of the reasons I like phpEdit is that it has a terrific code beautifier. You can set it for phpDoc or Pear rendering. And, it auto indents, etc. as you enter stuff. Al... ---End Message--- ---BeginMessage--- On Wed, Apr 14, 2010 at 12:28:13PM -0400, tedd wrote: At 5:06 PM -0400 4/13/10, Robert Cummings wrote: Nathan Rixham wrote: well that's one job I'm not getting :p Well you DID get 66.7%. I've met coders that would stare at the answer and still not understand :D Cheers, Rob. Well.. count me among those staring. I just don't get those type of things until I see them actually work. My logic works the other way -- when presented with a logic problem, I come up with a solution
php-general Digest 15 Apr 2010 19:54:54 -0000 Issue 6694
php-general Digest 15 Apr 2010 19:54:54 - Issue 6694 Topics (messages 304106 through 304121): Re: changing NULL behavior in PHP arithmetic 304106 by: Ashley Sheridan 304108 by: kranthi 304109 by: cr.vegelin.gmail.com Re: how to overload accessible methods 304107 by: Richard Quadling Re: Basic switch statement 304110 by: tedd 304111 by: tedd 304112 by: Bastien Koert 304113 by: Ashley Sheridan class attributes and __construct 304114 by: Ashley Sheridan 304115 by: Tommy Pham 304116 by: Ashley Sheridan 304117 by: Fernando 304118 by: Tommy Pham Zip Search 304119 by: Jack 304120 by: Nathan Nobbe 304121 by: Tommy Pham Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Thu, 2010-04-15 at 09:46 +0200, cr.vege...@gmail.com wrote: Hi All, Is there an option in PHP to change the behavior of NULL in PHP functions ? Now PHP uses NULL as a 0 (zero) for arithmetic, for example: NULL + 6 = 6 NULL * 6 = 0 NULL / 6 = 0 6 / NULL = Division by zero What I need is the same behavior as #N/A (or =NA()) in Excel, where: #N/A + 6 = #N/A #N/A * 6 = #N/A #N/A / 6 = #N/A 6 / #N/A = #N/A because arithmetic operations with Unknown operands should result to Unknown ... TIA, Cor You can't really, because PHP is a loosely typed language, which means it silently converts values as required by the situation. When you use mathematical operators, PHP converts the values to numbers, and NULL maps to a 0 (as does the boolean false and an empty string) The only way I can see to fix your problem is to check the value of the variables you are working on with something like is_int() Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- because arithmetic operations with Unknown operands should result to Unknown ... in PHP Unknown values are represented by NaN, not NULL http://php.net/manual/en/function.is-nan.php but what surprises me is is_nan(6/0) = (bool)false (along with a warning) Now PHP uses NULL as a 0 (zero) for arithmetic I dont expect anything different, because intval(null) is 0. ---End Message--- ---BeginMessage--- From: Ashley Sheridan To: cr.vege...@gmail.com Cc: php-gene...@lists.php.net Sent: Thursday, April 15, 2010 10:08 AM Subject: Re: [PHP] changing NULL behavior in PHP arithmetic On Thu, 2010-04-15 at 09:46 +0200, cr.vege...@gmail.com wrote: Hi All, Is there an option in PHP to change the behavior of NULL in PHP functions ? Now PHP uses NULL as a 0 (zero) for arithmetic, for example: NULL + 6 = 6 NULL * 6 = 0 NULL / 6 = 0 6 / NULL = Division by zero What I need is the same behavior as #N/A (or =NA()) in Excel, where: #N/A + 6 = #N/A #N/A * 6 = #N/A #N/A / 6 = #N/A 6 / #N/A = #N/A because arithmetic operations with Unknown operands should result to Unknown ... TIA, Cor You can't really, because PHP is a loosely typed language, which means it silently converts values as required by the situation. When you use mathematical operators, PHP converts the values to numbers, and NULL maps to a 0 (as does the boolean false and an empty string) The only way I can see to fix your problem is to check the value of the variables you are working on with something like is_int() Thanks, Ash http://www.ashleysheridan.co.uk Thanks for replying. I tried the predefined PHP constant NAN. However, NAN + 6 = 6, so NAN is can't be used either. To bypass the problem, I now use is_null(). is_int() can also be used, but does it have advantages over is_null() ? Thanks, Cor---End Message--- ---BeginMessage--- On 13 April 2010 17:25, Ryan Sun ryansu...@gmail.com wrote: this is a class for corntab job, and the validation is very simple, just check if the status of user is active when cron job runs, if not, throws an exception, other developers won't want to overwrite this validation. which method of user class will be called is configurable via website backed page(we write the name of methods directly in to schedule table). Using private methods will solve the problem but since we write public methods for all the other cron classes, I just want to keep the style to make less confusion. On Tue, Apr 13, 2010 at 12:11 PM, Nathan Rixham nrix...@gmail.com wrote: Ryan Sun wrote: I'm writing an abstract parent class which only contain a validate method, other developers will extend this class and add many new public methods, every new methods will need to perform a validate first. Won't it be good if validate get called automatically before every method call so
php-general Digest 13 Apr 2010 15:27:01 -0000 Issue 6690
php-general Digest 13 Apr 2010 15:27:01 - Issue 6690 Topics (messages 304021 through 304030): Re: Mail Function Problem 304021 by: Karl DeSaulniers 304022 by: kranthi 304024 by: Ashley Sheridan 304025 by: Alice Wei 304026 by: Ashley Sheridan Re: Solution 304023 by: Nathan Rixham Saving form data into session before leaving a page 304027 by: Merlin Morgenstern 304028 by: Peter Lind 304029 by: Ashley Sheridan 304030 by: Paul M Foster Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Hey Alice, Try throwing the MIME in. Sometimes messages get thrown in an abyss if they don't know the MIME version or content type of an email. They think its spam and so you wouldn't get an error message on your end. Just no email. $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=utf-8' . \r\n; Karl On Apr 12, 2010, at 10:24 PM, Alice Wei wrote: From: kranthi...@gmail.com Date: Tue, 13 Apr 2010 07:41:19 +0530 Subject: Re: [PHP] Mail Function Problem To: aj...@alumni.iu.edu CC: k...@daleco.biz; php-gene...@lists.php.net thats weired... Mail.php contains the class Mail. So getting a class not found error is not possible... (require_once stops the script in case it can't find Mail.php) Do I need to move the Mail PEAR class to the same folder as my web folder ensure that C:/xampp/php/PEAR folder is added to your include list I thought so too, this is what I have in my php.ini: ; PHP's default setting for include_path is .;/path/to/php/pear ; http://php.net/include-path include_path = .;C:\xampp\php\PEAR This is the contents of my C:\xampp\php\PEAR\Mail: mail.php mime.php mimeDecode.php mimePart.php null.php RFC822.php sendmail.php smtp.php Unless, I have to do require_once(mail.php)? I am getting confused. Alice _ Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. http://www.windowslive.com/campaign/thenewbusy? ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2 Karl DeSaulniers Design Drumm http://designdrumm.com ---End Message--- ---BeginMessage--- when you install pear package Mail a file called Mail.php will be installed into C:/xampp/php/PEAR Mail.php contains the class Mail. So getting a class not found error is not possible.. are you sure you are doing require_once 'Mail.php' ? ---End Message--- ---BeginMessage--- On Mon, 2010-04-12 at 12:25 -0400, Alice Wei wrote: Date: Mon, 12 Apr 2010 11:09:42 -0500 From: k...@daleco.biz To: aj...@alumni.iu.edu CC: a.bovane...@gmail.com; php-gene...@lists.php.net Subject: Re: [PHP] Mail Function Problem Alice Wei wrote: Hi! You have the following php.ini params:SMTP = smtp.live.com smtp_port = 587 live.com not support relay and it requires authentication. Is there an email account that I could try? I thought most email accounts requires authentication anyway. Well, therein lies the rub, as the Bard said (maybe). PHP's mail() was built on a general assumption that there would be a local SMTP server. It supports remote SMTP, but I'm not aware of any ability to do SMTP auth, even in the PEAR packages. You might just wanna read up on mail in general. The php.net/mail page lists several relevant RFC's, and has links to most of the PEAR mail classes, etc. You should definitely read up on live.com's email configuration. If they use SMTP auth, I'm not sure you can do this (per above). If it uses, say, POP before SMTP for authorization, you might be able to hack something together with the PHP IMAP functions, or even sockets, but you're getting into a big lotta work for what seems a small thing. This is what I am talking about. Two years ago when I first set up my own server with Linux and not Windows, I never had to deal with this. Perhaps the authentication has since then got stricter, but it should not be so much of a heck of a deal. I found this doc from ATT's website, http://helpme.att.net/pdf/uverse/uverse_hsi_qsg_english.pdf, so obviously the smtp server I provided earlier is probably not up to date. I think I will fiddle around with the php.ini file and see what else is there. Thanks. Alice _ Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1
php-general Digest 12 Apr 2010 14:18:40 -0000 Issue 6688
php-general Digest 12 Apr 2010 14:18:40 - Issue 6688 Topics (messages 303993 through 304004): Re: PHP MYSQL sorting 303993 by: kranthi 303995 by: Nilesh Govindarajan 304004 by: tedd Re: need help w/ unfamiliar syntax 303994 by: kranthi 303996 by: Robert Cummings Mail Function Problem 303997 by: Alice Wei 303999 by: Kevin Kinsey 304000 by: Peter Lind 304001 by: Alice Wei 304002 by: Alexey Bovanenko 304003 by: Alice Wei Re: Inserting into multiple tables 303998 by: Paul M Foster Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- You can use javascript to trigger an onclick function every time a checkbox is selected. The onclick function can make an ajax call to a remote php script which can then make the database query. ---End Message--- ---BeginMessage--- On 04/12/10 05:46, Ernie Kemp wrote: Simple idea I thought. I need a webpage that displays a drop down list of number with a checkbox on the side that when checked will select the database again only in descending order. Small database with maybe 100 records. The user can click the submit button when they have located the correct number. The trick is to make the checkbox trigger a new Select statement. Thanks. Use jquery, trigger an ajax request onclick of that checkbox. -- Nilesh Govindarajan Site Server Administrator www.itech7.com मेरा भारत महान ! मम भारत: महत्तम भवतु ! ---End Message--- ---BeginMessage--- At 8:16 PM -0400 4/11/10, Ernie Kemp wrote: Simple idea I thought. I need a webpage that displays a drop down list of number with a checkbox on the side that when checked will select the database again only in descending order. Small database with maybe 100 records. The user can click the submit button when they have located the correct number. The trick is to make the checkbox trigger a new Select statement. Thanks. Ernie: form name=myForm action= input type=checkbox name=sort id=sort onClick=getData(this) /form The javascript getData() will have to launch a php script to get the data again OR you can simply sort the data yourself using sort(). Here's another idea using jQuery: http://webbytedd.com/jquery/sortable-table/ Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com ---End Message--- ---BeginMessage--- guess you are looking for http://www.php.net/manual/en/language.types.string.php#language.types.string.parsing ---End Message--- ---BeginMessage--- Daniel Egeberg wrote: On Sun, Apr 11, 2010 at 20:30, lala l...@mail.theorb.net wrote: Hi all, I've wasted two days trying to find this in the documentation. Google is no help here either; they only index text. While looking at some code using objects I came across this: $this-{$spec} The example works with or without the curly braces, but I know they aren't there for just for decoration ;) Will somebody be so kind as to point me where in the docs this syntax is explained? tia It's documented here: http://php.net/manual/en/language.variables.variable.php It works for function and class names as well. The style used above is superfluous since no additional operations are being done within the braces and so the braces are redundant. This is why it works either way. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP ---End Message--- ---BeginMessage--- Hi, I have an issue here where I see no PHP errors on my mail function usage, and yet I am not getting the mail in the desired account. Here is what I have for my PHP code: $headers = From: aj...@alumni.iu.edu; $to = aj...@alumni.iu.edu ; $subject = Comments Regarding My Studio; $body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments; mail($to, $subject, $body,$headers); This is what I have in my PHP.ini: [mail function] ; For Win32 only. SMTP = smtp.live.com smtp_port = 587 ; For Win32 only. sendmail_from = aj...@alumni.iu.edu ; For Unix only. You may supply arguments as well (default: sendmail -t -i). ;sendmail_path = ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = Yet, I don't see any mail in my aj...@alumni.iu.edu Mailbox, can anyone on the list please give me some pointers on what I may have done wrong here? Thanks for your help. _ The New Busy is not the old busy
php-general Digest 13 Apr 2010 03:24:10 -0000 Issue 6689
php-general Digest 13 Apr 2010 03:24:10 - Issue 6689 Topics (messages 304005 through 304020): Re: Inserting into multiple tables 304005 by: Gary 304010 by: tedd 304012 by: Gary Re: Mail Function Problem 304006 by: Kevin Kinsey 304007 by: Alice Wei 304008 by: Teus Benschop 304009 by: kranthi 304011 by: Kevin Kinsey 304015 by: Alice Wei 304017 by: Karl DeSaulniers 304018 by: Alice Wei 304019 by: kranthi 304020 by: Alice Wei Solution 304013 by: Gary 304014 by: Peter Lind 304016 by: Karl DeSaulniers Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Nathan Thank you for your excellent explanation! One of the reasons I love this board is the vast knowledge that people are willing to share. I believe I understand the importance of normalization, however one of my original questions seems to still stand. If normalization is so important, why is it that the INSERT INTO multiple tables is not a standard command or procedure?. I'm not saying it has to be easy, but it should be well known. I really thought when I first asked the question I was going to get multiple similar answers, or someone was going to look at my script and tell me I omitted some simple puncuatuion (or other simple mistake)...which has not been the case. Even if the answer were Cant be done, you need to write a separate script for each insert, that would be ok. But I have to think that someone reading this board has accomplished, somehow, writing to separate tables in the same DB. Again, thank you for all the information and your time. Gary Nathan Rixham nrix...@gmail.com wrote in message news:4bc21b88.3090...@gmail.com... Gary wrote: Adam Thank you for your well thought out response. Two points: I did not include any anti-injection functions because this was an experiment for multiple tables, it is on my machine only. Since these are php scripts, I dont think anyone will mind (not to mention this board always provides great answers)., However I think I may have answered my question about the importance of normalization of tables. I have written a number of databases used on various web sites, however, they all are used as a collection of data from input forms. Most of the information about mutilple tables deals with the retreval of data from, not inserting into, meaning they are more used for known data inserted by the database owner/administrator to be retrieved by queries into the DB. Am I on the right track? I'm unsure if this is of use to you or not (and it has been covered in part already), but here goes: Generally when working with database tables, we normalise, or split information up at natural points where you have a greater than 1-1 relationships between the data items. An example may be a table structure to store User, Blog Post and Comments. With this common example it's very inefficient to store all the information in one table, because it is split naturally in to three. We have three relationships here; all 1-* (meaning one to many). 1 User to * Blog Posts 1 Blog Post to * Comments Thus naturally, and on first glance we would have 3 tables: | Table User -- | UserID | Username | Password | ... | Table BlogPost -- | PostID | PostTitle | PostersUserID | ... | Table Comment -- | CommentID | CommentOnPostID | CommentersUserID | ... As you can see from the above, all of the rows (or items) in our tables are linked via IDs to each other. We can further normalise the above tables to take in to account *-* (many to many) type relationships, and to fully separate cross cutting concerns. For instance it may be that a BlogPost has 3 different Users as author(s). aside: cross cutting concerns can be considered as something (in this case a table) trying to handle something which is of no concern to it (in this case the BlogPost table needs to be aware of Users and their IDs). To handle the aforementioned we can introduce something commonly referred to as link tables, consider: | Table User -- | UserID | Username | Password | ... | Table BlogPost -- | PostID | PostTitle | ... | Table BlogPostAuthors -- | BlogPostID | UserID | The link table BlogPostAuthors acts as a many-to-many join table between BlogPosts and Users. Similarly we could introduce the same
php-general Digest 12 Apr 2010 00:16:16 -0000 Issue 6687
php-general Digest 12 Apr 2010 00:16:16 - Issue 6687 Topics (messages 303986 through 303992): Re: Inserting into multiple tables 303986 by: Gary 303990 by: Nathan Rixham Re: PHP execute very slow : PHP Version 5.2.6 303987 by: Al need help w/ unfamiliar syntax 303988 by: lala 303989 by: Daniel Egeberg Re: imagecopyresize 303991 by: Karl DeSaulniers PHP MYSQL sorting 303992 by: Ernie Kemp Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Tommy Thanks for your reply. The code you had read I was trying to concatonate the insert commands without the semicolon at the endI had also tried using the semicolons on each line...same result. I am reading about the mysqli_multi_query now, so far I am not getting the results. Interestingly, it lead me to the mysqli_store_result(), however it said it returned a false result on the insert command. Thank you for your reply... Gary Tommy Pham tommy...@gmail.com wrote in message news:013601cad93e$e0bca6a0$a235f3...@com... Hi Gary, -Original Message- From: Gary [mailto:gwp...@ptd.net] Sent: Saturday, April 10, 2010 2:28 PM To: php-gene...@lists.php.net Subject: [PHP] Inserting into multiple tables I am experimenting with multiple tables, it is only a test that is my local machine only. This is the current code, which does not work , I have tried to concatonate the insert statements. I have tried multiple $query variables, but it is just overwriting itself (only the last one gets inserted). I also tried writing the $query as an array, which got me an error message (saying it was expecting a string and I offered an array). Someone point me in the right direction? Gary !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / titleUntitled Document/title /head body form action=?php echo $_SERVER['PHP_SELF'];? method=post labelFirst Name /label input name=fname type=text /br /br / labelLast Name /labelinput name=lname type=text /br /br / labelStreet Address /labelinput name=street type=text /br /br / labelTown /labelinput name=town type=text /br /br / labelState /labelinput name=state type=text /br /br / labelZip Code/labelinput name=zip type=text /br /br / labelTelephone/labelinput name=phone type=text /br /br / labelFax/labelinput name=fax type=text /br /br / labelE-Mail/labelinput name=email type=text /br /br / labelComments/labelbr /textarea name=comments cols=100 rows=15/textareabr /br / input name=submit type=submit value=submit / /form ?php $fname=($_POST['fname']); $lname=($_POST['lname']); $street=($_POST['street']); $town=($_POST['town']); $state=($_POST['state']); $zip=($_POST['zip']); $phone=($_POST['phone']); $fax=($_POST['fax']); $email=($_POST['email']); $comments=($_POST['comments']); $REMOTE_ADDR=$_SERVER['REMOTE_ADDR']; $dbc=mysqli_connect('localhost','root','','test'); $query=INSERT INTO address (street, town, state, zip).VALUES('$street','$town','$state','$zip'). INSERT INTO comments(comments).VALUES('$comments'). INSERT INTO contact(phone,fax,email).VALUES('$phone','$fax','$email'). INSERT INTO name (fname, lname).VALUES('$fname','$lname'); $result = mysqli_query($dbc, $query) or die('Error querying database.'); I see 2 problems: 1) your sql statements are not separated by semicolon - very important when executing multiquery 2) you could try mysql_multi_query http://www.php.net/manual/en/mysqli.multi-query.php Regards, Tommy mysqli_close($dbc); ? /body /html __ Information from ESET Smart Security, version of virus signature database 5016 (20100410) __ The message was checked by ESET Smart Security. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Information from ESET NOD32 Antivirus, version of virus signature database 5017 (20100411) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __ Information from ESET NOD32 Antivirus, version of virus signature database 5017 (20100411) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com ---End Message--- ---BeginMessage--- Gary wrote: Adam Thank you for your well thought out response. Two points: I did not include any anti-injection functions because this was an experiment for multiple tables, it is on my machine only. Since these are php scripts, I dont think anyone will mind (not to mention this board always provides great
php-general Digest 9 Apr 2010 19:15:22 -0000 Issue 6683
php-general Digest 9 Apr 2010 19:15:22 - Issue 6683 Topics (messages 303930 through 303950): Forgot what to install 303930 by: David McGlone 303931 by: kranthi 303932 by: viraj 303934 by: shiplu 303943 by: David McGlone 303944 by: Bob McConnell Re: No notices for undefined index 303933 by: shiplu 303937 by: Ashley Sheridan 303942 by: Bob McConnell 303945 by: Nathan Rixham 303946 by: Nathan Rixham another useless message. 303935 by: Rene Veerman 303939 by: Nilesh Govindarajan 303940 by: Rene Veerman 303941 by: Peter Lind 303948 by: Dan Joseph Sending e-mail through an SMTP with authentification 303936 by: Andre Polykanine Re: Beginner's question: How to run a PHP web application locally? 303938 by: Rene Veerman Re: Sort two coupled arrays [my solution] 303947 by: tedd 303949 by: Robert Cummings Zend DB Table - WHERE as OR? 303950 by: Dan Joseph Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Hey guys, quick question. I had to re-install my Ubuntu, and I forgot what package I needed so firefox will display the php files and not ask me to if I want to download them. I've done installed PHP5, mysql, and php-mysql. What did I miss. I know the package name, but it's completely slipping my mind right now. Thanks David M. ---End Message--- ---BeginMessage--- you forgot httpd KK. On Fri, Apr 9, 2010 at 08:32, David McGlone da...@dmcentral.net wrote: Hey guys, quick question. I had to re-install my Ubuntu, and I forgot what package I needed so firefox will display the php files and not ask me to if I want to download them. I've done installed PHP5, mysql, and php-mysql. What did I miss. I know the package name, but it's completely slipping my mind right now. Thanks David M. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- it's apache2 module for php #apt-cache search php5 apache libapache2-mod-php5 - server-side, HTML-embedded scripting language (Apache 2 module) ~viraj On Fri, Apr 9, 2010 at 8:32 AM, David McGlone da...@dmcentral.net wrote: Hey guys, quick question. I had to re-install my Ubuntu, and I forgot what package I needed so firefox will display the php files and not ask me to if I want to download them. I've done installed PHP5, mysql, and php-mysql. What did I miss. I know the package name, but it's completely slipping my mind right now. Thanks David M. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- A tip for you. If you have internet access, type in sudo apt-get install phpmyadmin This will install all the dependencies and your server will be ready. On 4/9/10, David McGlone da...@dmcentral.net wrote: Hey guys, quick question. I had to re-install my Ubuntu, and I forgot what package I needed so firefox will display the php files and not ask me to if I want to download them. I've done installed PHP5, mysql, and php-mysql. What did I miss. I know the package name, but it's completely slipping my mind right now. Thanks David M. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Sent from my mobile device Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) ---End Message--- ---BeginMessage--- On Fri, 2010-04-09 at 08:37 +0530, kranthi wrote: you forgot httpd KK. On Fri, Apr 9, 2010 at 08:32, David McGlone da...@dmcentral.net wrote: Hey guys, quick question. I had to re-install my Ubuntu, and I forgot what package I needed so firefox will display the php files and not ask me to if I want to download them. I've done installed PHP5, mysql, and php-mysql. What did I miss. I know the package name, but it's completely slipping my mind right now. Thanks everyone for the suggestions. Last night before I went to bed I replied to my own question to let everyone know that all I needed to do was restart apache, but what I didn't realize until I got up this morning was when I hit reply, I replied to myself so only I got the message. ---End Message--- ---BeginMessage--- From: David McGlone On Fri, 2010-04-09 at 08:37 +0530, kranthi wrote: you forgot httpd KK. On Fri, Apr 9, 2010 at 08:32, David McGlone da...@dmcentral.net wrote: Hey guys, quick question. I had to re-install
php-general Digest 8 Apr 2010 11:42:47 -0000 Issue 6681
php-general Digest 8 Apr 2010 11:42:47 - Issue 6681 Topics (messages 303875 through 303891): Re: mysql query returning slowly 303875 by: David Murphy Re: Howto send command over ssh using sockets 303876 by: Thomas Anderson Greate day for you, 303877 by: Chris G 303878 by: Daniel Brown 303879 by: Nilesh Govindarajan 303880 by: Bruno Fajardo 303881 by: Kevin Kinsey 303882 by: HallMarc Websites Sort two coupled arrays 303883 by: tedd 303884 by: Piero Steinger 303885 by: Mattias Thorslund 303886 by: Paul M Foster 303887 by: Andrew Ballard 303888 by: Hans à hlin Re: Sort two coupled arrays {my solution] 303889 by: tedd 303890 by: Ryan Sun Beginner's question: How to run a PHP web application locally? 303891 by: Bastien Helders Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Nathan, The profiling I included proved that was not the case. Mysql run the query and return the single column single row result in under 1 second but PHP's mysql-query waited much longer than that to return. If it was a big result set I could see some slow down in parsing the results into memory but this wasn't the case. Updates/Deletes have similar random timing issues , and using mysql profiling, I can see its not transit or lock or clean up time from mysql - php , it is purely inside the php mysql functions the slow down seems to be occurs , but I can dive into those as they are compiled modules not userland functions. -Original Message- -Original Message- From: Nathan Rixham [mailto:nrix...@gmail.com] Sent: Tuesday, April 06, 2010 6:35 PM To: David Murphy Cc: php-gene...@lists.php.net Subject: Re: mysql query returning slowly David Murphy wrote: This is from our application I enabled profile in mysql to determine why an update took 20seconds. As you can see MySQL reported no where near that amount of duration took place. Is there any way I can dig into php and determine why mysql client libs are so slow (this is not using mysqlnd but mysql-client-libs on CentOS using 5.3.2) 04/06/2010 14:54:54 20.6899s maybe it was waiting to acquire a lock ---End Message--- ---BeginMessage--- phpseclib does SSH without PECL extension and only with fsockopen: http://phpseclib.sourceforge.net/ On Sun Apr 4 21:09:54 2010, Hans_Åhlin wrote: Instead of ssh, you could use telnet to connect to the Cisco router (which incidentally runs on port 23, but is likely to be disabled on the cisco router, unless you have a pre-SSH capable IOS running on it (like my old cisco crap :( ) ), because i strongly doubt you have written or are willing to write your own encryption libraries for this project, you might also want to read IETF RFC 854 [http://tools.ietf.org/html/rfc854] about the telnet protocol, as you are writing your own client, and not using a pre-made one, judging from your script. Or if you do not like the idea of sending clear-text passwords to the router, you might want to learn about proc_open() (or popen()) and use the native ssh utility that most likely is present on the server, taking great care to READ THE MANUAL for the ssh command, because you most likely do _not_ want it to spit out ANSI-escapes to you script. Kind regards from Johan Lidström Örnsköldsvik, Sweden irc://irc.freenode.net/Dr_Kao frozendude+php...@gmail.com P.S. currently borrowing a friends account. 2010/4/5 Radek Krejča radek.kre...@starnet.cz: Hello, I am trying send command to remote host over ssh with sockets. But I need to set up username/password. I am trying to modify this script (from www.php.net - function fsockopen), but I dont know, where set username/password because I got this message: Bad protocol version identification 'password' from ip Library ssh2 is not currentu userfull for me, because I am not admin of server. Thank you Radek ?php / * Author: Richard Lajaunie * Mail : richard.lajau...@cote-azur.cci.fr * * subject : this script retreive all mac-addresses on all ports * of a Cisco 3548 Switch by a telnet connection * * base on the script by: xbensemhoun at t-systems dot fr on the same page **/ if ( array_key_exists(1, $argv) ){ $cfgServer = $argv[1]; }else{ echo ex: 'php test.php 10.0.0.0' \n; exit; } $cfgPort = 23; //port, 22 if SSH $cfgTimeOut = 10; $usenet = fsockopen($cfgServer, $cfgPort, $errno, $errstr), $cfgTimeOut); if(!$usenet){ echo
php-general Digest 7 Apr 2010 14:49:50 -0000 Issue 6680
php-general Digest 7 Apr 2010 14:49:50 - Issue 6680 Topics (messages 303864 through 303874): Re: SimpleXMLElement occasionally fails to parse gb2312 or big5 feeds 303864 by: Dan Joseph Re: Logical reason for strtotime('east') and strtotime('west') returning valid results? 303865 by: Kevin Kinsey 303869 by: Peter Lind Re: no-cache control 303866 by: kranthi 303867 by: Karl DeSaulniers Re: $_SERVER['PHP_AUTH_USER'] has gone 303868 by: Satz Klauer Re: image question again 303870 by: Ashley Sheridan Who uses Mantis, please help! 303871 by: Andre Polykanine 303872 by: Paul M Foster stat(), NFS shares and local files timeout 303873 by: Igor Feghali 303874 by: Dan Joseph Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Fri, Apr 2, 2010 at 10:28 AM, Peter Pei peterpei...@hotmail.com wrote: I use the following code to get rss and parse it, but the code occasionally have issues with gb2312 or big-5 encoded feeds, and fails to parse them. However other times may appear just okay. Any thoughts? Maybe SimpleXMLElement is simply not meant for other language encodings... $page = file_get_contents($rss); try { $feed = new SimpleXMLElement($page); I've been learning a bit about SimpleXML today myself. It seems that it misses a lot of things when it comes to complex, or abnormal XML. Abnormal being what you're describing and whatnot. I don't really have a solid answer for you (Just noticed no one responded), but I think you're running into what I was... Its just built to be Simple, not expand its mind. Hope that helps! -- -Dan Joseph www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month. Promo Code NEWTHINGS for 10% off initial order http://www.facebook.com/canishosting http://www.facebook.com/originalpoetry ---End Message--- ---BeginMessage--- Colin Guthrie wrote: 'Twas brillig, and Kevin Kinsey at 05/04/10 19:15 did gyre and gimble: Nonetheless, I'm suspecting the programmers had something like this in mind. Yeah I guess that's why it interprets these terms. Good thinking :) Isn't strtotime() based on some GNU utility? Yeah, that's why I said the relevant authorities. I couldn't remember off-hand where it came from so figured I'd not blame PHP just yet :p Apparently these strings are being recognized as TZ stamps, but the underlying logic is not fully implemented: see http://www.gnu.org/s/libc/manual/html_node/Low_002dLevel-Time-String-Parsing.html Try it with some TZ stamps ... I'm pretty sure that in the previous example it was taking East to be EST, as I observed (rather by accident) earlier. Kevin Kinsey ---End Message--- ---BeginMessage--- On a related note: does anyone know why php -r echo date('Y-m-d H:i:s', strtotime('a')); happily outputs a valid timestamp? And why all other letters work as well (but only one character)? I'm sure there's a good reason for it, it just completely escapes me right now :) Regards Peter -- hype WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind Flickr: http://www.flickr.com/photos/fake51 BeWelcome: Fake51 Couchsurfing: Fake51 /hype ---End Message--- ---BeginMessage--- you can do that by using .htacess in the required directory http://www.askapache.com/htaccess/apache-speed-cache-control.html ---End Message--- ---BeginMessage--- Thanks kranthi. I thought there was a way. I was thinking you could, say, set your header content in the php.ini file?, but a .htaccess would work too. Thanks, Best, Karl On Apr 6, 2010, at 11:44 PM, kranthi wrote: you can do that by using .htacess in the required directory http://www.askapache.com/htaccess/apache-speed-cache-control.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Karl DeSaulniers Design Drumm http://designdrumm.com ---End Message--- ---BeginMessage--- Yes, the authantication-box is there. And I'm definitely using Basic auth, the same script has worked for a long time without problems. On 4/7/10, Nilesh Govindarajan li...@itech7.com wrote: On 04/06/10 21:27, Satz Klauer wrote: var_dump($_SERVER) gives me several data, the following arrayindices contain data: HTTPS, SSL_TLS_SNI, HTTP_USER_AGENT, HTTP_HOST, HTTP_ACCEPT, HTTP_ACCEPT_LANGUAGE, HTTP_ACCEPT_CHARSET, HTTP_ACCEPT_ENCODING, HTTP_REFERER, HTTP_COOKIE, HTTP_COOKIE2, HTTP_CONNECTION, HTTP_TE, PATH, SERVER_SIGNATURE, SERVER_SOFTWARE, SERVER_NAME, SERVER_ADDR, SERVER_PORT, REMOTE_HOST, REMOTE_ADDR, DOCUMENT_ROOT, SERVER_ADMIN, SCRIPT_FILENAME, REMOTE_PORT
php-general Digest 6 Apr 2010 14:09:59 -0000 Issue 6678
php-general Digest 6 Apr 2010 14:09:59 - Issue 6678 Topics (messages 303844 through 303857): Updating HTML on page 303844 by: Ashley M. Kirchner 303845 by: TG 303846 by: Ashley M. Kirchner 303848 by: Paul M Foster 303857 by: tedd Re: include path in httpd.conf 303847 by: ad imagecopyresize??? 303849 by: Karl DeSaulniers no-cache control 303850 by: Karl DeSaulniers 303855 by: Kim Emax Re: imagecopyresize 303851 by: Karl DeSaulniers 303853 by: Auto-Deppe C. Hänsel 303854 by: Nadim Attari 303856 by: tedd Re: problems with utf-8 conversion 303852 by: Apis SARL Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- I have a PHP script that queries a DB to get a list of image names. Then it processes each name and generate thumbnails and what not. What I want to do is have a page called (through the browser) which updates as the PHP process in the background is working. So when you first pull up the page it will say 'There are x images to process' and then dynamically update the page with a progress status. In its crudest form it should say something like 'Processing 1 of 5 images .' When that image is done, it should update the page with 2 of 5 . etc., etc. Ideally without refreshing the page each time. Is this where I need to figure out Ajax and incorporate it with PHP? ---End Message--- ---BeginMessage--- The only way to do it with PHP alone would be to control the output buffering and I've found that to be inconsistant in quality and predictability with different browsers even web servers. I'm sure there's an art to getting that all working well with various technologies that are involved in the script - client caching and processing, but why mess with iffy when you can use a proven technology like AJAX. Get familiar with jQuery (or one of the other big JS libraries, but jQuery is my choice hands-down) and you'll probably find it's pretty easy. -TG - Original Message - From: Ashley M. Kirchner ash...@pcraft.com To: php-gene...@lists.php.net Date: Mon, 5 Apr 2010 20:12:30 -0600 Subject: [PHP] Updating HTML on page I have a PHP script that queries a DB to get a list of image names. Then it processes each name and generate thumbnails and what not. What I want to do is have a page called (through the browser) which updates as the PHP process in the background is working. So when you first pull up the page it will say 'There are x images to process' and then dynamically update the page with a progress status. In its crudest form it should say something like 'Processing 1 of 5 images .' When that image is done, it should update the page with 2 of 5 . etc., etc. Ideally without refreshing the page each time. Is this where I need to figure out Ajax and incorporate it with PHP? ---End Message--- ---BeginMessage--- Hrm, been looking at it for a while now and I can feel a headache coming up. I think I need to have one PHP script that does the processing, and another that the user pulls up in their browser. That one pings the processor every so often to get updated data. Yes? Am I way off here? -Original Message- From: TG [mailto:tg-...@gryffyndevelopment.com] Sent: Monday, April 05, 2010 8:48 PM To: Ashley M. Kirchner; php-gene...@lists.php.net Subject: Re: [PHP] Updating HTML on page The only way to do it with PHP alone would be to control the output buffering and I've found that to be inconsistant in quality and predictability with different browsers even web servers. I'm sure there's an art to getting that all working well with various technologies that are involved in the script - client caching and processing, but why mess with iffy when you can use a proven technology like AJAX. Get familiar with jQuery (or one of the other big JS libraries, but jQuery is my choice hands-down) and you'll probably find it's pretty easy. -TG ---End Message--- ---BeginMessage--- On Mon, Apr 05, 2010 at 09:29:26PM -0600, Ashley M. Kirchner wrote: Hrm, been looking at it for a while now and I can feel a headache coming up. I think I need to have one PHP script that does the processing, and another that the user pulls up in their browser. That one pings the processor every so often to get updated data. Yes? Am I way off here? Slightly. PHP code runs on the server, so in the browser, it won't ping the server. Yes, you should have a PHP script on the server to do the processing, (call it, say, process.php) and one which paints the basic screen for the browser (call it page.php or somesuch). But the connection
php-general Digest 7 Apr 2010 02:44:12 -0000 Issue 6679
php-general Digest 7 Apr 2010 02:44:12 - Issue 6679 Topics (messages 303858 through 303863): Re: $_SERVER['PHP_AUTH_USER'] has gone 303858 by: Satz Klauer 303862 by: Nilesh Govindarajan Re: Logical reason for strtotime('east') and strtotime('west') returning valid results? 303859 by: Colin Guthrie mysql query returning slowly 303860 by: David Murphy 303861 by: Nathan Rixham image question again 303863 by: Karl DeSaulniers Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- var_dump($_SERVER) gives me several data, the following arrayindices contain data: HTTPS, SSL_TLS_SNI, HTTP_USER_AGENT, HTTP_HOST, HTTP_ACCEPT, HTTP_ACCEPT_LANGUAGE, HTTP_ACCEPT_CHARSET, HTTP_ACCEPT_ENCODING, HTTP_REFERER, HTTP_COOKIE, HTTP_COOKIE2, HTTP_CONNECTION, HTTP_TE, PATH, SERVER_SIGNATURE, SERVER_SOFTWARE, SERVER_NAME, SERVER_ADDR, SERVER_PORT, REMOTE_HOST, REMOTE_ADDR, DOCUMENT_ROOT, SERVER_ADMIN, SCRIPT_FILENAME, REMOTE_PORT, GATEWAY_INTERFACE = string(7) CGI/1.1 (??? it is running as apache-module ???, SERVER_PROTOCOL, REQUEST_METHOD, QUERY_STRING, REQUEST_URI, SCRIPT_NAME, PHP_SELF, REQUEST_TIME Unfortunately not Auth-data. var_dump($_ENV) tells me (partially anonymised): [HOSTNAME]= string(24) xxx.yyy.de [TERM]= string(5) xterm [SHELL]= string(9) /bin/bash [HISTSIZE]= string(4) 1000 [QTDIR]= string(15) /usr/lib/qt-3.3 [QTINC]= string(23) /usr/lib/qt-3.3/include [USER]= string(4) root [LS_COLORS]= string(1268) rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36: [MC_TMPDIR]= string(12) /tmp/mc-root [PATH]= string(29) /sbin:/usr/sbin:/bin:/usr/bin [MAIL]= string(20) /var/spool/mail/root [PWD]= string(17) /etc/xxx/yyy [LANG]= string(1) C [HISTCONTROL]= string(11) ignorespace [HOME]= string(5) /root [SHLVL]= string(1) 4 [MC_SID]= string(5) 25229 [LOGNAME]= string(4) root [CVS_RSH]= string(3) ssh [QTLIB]= string(19) /usr/lib/qt-3.3/lib [LESSOPEN]= string(24) |/usr/bin/lesspipe.sh %s [G_BROKEN_FILENAMES]= string(1) 1 [_]= string(15) /usr/sbin/httpd On Sun, Apr 4, 2010 at 10:54 PM, Daniel P. Brown daniel.br...@parasane.netwrote: Sorry for the top-post. Easter has me on the DROID instead of my PC. I second Rixham's thought. Is it a DSO, CGI, FCGI? What pops out in var_dump($_SERVER) and var_dump($_ENV)? On Apr 4, 2010 3:49 PM, Nathan Rixham nrix...@gmail.com wrote: Satz Klauer wrote: Hi, I'm running a system with Fedora 12 and Apache/PHP default installatio... just a quick sanity check; you do have the specific site/directory set up to send and receive basic auth yeah? sounds very much to me like this is an apache config issue and not php :) regards! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub ---End Message--- ---BeginMessage--- On 04/06/10 21:27, Satz Klauer wrote: var_dump($_SERVER) gives me several data, the following arrayindices contain data: HTTPS, SSL_TLS_SNI, HTTP_USER_AGENT, HTTP_HOST, HTTP_ACCEPT, HTTP_ACCEPT_LANGUAGE, HTTP_ACCEPT_CHARSET, HTTP_ACCEPT_ENCODING, HTTP_REFERER, HTTP_COOKIE, HTTP_COOKIE2, HTTP_CONNECTION, HTTP_TE, PATH, SERVER_SIGNATURE, SERVER_SOFTWARE, SERVER_NAME, SERVER_ADDR, SERVER_PORT, REMOTE_HOST, REMOTE_ADDR, DOCUMENT_ROOT, SERVER_ADMIN, SCRIPT_FILENAME, REMOTE_PORT, GATEWAY_INTERFACE = string(7) CGI/1.1 (??? it is running as apache-module ???, SERVER_PROTOCOL, REQUEST_METHOD, QUERY_STRING, REQUEST_URI, SCRIPT_NAME, PHP_SELF, REQUEST_TIME Unfortunately
php-general Digest 5 Apr 2010 12:58:41 -0000 Issue 6676
php-general Digest 5 Apr 2010 12:58:41 - Issue 6676 Topics (messages 303818 through 303833): Constructor usage 303818 by: Larry Garfield 303819 by: Nathan Rixham 303823 by: Adam Richardson 303824 by: Paul M Foster 303830 by: Larry Garfield OO Design Formally 303820 by: Daniel Kolbo 303821 by: Adam Richardson Re: Howto send command over ssh using sockets 303822 by: Hans à hlin 303831 by: Radek KrejÄa 303833 by: Bob McConnell Re: Medical Task Force 303825 by: Rene Veerman 303826 by: Rene Veerman 303828 by: Matty Sarro Re: convert a string into an array 303827 by: Rene Veerman 303829 by: Nathan Rixham unsigned chars 303832 by: donald sullivan Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Hi folks. Somewhat philosophical question here. I have heard, although not confirmed, that the trend in the Java world in the past several years has been away from constructors. That is, rather than this: class Foo { public void Foo(Object a, Object b, Object c) {} } Foo f = new Foo(a, b, c); The preference is now for this: class Foo { public void setA(Object a) {} public void setB(Object b) {} public void setC(Object c) {} } Foo f = new Foo(a, b, c); f.setA(a); f.setB(b); f.setC(c); I suppose there is some logic there when working with factories, which you should be doing in general. However, I don't know if that makes the same degree of sense in PHP, even though the OO models are quite similar. So, I'll throw the question out. Who uses example 1 above vs. example 2 when writing dependency-injection-based OOP? Why? What trade-offs have you encountered, and was it worth it? --Larry Garfield ---End Message--- ---BeginMessage--- Larry Garfield wrote: Hi folks. Somewhat philosophical question here. I have heard, although not confirmed, that the trend in the Java world in the past several years has been away from constructors. That is, rather than this: class Foo { public void Foo(Object a, Object b, Object c) {} } Foo f = new Foo(a, b, c); The preference is now for this: class Foo { public void setA(Object a) {} public void setB(Object b) {} public void setC(Object c) {} } Foo f = new Foo(a, b, c); f.setA(a); f.setB(b); f.setC(c); I suppose there is some logic there when working with factories, which you should be doing in general. However, I don't know if that makes the same degree of sense in PHP, even though the OO models are quite similar. So, I'll throw the question out. Who uses example 1 above vs. example 2 when writing dependency-injection-based OOP? Why? What trade-offs have you encountered, and was it worth it? Hi Larry, In the Java world a huge reason is because Classes have to be able to be instantiated with no arguments in order to reverse engineered w/ JAXB so that the classes can be used for web services (and wsdl's created etc). Thus most of them have no arguments. Personally I also find it good practise to instantiate with no arguments and then set the state of the instance by calling setters. A nice way around it is to create static methods which instantiate the class w/ a protected or private constructor. class Foo { private $a; private function __construct() {} public function setA( $a ) { $this-a = $a; } public static function instantiateWithASet( $a ) { $temp = new self; $temp-setA( $a ); return $temp; } } it's almost overloading lol. Regards! ---End Message--- ---BeginMessage--- On Sun, Apr 4, 2010 at 6:36 PM, Larry Garfield la...@garfieldtech.comwrote: Hi folks. Somewhat philosophical question here. I have heard, although not confirmed, that the trend in the Java world in the past several years has been away from constructors. That is, rather than this: class Foo { public void Foo(Object a, Object b, Object c) {} } Foo f = new Foo(a, b, c); The preference is now for this: class Foo { public void setA(Object a) {} public void setB(Object b) {} public void setC(Object c) {} } Foo f = new Foo(a, b, c); f.setA(a); f.setB(b); f.setC(c); I suppose there is some logic there when working with factories, which you should be doing in general. However, I don't know if that makes the same degree of sense in PHP, even though the OO models are quite similar. So, I'll throw the question out. Who uses example 1 above vs. example 2 when writing dependency-injection-based OOP? Why? What trade-offs have you encountered, and was it worth it? --Larry Garfield -- PHP General Mailing List (http://www.php.net
php-general Digest 6 Apr 2010 02:00:57 -0000 Issue 6677
php-general Digest 6 Apr 2010 02:00:57 - Issue 6677 Topics (messages 303834 through 303843): Re: convert a string into an array 303834 by: Ashley Sheridan 303843 by: Nilesh Govindarajan problems with utf-8 conversion 303835 by: sudhir patil 303837 by: Nathan Rixham 303838 by: sudhir patil Re: Constructor usage 303836 by: Peter Pei Logical reason for strtotime('east') and strtotime('west') returning valid results? 303839 by: Colin Guthrie 303840 by: Kevin Kinsey include path in httpd.conf 303841 by: ad 303842 by: Ashley Sheridan Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Mon, 2010-04-05 at 05:53 +0100, Nathan Rixham wrote: you sure you're only smoking cigarettes? has to be one of the most random replies to any php thread I've ever seen - awesome! regards Rene Veerman wrote: yea i'm not the only one with those type of problems. sometimes times slows down in my room so much not even my speakers sound normal anymore; equipment that doesn't work (despite being crappy and known by it's patterns of refusal to work; still EXTRA abnormal since about a week or so)... it sounds like the who's reading my passwords with me while i type 'm in... === 'is there anyone looking over my shoulder despite no living humans even in my entire properly locked room (with strong walls)' the idea here is; take a break. work on a different project for a week or so, but the best idea is; move around through the country side and realize that your car will get gas at every gasstation... check your atm cards, but not your online banking account status, just to buy a pack of cigarettes with an atm card. and then, buy not 1 or 2 packs of your favorite smokes(cigarettes in this case), but buy 10 packs with that card, and make sure you have enough good old cash that you know to be truely valid (coins are best) to get just 2 large packs of cigarettes.. things like that will give you the confidence you need to proceed on your project i think.. the #1 rule i use (when you dont yet have any need for a #0 rule or a #-1 rule (dont add those lightly and never on a whim or hope of being saved from death in the next 5 minutes)) is: truely honest living humans should never use the same type of lie construct in the same type of situation for the second time within at least 1 to 3 weeks.. but hey, necessity may require you to break any rule... rules? only guidelines are usefull ;) (pirates of the caribean #1 movie) On Sat, Apr 3, 2010 at 1:05 AM, Andre Polykanine an...@oire.org wrote: Hello everyone, It's quite simple but I'm still stuck. What I need is the following: I have an array as a parameter of my custom function. However, I'd like to allow users to enter a string instead of an array. In this case (if the parameter is a string), it must be replaced with an array containing only one item - actually, that string. What I'm doing gives me (presumably) errors; function Send ($tonames, $toemails, $subject, $message) { ... if ((!is_array($tonames)) || (!is_array($toemails))) { $tonames[]=$tonames; $toemails[]=$toemails; } I can't give the new array a new name since I address it further in a loop as my function's parameter... hope you understand what I'm saying) Thanks! -- With best regards from Ukraine, Andre Http://oire.org/ - The Fantasy blogs of Oire Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: http://twitter.com/m_elensule -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Virus maybe? Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- On 04/05/10 19:39, Ashley Sheridan wrote: On Mon, 2010-04-05 at 05:53 +0100, Nathan Rixham wrote: you sure you're only smoking cigarettes? has to be one of the most random replies to any php thread I've ever seen - awesome! regards Rene Veerman wrote: yea i'm not the only one with those type of problems. sometimes times slows down in my room so much not even my speakers sound normal anymore; equipment that doesn't work (despite being crappy and known by it's patterns of refusal to work; still EXTRA abnormal since about a week or so)... it sounds like the who's reading my passwords with me while i type 'm in... === 'is there anyone looking over my shoulder despite no living humans even in my entire properly locked room (with strong walls)' the idea here is; take
php-general Digest 4 Apr 2010 22:26:30 -0000 Issue 6675
php-general Digest 4 Apr 2010 22:26:30 - Issue 6675 Topics (messages 303806 through 303817): Just a test. 303806 by: ttplayer About the php mail function and imap_mail function 303807 by: ttplayer 303808 by: dispy 303812 by: Andre Polykanine Re: PHP (32 bit) on IIS7.5 and MySQL 5.1.45 (64 bit) - established connection failed because connected host has failed to respond 303809 by: SED 303810 by: ralston $_SERVER['PHP_AUTH_USER'] has gone 303811 by: Satz Klauer 303813 by: Nilesh Govindarajan 303814 by: shiplu 303815 by: Nathan Rixham 303816 by: Daniel P. Brown Howto send command over ssh using sockets 303817 by: Radek Krejèa Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Hi,everyone. Have a good day. This is just a test if my email address has been added to the mailing list.---End Message--- ---BeginMessage--- Hi, everyone! I have a problem about the php mail function and imap_mail function. When I use the mail or imap_mail function to send a email, the php script sends the email through the local mail sever with sendmail or another MTA supported. However, I have a gmail account. I just want the php script to send emails via my gmail account. How can I do it? Thank you.---End Message--- ---BeginMessage--- Am 04.04.2010 14:28, schrieb ttplayer: Hi, everyone! I have a problem about the php mail function and imap_mail function. When I use the mail or imap_mail function to send a email, the php script sends the email through the local mail sever with sendmail or another MTA supported. However, I have a gmail account. I just want the php script to send emails via my gmail account. How can I do it? Thank you. a) use an external SMTP-class, you could take a look at PEAR (which directly etablishes a connection to your gmail-account) b) configure your mail-server/system that he delivers the mails via an external SMTP_Server - there are several tutorials how to do that in the inet Regards, Valentin Dreismann ---End Message--- ---BeginMessage--- Hello ttplayer, If GMail does allow sending through socket, wait a bit, I'll upload a class written on my own for sending mail through a custom SMTP via socket. -- With best regards from Ukraine, Andre Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: m_elensule - Original message - From: ttplayer f...@qq.com To: php-general php-gene...@lists.php.net Date: Sunday, April 4, 2010, 3:28:33 PM Subject: [PHP] About the php mail function and imap_mail function Hi, everyone! I have a problem about the php mail function and imap_mail function. When I use the mail or imap_mail function to send a email, the php script sends the email through the local mail sever with sendmail or another MTA supported. However, I have a gmail account. I just want the php script to send emails via my gmail account. How can I do it? Thank you. ---End Message--- ---BeginMessage--- Hi Kevin, Thank you for your assistance. I finally gave up and let my self to default Microsoft Installation for IIS7.5+PHP+MySQL. Everything runs fine on my developer machine - and that was my main goal - so I'm fine. However, after about 48 hours of search, I was not able to find to how to do this manually - and it shock me (as a open source fan). At least, my Linuxs' servers are still intact. Ps. there is still snowing here in Iceland (heat -15°C in wind) and a volcano eruption that is growing. :) Thanks for your help, Summi -Original Message- From: SED [mailto:s...@sed.is] Sent: 4. apríl 2010 10:06 To: 'Kevin Kinsey' Cc: php-gene...@lists.php.net Subject: RE: [PHP] PHP (32 bit) on IIS7.5 and MySQL 5.1.45 (64 bit) - established connection failed because connected host has failed to respond Hi Kevin, - MySQL 5.1 (64bit) is listening at port 0.0.0.0:3306 - MySQL 4.1 (32bit) is listening at port 0.0.0.0:3307 - When running MySQL command via PHP (CMD or browser) I get 127.0.0.1:3306 Established - I can connect to MySQL via CMD or MySQL Administrator GUI. - PHP (32bit) loads php_mysql.dll - php.ini works 100% - All Firewalls are disabled on LAN - Is this a PHP bug or am I getting crazy? ;-) - Is there a 64bit of PHP who is assumed ok for develope machine with firewalls? Regards, Summi -Original Message- From: Kevin Kinsey [mailto:k...@daleco.biz] Sent: 4. apríl 2010 01:02 To: Sumarliði Einar Daðason Cc: php-gene...@lists.php.net Subject: Re: [PHP] PHP (32 bit) on IIS7.5 and MySQL 5.1.45 (64 bit) - established connection failed because connected host has failed
php-general Digest 3 Apr 2010 14:29:10 -0000 Issue 6673
php-general Digest 3 Apr 2010 14:29:10 - Issue 6673 Topics (messages 303756 through 303765): preg_match? Or something else? 303756 by: Ashley M. Kirchner 303759 by: Jim Lucas 303760 by: Nathan Rixham Re: convert a string into an array 303757 by: Jim Lucas 303758 by: Nathan Rixham 303763 by: Nilesh Govindarajan array or list of objects of different types 303761 by: Php Developer 303762 by: Nathan Rixham 303764 by: Nilesh Govindarajan GetElementByClass? 303765 by: tedd Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- I have an array that's created as follows: $string = 73G146C 311- 309.1C; $arr = preg_split(/[\s]+/, $string); Now I need to take each element in that array, and break them up even further so that I get: 73G= 73 and G 146C = 146 and C 311- = 311 and - 309.1C = 309, 1, and C (notice 3 elements here) I'm having a hard time trying to figure out what the proper regex would be for this, or whether that's the right thing to do. So far I've gotten this: preg_match(/^(?Plocation\d+)(?Pletter[A-Z-])/, $item, $matches); print_r($matches); Which gives me: Array ( [0] = 73G [location] = 73 [1] = 73 [letter] = G [2] = G ) Array ( [0] = 146C [location] = 146 [1] = 146 [letter] = C [2] = C ) Array ( [0] = 311- [location] = 311 [1] = 311 [letter] = - [2] = - ) Array ( ) However that's as far as it goes. For the other number it returns an empty array and I know why, the decimal point. Now I can evaluate each $item every time, see if they contain a decimal point, and pass it to a different regex string, but that seems rather inefficient to me. So how can I do this all in one fell swoop? Anyone want to take a stab at it? ---End Message--- ---BeginMessage--- Ashley M. Kirchner wrote: I have an array that's created as follows: $string = 73G146C 311- 309.1C; $arr = preg_split(/[\s]+/, $string); Now I need to take each element in that array, and break them up even further so that I get: 73G= 73 and G 146C = 146 and C 311- = 311 and - 309.1C = 309, 1, and C (notice 3 elements here) I'm having a hard time trying to figure out what the proper regex would be for this, or whether that's the right thing to do. So far I've gotten this: preg_match(/^(?Plocation\d+)(?Pletter[A-Z-])/, $item, $matches); print_r($matches); Which gives me: Array ( [0] = 73G [location] = 73 [1] = 73 [letter] = G [2] = G ) Array ( [0] = 146C [location] = 146 [1] = 146 [letter] = C [2] = C ) Array ( [0] = 311- [location] = 311 [1] = 311 [letter] = - [2] = - ) Array ( ) However that's as far as it goes. For the other number it returns an empty array and I know why, the decimal point. Now I can evaluate each $item every time, see if they contain a decimal point, and pass it to a different regex string, but that seems rather inefficient to me. So how can I do this all in one fell swoop? Anyone want to take a stab at it? Conditionals are your friend! plaintext?php $string = 73G146C 311- 309.1C; $arr = preg_split(/[\s]+/, $string); print_r($arr); foreach ( $arr AS $item ) { preg_match('|^(?Plocation\d+)\.?(?Pdecimal\d*)(?Pletter[A-Z-])|', $item, $matches); print_r($matches); } ? -- Jim Lucas NOC Manager 541-323-9113 BendTel, Inc. http://www.bendtel.com ---End Message--- ---BeginMessage--- Jim Lucas wrote: Ashley M. Kirchner wrote: I have an array that's created as follows: $string = 73G146C 311- 309.1C; Anyone want to take a stab at it? Conditionals are your friend! plaintext?php $string = 73G146C 311- 309.1C; $arr = preg_split(/[\s]+/, $string); print_r($arr); foreach ( $arr AS $item ) { preg_match('|^(?Plocation\d+)\.?(?Pdecimal\d*)(?Pletter[A-Z-])|', $item, $matches); print_r($matches); } ? or w/ preg_match_all: ?php $regex = '/(([0-9]+)([^0-9])((?:[0-9]|\s+)))/'; $string = 73G146C 311- 309.1C; preg_match_all( $regex , $string , $matches ); print_r( $matches ) ---End Message--- ---BeginMessage--- Andre Polykanine wrote: Hello everyone, It's quite simple but I'm still stuck. What I need is the following: I have an array as a parameter of my custom function
php-general Digest 2 Apr 2010 23:05:23 -0000 Issue 6672
php-general Digest 2 Apr 2010 23:05:23 - Issue 6672 Topics (messages 303749 through 303755): str_replace help 303749 by: David Stoltz 303750 by: Ashley Sheridan 303751 by: Midhun Girish 303752 by: Nilesh Govindarajan SimpleXMLElement and gb2312 or big5 303753 by: Peter Pei SimpleXMLElement occasionally fails to parse gb2312 or big5 feeds 303754 by: Peter Pei convert a string into an array 303755 by: Andre Polykanine Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Hi folks, In ASP, I would commonly replace string line feeds for HTML output like this: Var = replace(value,vbcrlf,br) In PHP, the following doesn't seem to work: $var = str_replace(chr(13),\n,$value) Neither does: $var = str_replace(chr(10),\n,$value) What am I doing wrong? Thanks! ---End Message--- ---BeginMessage--- On Fri, 2010-04-02 at 09:28 -0400, David Stoltz wrote: Hi folks, In ASP, I would commonly replace string line feeds for HTML output like this: Var = replace(value,vbcrlf,br) In PHP, the following doesn't seem to work: $var = str_replace(chr(13),\n,$value) Neither does: $var = str_replace(chr(10),\n,$value) What am I doing wrong? Thanks! I see no reason why it shouldn't work other than maybe the string doesn't contain what you think it does. Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- well david actually $var = str_replace(chr(13),\n,$value) will replace char(13) with \n... but \n wont come up in html unless u give a pre tag.. u need to put $var = str_replace(chr(13),br/,$value) in order to got the required output Midhun Girish On Fri, Apr 2, 2010 at 7:03 PM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: On Fri, 2010-04-02 at 09:28 -0400, David Stoltz wrote: Hi folks, In ASP, I would commonly replace string line feeds for HTML output like this: Var = replace(value,vbcrlf,br) In PHP, the following doesn't seem to work: $var = str_replace(chr(13),\n,$value) Neither does: $var = str_replace(chr(10),\n,$value) What am I doing wrong? Thanks! I see no reason why it shouldn't work other than maybe the string doesn't contain what you think it does. Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- On 04/02/10 18:58, David Stoltz wrote: Hi folks, In ASP, I would commonly replace string line feeds for HTML output like this: Var = replace(value,vbcrlf,br) In PHP, the following doesn't seem to work: $var = str_replace(chr(13),\n,$value) Neither does: $var = str_replace(chr(10),\n,$value) What am I doing wrong? Thanks! Use nl2br. -- Nilesh Govindarajan Site Server Administrator www.itech7.com मेरा भारत महान ! मम भारत: महत्तम भवतु ! ---End Message--- ---BeginMessage--- I use the following code to get rss and parse it, but the code occasionally have issues with gb2312 or big-5 encoded feeds, and fails to parse them. However other times may appear just okay. Any thoughts? Maybe SimpleXMLElement is simply not meant for other language encodings... $page = file_get_contents($rss); try { $feed = new SimpleXMLElement($page); ---End Message--- ---BeginMessage--- I use the following code to get rss and parse it, but the code occasionally have issues with gb2312 or big-5 encoded feeds, and fails to parse them. However other times may appear just okay. Any thoughts? Maybe SimpleXMLElement is simply not meant for other language encodings... $page = file_get_contents($rss); try { $feed = new SimpleXMLElement($page); -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ ---End Message--- ---BeginMessage--- Hello everyone, It's quite simple but I'm still stuck. What I need is the following: I have an array as a parameter of my custom function. However, I'd like to allow users to enter a string instead of an array. In this case (if the parameter is a string), it must be replaced with an array containing only one item - actually, that string. What I'm doing gives me (presumably) errors; function Send ($tonames, $toemails, $subject, $message) { ... if ((!is_array($tonames)) || (!is_array($toemails))) { $tonames[]=$tonames; $toemails[]=$toemails; } I can't give the new array a new name since I address it further in a loop as my function's parameter... hope you understand what I'm saying) Thanks! -- With best regards from Ukraine, Andre Http://oire.org/ - The Fantasy blogs of Oire Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo
php-general Digest 1 Apr 2010 15:00:23 -0000 Issue 6670
php-general Digest 1 Apr 2010 15:00:23 - Issue 6670 Topics (messages 303714 through 303725): Re: Still searching for a bugtracking system 303714 by: Jan G.B. image upload keeps file name ? 303715 by: Matthew Croud 303716 by: Ashley Sheridan 303717 by: Midhun Girish How to know which PHP is used by Apache 303718 by: Devendra Jadhav 303719 by: Ashley Sheridan 303720 by: Devendra Jadhav 303721 by: Richard 303722 by: Nilesh Govindarajan 303723 by: Teus Benschop 303724 by: Devendra Jadhav 303725 by: Devendra Jadhav Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- 2010/3/30 Andre Polykanine an...@oire.org: Hello Jan, And what do you use then?) Sadly, I'm bound to use what I dislike. Mantis. ;) It's not my decision and in our business model there's no major benefit in switching the software, at this point. I can live with it. Regards -- With best regards from Ukraine, Andre Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: m_elensule - Original message - From: Jan G.B. ro0ot.w...@googlemail.com To: Alex Major p...@allydm.co.uk Date: Tuesday, March 30, 2010, 6:04:20 PM Subject: [PHP] Still searching for a bugtracking system 2010/3/30 Alex Major p...@allydm.co.uk Surely if it's not suitable for your situation, it's not the best? :) Mantis is what I'd recommend and believe has already been recommend to you. Runs using PHP and MySQL, it's flexible for public or private projects, multiple projects etc. I do agree with you that Bugzilla seems heavy, I know it has its supporters but I've always found it to be overkill for the projects I've worked on. Alex. -Original Message- From: Andre Polykanine [mailto:an...@oire.org] Sent: 30 March 2010 14:14 To: php-gene...@lists.php.net Subject: [PHP] Still searching for a bugtracking system Hello everyone, The best of all suggested bugtrackers is JotBug, on my opinion. But it works only with SQLite databases, and I have no access to such one (only MySql). Any solutions? P.S. I'd use Trac, but since I have no own server yet, we have no access to Python, either... Only Php, MySql, Perl. I have looked at Bugzilla... seems to heavy for our service). - Well. I'm not a fan of mantis. Mantis has some annoying bugs and the codebase seems weird. It basically works, but that is all about it. I quote http://sqlite.org/about.html : SQLite is a software library that implements a self-contained,serverless, zero-configuration, transactional SQL database engine. ... Unlike most other SQL databases, SQLite does not have a separate server process. SQLite reads and writes directly to ordinary disk files. A complete SQL database with multiple tables, indices, triggers, and views, is contained in a single disk file. So you don't need access to such a database. Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- Hi Guys, Can someone confirm for me that the code below will move an uploaded file and give it the same name as the original image file name ? $file_dir = /home/uploads; foreach($_FILES as $file_name = $file_array) { echo path: .$file_array[tmp_name].br/\n; echo name: .$file_array[name].br/\n; echo type: .$file_array[type].br/\n; echo size: .$file_array[size].br/\n; $UploadName[$num] = $file_array[name]; $num++; if (is_uploaded_file($file_array[tmp_name])) { move_uploaded_file($file_array[tmp_name], $file_dir/. $file_array[name]) or die (Couldn't copy); echo file was moved!br/; } } Many thanks, ---End Message--- ---BeginMessage--- On Thu, 2010-04-01 at 10:51 +0100, Matthew Croud wrote: Hi Guys, Can someone confirm for me that the code below will move an uploaded file and give it the same name as the original image file name ? $file_dir = /home/uploads; foreach($_FILES as $file_name = $file_array) { echo path: .$file_array[tmp_name].br/\n; echo name: .$file_array[name].br/\n; echo type: .$file_array[type].br/\n; echo size: .$file_array[size].br/\n; $UploadName[$num] = $file_array[name]; $num++; if (is_uploaded_file($file_array[tmp_name])) { move_uploaded_file($file_array[tmp_name], $file_dir/. $file_array[name]) or die (Couldn't copy); echo file was moved!br/; } } Many thanks, Yes
php-general Digest 28 Mar 2010 13:28:16 -0000 Issue 6663
php-general Digest 28 Mar 2010 13:28:16 - Issue 6663 Topics (messages 303526 through 303547): Re: Noloh PHP Framework 303526 by: Ashley Sheridan 303529 by: Ashley Sheridan 303530 by: Ashley Sheridan 303533 by: Asher Snyder 303534 by: Robert Cummings 303536 by: Adam Richardson 303537 by: Asher Snyder Re: Server-side postscript-to-PDF on-the-fly conversion 303527 by: tedd 303528 by: Ashley Sheridan 303535 by: Yousif Masoud 303538 by: Frank Arensmeier Adding Time 303531 by: Gary 303532 by: Nilesh Govindarajan 303539 by: Gary 303540 by: Yousif Masoud 303541 by: Gary 303542 by: Yousif Masoud 303543 by: Gary 303544 by: Yousif Masoud 303545 by: Yousif Masoud 303546 by: Gary bug tracking system 303547 by: Andre Polykanine Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Sat, 2010-03-27 at 12:18 -0400, Brandon Rampersad wrote: Hello buds, Anyone have experience with the noloh php framework (noloh) and knows where i can download it? Im not sure if its open source or encrypted. Thanks http://www.google.co.uk/search?q=php+noloh Searching usually helps, and the first result seems to be the main website for the framework ;) Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- On Sat, 2010-03-27 at 13:21 -0400, Brandon Rampersad wrote: Thank you but i can't find the download on that website. Anyone have it that can send it to me via an attachment? Thank You On Sat, Mar 27, 2010 at 12:45 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Sat, 2010-03-27 at 12:18 -0400, Brandon Rampersad wrote: Hello buds, Anyone have experience with the noloh php framework (noloh) and knows where i can download it? Im not sure if its open source or encrypted. Thanks http://www.google.co.uk/search?q=php+noloh Searching usually helps, and the first result seems to be the main website for the framework ;) Thanks, Ash http://www.ashleysheridan.co.uk There's a massive 'Download Now' link that goes to their products page... Ps, you should hit reply to all rather than just reply so that it goes back to the whole list. Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- On Sat, 2010-03-27 at 13:33 -0400, Brandon Rampersad wrote: Sorry, im on gmail and can't find that button. i only see the reply button. maybe try manually adding the php-general email address in? I know a lot of people here use Gmail accounts on the list, maybe one of them knows something that could help you? Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- Hello Brandon, I'm Asher Snyder, one of the developers of NOLOH. Please feel free to e-mail me with any questions you have. On Sat, Mar 27, 2010 at 1:23 PM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: On Sat, 2010-03-27 at 13:21 -0400, Brandon Rampersad wrote: Thank you but i can't find the download on that website. Anyone have it that can send it to me via an attachment? Thank You On Sat, Mar 27, 2010 at 12:45 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Sat, 2010-03-27 at 12:18 -0400, Brandon Rampersad wrote: Hello buds, Anyone have experience with the noloh php framework (noloh) and knows where i can download it? Im not sure if its open source or encrypted. Thanks http://www.google.co.uk/search?q=php+noloh Searching usually helps, and the first result seems to be the main website for the framework ;) Thanks, Ash http://www.ashleysheridan.co.uk There's a massive 'Download Now' link that goes to their products page... Ps, you should hit reply to all rather than just reply so that it goes back to the whole list. Thanks, Ash http://www.ashleysheridan.co.uk -- Asher Snyder Co-founder NOLOH LLC. 347-416-6508 http://www.noloh.com ---End Message--- ---BeginMessage--- I viewed the source on the site like the features suggested I should... does NOLOH always generate HTML with all those hard embedded style attributes? Cheers, Rob. Asher Snyder wrote: Hello Brandon, I'm Asher Snyder, one of the developers of NOLOH. Please feel free to e-mail me with any questions you have. On Sat, Mar 27, 2010
php-general Digest 29 Mar 2010 01:35:32 -0000 Issue 6664
php-general Digest 29 Mar 2010 01:35:32 - Issue 6664 Topics (messages 303548 through 303568): Re: bug tracking system 303548 by: Ashley Sheridan 303549 by: Nilesh Govindarajan 303550 by: Nathan Rixham 303551 by: ebhakt 303552 by: Nilesh Govindarajan 303556 by: shiplu 303557 by: Nathan Rixham Re: Server-side postscript-to-PDF on-the-fly conversion 303553 by: Paul M Foster Re: optimizing PHP for microseconds 303554 by: Nathan Rixham Re: Allowing multiple, simultaneous, non-blocking queries. 303555 by: Nathan Rixham 303558 by: Per Jessen 303560 by: Adam Richardson 303562 by: Nathan Rixham 303566 by: Phpster 303568 by: Nathan Rixham Re: Web Design 303559 by: Nathan Rixham 303561 by: Andre Polykanine how to provide download of files mow in documentroot 303563 by: ebhakt Converting funky characters 303564 by: Skip Evans 303567 by: Nilesh Govindarajan Re: Please guide in selection of Framework: according to your experience 303565 by: Vishal Rewari Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Sun, 2010-03-28 at 16:28 +0300, Andre Polykanine wrote: Hello everyone, Can you recommend a bug tracking system to be installed on the site? Requirements: written in PHP (or maybe Perl); tickets system; e-mail notifications. -- With best regards from Ukraine, Andre Http://oire.org/ - The Fantasy blogs of Oire Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: http://twitter.com/m_elensule I think your best option is Mantis. It's written in PHP, does all that you've asked, and it's pretty easy to use really. Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- On 03/28/2010 06:58 PM, Andre Polykanine wrote: Hello everyone, Can you recommend a bug tracking system to be installed on the site? Requirements: written in PHP (or maybe Perl); tickets system; e-mail notifications. http://www.google.co.in/search?aq=0oq=php+bugsourceid=chromeie=UTF-8q=php+bug+tracker -- Nilesh Govindarajan Site Server Administrator www.itech7.com मेरा भारत महान ! मम भारत: महत्तम भवतु ! ---End Message--- ---BeginMessage--- Ashley Sheridan wrote: On Sun, 2010-03-28 at 16:28 +0300, Andre Polykanine wrote: Can you recommend a bug tracking system to be installed on the site? Requirements: written in PHP (or maybe Perl); tickets system; e-mail notifications. I think your best option is Mantis. It's written in PHP, does all that you've asked, and it's pretty easy to use really. agreed, unless IDE integration and familiarity is the name of the game, in which case the usual suspects of trac, jira and bugzilla are worth considering. regards! ---End Message--- ---BeginMessage--- Use drupal with the bug tracking system http://drupal.org/project/project_issue On Sun, Mar 28, 2010 at 6:58 PM, Andre Polykanine an...@oire.org wrote: Hello everyone, Can you recommend a bug tracking system to be installed on the site? Requirements: written in PHP (or maybe Perl); tickets system; e-mail notifications. -- With best regards from Ukraine, Andre Http://oire.org/ - The Fantasy blogs of Oire Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: http://twitter.com/m_elensule -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Bhaskar Tiwari GTSE Generalist Directory Services Microsoft All we have to decide is what to do with the time that has been given to us http://www.ebhakt.com/ http://fytclub.net/ http://ebhakt.info/ ---End Message--- ---BeginMessage--- On 03/28/2010 07:25 PM, ebhakt wrote: Use drupal with the bug tracking system http://drupal.org/project/project_issue http://drupal.org/project/project_issue On Sun, Mar 28, 2010 at 7:22 PM, Nilesh Govindarajan li...@itech7.com mailto:li...@itech7.com wrote: On 03/28/2010 06:58 PM, Andre Polykanine wrote: Hello everyone, Can you recommend a bug tracking system to be installed on the site? Requirements: written in PHP (or maybe Perl); tickets system; e-mail notifications. http://www.google.co.in/search?aq=0oq=php+bugsourceid=chromeie=UTF-8q=php+bug+tracker http://www.google.co.in/search?aq=0oq=php+bugsourceid=chromeie=UTF-8q=php+bug+tracker -- Nilesh Govindarajan Site Server
php-general Digest 27 Mar 2010 16:50:25 -0000 Issue 6662
php-general Digest 27 Mar 2010 16:50:25 - Issue 6662 Topics (messages 303517 through 303525): Server-side postscript-to-PDF on-the-fly conversion 303517 by: Rob Gould 303518 by: David Robley 303522 by: Floyd Resler 303523 by: Al Re: Please guide in selection of Framework: according to your experience 303519 by: Nilesh Govindarajan 303520 by: Ashley Sheridan Re: Zip and text files generated are corrupted 303521 by: Kim Madsen Noloh PHP Framework 303524 by: Brandon Rampersad is there any setting to declare the member variables in constructor? 303525 by: solo hsi Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Is there a free solution out there that will enable me to take a PHP-generated postscript output file, and dynamically, on-the-fly convert it to a PDF document and send to the user as a download when the user clients on a link? More description of what I'm trying to do: 1) I've got a web-page that accepts some user input 2) They hit SUBMIT 3) I've got a PHP file that takes that input and generates a custom Postscript file from it, which I presently serve back to the user. On a Mac, Safari and Firefox automatically take the .ps output and render it in Preview. 4) However, in the world of Windows, it seems like it'd be better to just convert it on-the-fly into a PDF, so that the user doesn't need to worry about having a post-script viewer app installed. ---End Message--- ---BeginMessage--- Rob Gould wrote: Is there a free solution out there that will enable me to take a PHP-generated postscript output file, and dynamically, on-the-fly convert it to a PDF document and send to the user as a download when the user clients on a link? More description of what I'm trying to do: 1) I've got a web-page that accepts some user input 2) They hit SUBMIT 3) I've got a PHP file that takes that input and generates a custom Postscript file from it, which I presently serve back to the user. On a Mac, Safari and Firefox automatically take the .ps output and render it in Preview. 4) However, in the world of Windows, it seems like it'd be better to just convert it on-the-fly into a PDF, so that the user doesn't need to worry about having a post-script viewer app installed. Ghostscript is the first thing that comes to my mind; alternatively googling for convert postscript pdf or similar might turn up other options. Cheers -- David Robley To a cat, NO! means Not while I'm looking. Today is Sweetmorn, the 13rd day of Discord in the YOLD 3176. ---End Message--- ---BeginMessage--- On Mar 27, 2010, at 12:41 AM, Rob Gould gould...@me.com wrote: Is there a free solution out there that will enable me to take a PHP- generated postscript output file, and dynamically, on-the-fly convert it to a PDF document and send to the user as a download when the user clients on a link? More description of what I'm trying to do: 1) I've got a web-page that accepts some user input 2) They hit SUBMIT 3) I've got a PHP file that takes that input and generates a custom Postscript file from it, which I presently serve back to the user. On a Mac, Safari and Firefox automatically take the .ps output and render it in Preview. 4) However, in the world of Windows, it seems like it'd be better to just convert it on-the-fly into a PDF, so that the user doesn't need to worry about having a post-script viewer app installed. Is there a particular reason why you need to use Postscript? Can you output it directly to PDF? Take care, Floyd Sent from my iPhone ---End Message--- ---BeginMessage--- On 3/27/2010 12:41 AM, Rob Gould wrote: Is there a free solution out there that will enable me to take a PHP-generated postscript output file, and dynamically, on-the-fly convert it to a PDF document and send to the user as a download when the user clients on a link? More description of what I'm trying to do: 1) I've got a web-page that accepts some user input 2) They hit SUBMIT 3) I've got a PHP file that takes that input and generates a custom Postscript file from it, which I presently serve back to the user. On a Mac, Safari and Firefox automatically take the .ps output and render it in Preview. 4) However, in the world of Windows, it seems like it'd be better to just convert it on-the-fly into a PDF, so that the user doesn't need to worry about having a post-script viewer app installed. http://pear.php.net/package/XML_fo2pdf http://pear.php.net/package/File_PDF ---End Message--- ---BeginMessage--- On 03/27/2010 09:58 AM, Vishal Rewari wrote: Dear PHP community, I am vishal, I have
php-general Digest 27 Mar 2010 04:29:17 -0000 Issue 6661
php-general Digest 27 Mar 2010 04:29:17 - Issue 6661 Topics (messages 303497 through 303516): Re: optimizing PHP for microseconds 303497 by: Robert Cummings 303498 by: Per Jessen Re: Will PHP ever grow up and have threading? 303499 by: Per Jessen Re: Zip and text files generated are corrupted 303500 by: Bastien Helders 303501 by: Richard Quadling 303506 by: Bastien Helders 303507 by: Richard Quadling 303514 by: Bastien Helders 303515 by: Richard Quadling Allowing multiple, simultaneous, non-blocking queries. 303502 by: Richard Quadling 303504 by: Peter Lind Moving to Minneapolis... 303503 by: -rada- Re: Authorize.net test 303505 by: David McGlone 303508 by: Robert Cummings Re: Top vs. Bottom Posting 303509 by: tedd How to set Content-type text/plain 303510 by: Guus Ellenkamp 303511 by: Robert Cummings 303512 by: Guus Ellenkamp Re: MySQL: Return Number of Matched Rows 303513 by: Shawn McKenzie Please guide in selection of Framework: according to your experience 303516 by: Vishal Rewari Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Tommy Pham wrote: On Thu, Mar 25, 2010 at 8:15 PM, Robert Cummings rob...@interjinn.com wrote: Daevid Vincent wrote: -Original Message- From: Robert Cummings [mailto:rob...@interjinn.com] Sent: Thursday, March 25, 2010 7:16 PM Daevid Vincent wrote: If I have to wait 3 seconds for a page to render, that wait is noticeable. Dumb users will click refresh, and since (unbelievably in this day and age) PHP and mySQL don't know the user clicked 'stop' or 'refresh', and therefore mySQL will execute the same query a second time. That's an entirely different thread I've already ranted on about. You may find the following enlightening: http://www.php.net/manual/en/function.ignore-user-abort.php http://www.php.net/manual/en/function.connection-aborted.php http://www.php.net/manual/en/function.connection-status.php Except there is no way to tell mySQL cancel that last request/query. Well, no graceful way. We actually have a script that runs on a crontab and seeks and destroys long running queries. As you may have guessed, just because a query takes a long time, it's difficult to know if it's actually hung or just really taking that long. So we do some smarts to compare against others and see if it seems like the same one and stuff like that. Not great, but sure stops the load from shooting through the roof. Again, not going into the rant I've done before. Look in the archives 2009-06-02 for Why doesn't mySQL stop a query when the browser tab is closed for that thread and even more indepth info on the my...@lists.mysql.com archives (same date and subject). That's a good point about MySQL, and in fact PHP would probably keep running too until MySQL returned. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP What about 'SHOW FULL PROCESSLIST' and look through the 'INFO' for that last matching query statement and kill the process? This is possible but then you don't know whose query you are killing. A terminated PHP process or a actively running PHP process with a connected user awaiting output. However, you could track PHP process IDs and MySQL process IDs (via mysql_thread_id()) to know whose MySQL process you are killing. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP ---End Message--- ---BeginMessage--- Daevid Vincent wrote: Was that someone me? I do that. And if you don't, then you're the kind of person I would not hire (not saying that to sound mean). If you do, I'd would be careful about hiring you. To me, optimizing for microseconds in PHP means loss of focus. I use single quotes instead of double where applicable. I use -- instead of ++. I use $boolean = !$boolean to alternate (instead of mod() or other incrementing solutions). I use LIMIT 1 on select, update, delete where appropriate. I use the session to cache the user and even query results. Most of that is just sound practice, not optimizing, imho. Optimizing is what you do later. I come from the video game world where gaining a frame or two of animation per second matters. It makes your game feel less choppy and more fluid and therefore more fun to play. Well, if you were writing PHP video games, I can totally appreciate optimizing for microseconds. -- Per Jessen, Zürich (11.4°C) ---End Message--- ---BeginMessage--- Peter Lind wrote: Anyway, I don't think either of us will change point of view much
php-general Digest 23 Mar 2010 14:50:12 -0000 Issue 6655
php-general Digest 23 Mar 2010 14:50:12 - Issue 6655 Topics (messages 303120 through 303142): PHP to access shell script to print barcodes 303120 by: Rob Gould 303125 by: Jochem Maas 303137 by: Richard Quadling Re: Will PHP ever grow up and have threading? 303121 by: Tommy Pham 303122 by: Teus Benschop 303123 by: Larry Garfield 303124 by: Jochem Maas 303126 by: Rene Veerman 303127 by: Tommy Pham 303128 by: Tommy Pham 303129 by: Per Jessen 303130 by: jose javier parra sanchez 303133 by: Rene Veerman 303136 by: David McGlone 303138 by: Richard Quadling 303140 by: Michael A. Peters Re: Filtering all output to STDERR 303131 by: Marten Lehmann 303135 by: Peter Lind constants STDOUT, STDERR, STDIN not working in 5.2.x? 303132 by: Marten Lehmann 303134 by: Jan G.B. 303141 by: Daniel Egeberg 303142 by: Jan G.B. Re: another question on setting include paths for a project 303139 by: Robert P. J. Day Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- I am trying to replicate the functionality that I see on this site: http://blog.maniac.nl/webbased-pdf-lto-barcode-generator/ Notice after you hit SUBMIT QUERY, you get a PDF file with a page of barcodes. That's _exactly_ what I'm after. Fortunately, the author gives step-by-step instructions on how to do this on this page: http://blog.maniac.nl/2008/05/28/creating-lto-barcodes/ So I've gotten through all the steps, and have created the barcode_with_samples.ps file, and have it hosted here: http://www.winecarepro.com/kiosk/fast/shell/ Notice how the last few lines contain the shell-script that renders the postscript: #!/bin/bash BASE=”100″; NR=$BASE for hor in 30 220 410 do ver=740 while [ $ver -ge 40 ]; do printf -v FNR “(%06dL3)” $NR echo “$hor $ver moveto $FNR (includetext height=0.55) code39 barcode” let ver=$ver-70 let NR=NR+1 done done I need to somehow create a PHP script that executes this shell script. And after doing some research, it sounds like I need to use the PHP exec command, so I do that with the following file: http://www.winecarepro.com/kiosk/fast/shell/printbarcodes.php Which has the following script: ?php $command=http://www.winecarepro.com/kiosk/fast/shell/barcode_with_sample.ps;; exec($command, $arr); echo $arr; ? And, as you can see, nothing works. I guess firstly, I'd like to know: A) Is this PHP exec call really the way to go with executing this shell script? Is there a better way? It seems to me like it's not really executing. B) Can someone try following the 5 steps listed on the website (http://blog.maniac.nl/2008/05/28/creating-lto-barcodes/) and tell me if you have any better luck? It doesn't really sound all that difficult. I'm hosting this on Dreamhost, and I'm not sure if there's some sort of permissions/shell exec feature I need to make this work. I'm not convinced that I really have a functioning Postscript file. My Mac renders Postscript files automatically after downloading with the Preview app, and I'm not seeing any valid data returned. ---End Message--- ---BeginMessage--- Op 3/23/10 3:27 AM, Rob Gould schreef: I am trying to replicate the functionality that I see on this site: http://blog.maniac.nl/webbased-pdf-lto-barcode-generator/ Notice after you hit SUBMIT QUERY, you get a PDF file with a page of barcodes. That's _exactly_ what I'm after. Fortunately, the author gives step-by-step instructions on how to do this on this page: http://blog.maniac.nl/2008/05/28/creating-lto-barcodes/ So I've gotten through all the steps, and have created the barcode_with_samples.ps file, and have it hosted here: http://www.winecarepro.com/kiosk/fast/shell/ Notice how the last few lines contain the shell-script that renders the postscript: #!/bin/bash BASE=”100″; NR=$BASE for hor in 30 220 410 do ver=740 while [ $ver -ge 40 ]; do printf -v FNR “(%06dL3)” $NR echo “$hor $ver moveto $FNR (includetext height=0.55) code39 barcode” let ver=$ver-70 let NR=NR+1 done done I need to somehow create a PHP script that executes this shell script. And after doing some research, it sounds like I need to use the PHP exec command, so I do that with the following file: http://www.winecarepro.com/kiosk/fast/shell/printbarcodes.php Which has the following script: ?php $command=http://www.winecarepro.com/kiosk/fast/shell/barcode_with_sample.ps;; exec($command, $arr); echo $arr; ? And, as you can see, nothing works. I guess firstly, I'd like
php-general Digest 22 Mar 2010 14:33:01 -0000 Issue 6653
php-general Digest 22 Mar 2010 14:33:01 - Issue 6653 Topics (messages 303083 through 303087): Re: web sniffer 303083 by: Auke van Slooten Re: PHP SMTP Mailers 303084 by: Auke van Slooten 303085 by: Michael A. Peters another question on setting include paths for a project 303086 by: Robert P. J. Day 303087 by: Richard Quadling Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Jochen Schultz wrote: Btw., when you use file_get_contets, is there a good way to tell the script to stop recieving the file after let's say 2 seconds - just in case the server is not reachable - to avoid using fsockopen? http://nl.php.net/manual/en/context.http.php specifically: timeout float Read timeout in seconds, specified by a float (e.g. 10.5). By default the default_socket_timeout php.ini setting is used. used with http://nl.php.net/manual/en/function.stream-context-create.php regards, Auke van Slooten Muze ---End Message--- ---BeginMessage--- King Coffee wrote: Hi, I'm executing a third-parity standard PHP application on a Windows IIS 7 shared hosting server. I need to convert, or use, a SMTP mailer service. I found two SMTP PHP scripts - I think may work. The sourceforge.net PHPMailer project and the pear.php.net (Mail, Net_SMTP) project. Can any body please help me choose one and probably give a code snip of useage? Currently, I'm leaning forward the PHPMailer, with little to base the decision on. Hi, I'd take a look at http://www.phpguru.org/static/smtp.html It doesn't make the mistake of muddling the differnece between the message envelope and the message body, so you can set the recipients directly and different from the messages to/cc/bcc headers. It has a fairly sane design, based on the smtp protocol. And finally it uses exceptions in a sane way. Oh, and its a fairly small and straightforward piece of code, easy to include in any application. There's one problem in it when using it for bulk-mail. If you add many recipients and one of them is incorrect, it will fail the entire message. It's not free for commercial use, but the one-time license fee is more than worth it. regards, Auke van Slooten Muze (And no, I'm not affiliated with the author, just a happy customer). ---End Message--- ---BeginMessage--- King Coffee wrote: Hi, I'm executing a third-parity standard PHP application on a Windows IIS 7 shared hosting server. I need to convert, or use, a SMTP mailer service. I found two SMTP PHP scripts - I think may work. The sourceforge.net PHPMailer project and the pear.php.net (Mail, Net_SMTP) project. Can any body please help me choose one and probably give a code snip of useage? Currently, I'm leaning forward the PHPMailer, with little to base the decision on. Thanks in advanced, King Coffee I use phpmailer and find it to be painless and consistent. I extend the class and call the extended class: ?php require(class.phpmailer.php); class MyMailer extends PHPMailer { // Set default variables for all new objects var $From = zon...@shastaherps.org; var $FromName = Lampro P. Eltis; var $ReplyTo = mpet...@mac.com; var $Host = localhost; var $Mailer = smtp; // Alternative to IsSMTP() var $WordWrap = 75; } ? Then when I want to use it - $mail = new MyMailer(); $mail-Subject = Some Subject; $mail-Body = Some content; if($mail-Send()) { // it was successfully sent, code on success here } else { // there was an error, error code here } I never send HTML mail or attachments or bulk mail, but I believe it is capable of doing them quite easily. Tip: Whatever solution you use, set the wordwrap to something that works well on an 80 char display. Some clients do not autowrap unwrapped messages and other clients wrap for display but when replying, it doesn't wrap. I use 75 because it gives a little room for the that accompanies a reply. ---End Message--- ---BeginMessage--- to recap regarding an earlier question i asked regarding extending include paths, i have an existing project (call it proj currently all under a top-level directory also named proj) which can be SVN checked out anywhere under a user's home directory. so in my case, i might have my svn working copy under, say, /home/rpjday/stuff/work/proj/, and all proj-related content under that. at the moment, there are some subdirs under proj/ like common and utils and debug, and all includes or requires throughout the working copy are currently and awkwardly of the form: include '../../proj/utils/somescript.php'; in short, every script that needs to include another one somewhere else
php-general Digest 21 Mar 2010 12:48:30 -0000 Issue 6651
php-general Digest 21 Mar 2010 12:48:30 - Issue 6651 Topics (messages 303062 through 303074): Re: Session Variable Problem 303062 by: Adam Richardson 303074 by: tedd Pulling my hair out over an include_once(); 303063 by: Watson Blair 303064 by: Watson Blair 303065 by: Stan Vassilev 303066 by: Adam Richardson 303067 by: Rene Veerman 303068 by: Adam Richardson 303069 by: Watson Blair 303070 by: Watson Blair 303071 by: Adam Richardson 303072 by: Rene Veerman REMINDER: Month of PHP Security 2010 - CALL FOR PAPERS - Only 3 weeks left 303073 by: Stefan Esser Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Sat, Mar 20, 2010 at 6:56 PM, Gary gwp...@ptd.net wrote: Adam Thank you for your reply. Are you checking to see if the post variable is set in the code that handles saving the form values to session variables? No, I not done anything about the post variable, frankly I thought the session variable would cover it. I tried your code if (isset($_POST['lend_fname'])){ $_SESSION['lend_fname']=stripslashes($_POST['lend_fname']); } And it seems to work fine, the data seems to stay. Is there an easier method (perhaps putting the post or session variables into an array? Again thank you for your reply and your solution. Gary Adam Richardson simples...@gmail.com wrote in message news:e4d8ea9d1003201529p1ab72baei147549423f5e3...@mail.gmail.com... On Sat, Mar 20, 2010 at 2:22 PM, Gary gwp...@ptd.net wrote: I have this perplexing issue of session varibles getting dropped. It is a 4 page form, the last page being a review page incase the submitter wants to change any of the information.If you go through the form, all of the information carries forward, and from the review page if you go back to edit, it is there, however is you go back to page 2, then to page 1, page one info is gone.It gets worse in that page 2 sessions drop (more likely over written) if you go from page 3 to 2. Each page is started with ?php if(!isset($_SESSION)) { session_start(); } Session varible: $_SESSION['lend_fname']=stripslashes($_POST['lend_fname']); Calling the session varible to the input field for review ?php if (isset($_SESSION['lend_fname'])) {echo 'value='.htmlentities($_SESSION['lend_fname']).'';}? The page starts at http://www.paulgdesigns.com/one2one/lend_bor_input.php Im confused as to why they keep getting dropped and how to stop it. Hopefully I have given enough information. Thank you Gary __ Information from ESET Smart Security, version of virus signature database 4961 (20100320) __ The message was checked by ESET Smart Security. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Are you checking to see if the post variable is set in the code that handles saving the form values to session variables? I can't tell if you're doing this from the code you provided. If not, it's possible that when you are returning to one of the earlier pages, you're attempting to again save the form values even though the corresponding $_POST vars are empty. This would cause visiting page 2 to essentially delete the data previously posted from page 1. Using your example: // Only save if post variable present, which means if (isset($_POST['lend_fname'])) { $_SESSION['lend_fname']=stripslashes($_POST['lend_fname']); } Also, some users will likely click the back button during the process, which brings up a funky message. You might try building one page that is dedicated to saving all of the session variables, which then redirects to the corresponding next page in the process. Adam -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com __ Information from ESET Smart Security, version of virus signature database 4961 (20100320) __ The message was checked by ESET Smart Security. http://www.eset.com __ Information from ESET Smart Security, version of virus signature database 4961 (20100320) __ The message was checked by ESET Smart Security. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php The session variables store what you tell them to store. The way your pages were set up, it sounds like you always called the code that set the session variable, even if the session
php-general Digest 22 Mar 2010 02:28:46 -0000 Issue 6652
php-general Digest 22 Mar 2010 02:28:46 - Issue 6652 Topics (messages 303075 through 303082): Re: PHP SMTP Mailers 303075 by: King Coffee Re: Session Variable Problem 303076 by: Gary 303077 by: tedd XSLTProcessor issue 303078 by: Tom Code samples in OOo Presenter 303079 by: Larry Garfield 303080 by: Ashley Sheridan 303081 by: Larry Garfield 303082 by: Paul M Foster Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Thanks Jan G. B., You got me over the first hump. I'm having programs installing pear on my VISTA localhost... So, I uploaded the Mail folder and Mail.php file to my Shared Hosting ISP. I do not think pear is provided. The Testing is as follows: ?php require_once Mail.php; // SSL HOST $host = ssl://smtp.gmail.com; $port = 587; $username = sen...@gmail.com; $password = Password; $from = King Coffee sen...@gmail.com; $to = Bill recipi...@hotmail.com; $subject = PHP Mail Test; $body = This is a simple mail test!; $headers = array('From' = $from, 'To' = $to, 'Subject' = $subject); $smtp = Mail::factory('smtp', array('host' = $host, 'port' = $port, 'auth' = true, 'username' = $username, 'password' = $password)); $mail = $smtp-send($to, $header, $body); if(PEAR::isError($mail)) { echo( p . $mail-getMessage() . /p); } else { echo(pMessage successfully sent/p); } ? html head titlePHP EMAIL TESTER/title h1This is a test/h1 ?php Echo Hi King; ? /head /html When I run the server page, The following error is displayed: Warning: require_once(PEAR.php) [function.require-once]: failed to open stream: No such file or directory in D:\Hosting\ID#\html\auction\Mail.php on line 46 Fatal error: require_once() [function.require]: Failed opening required 'PEAR.php' (include_path='.;C:\php5\pear') in D:\Hosting\ID#\html\auction\Mail.php on line 46 I will be still trying the get pear installed in VISA, but meanwhile, how can I obtain the PEAR.php and supporting files to upload? Thanks, King ---End Message--- ---BeginMessage--- Thanks again for all the help, however the plot thickens. I have put: ?php if(!isset($_SESSION)) { session_start(); } if (isset($_POST['lend_fname'])){ $_SESSION['lend_fname']=stripslashes($_POST['lend_fname']); } if (isset($_POST['lend_lname'])){ $_SESSION['lend_lname']=stripslashes($_POST['lend_lname']); } if (isset($_POST['lend_street'])){ $_SESSION['lend_street']=stripslashes($_POST['lend_street']); } if (isset($_POST['lend_city'])){ $_SESSION['lend_city']=stripslashes($_POST['lend_city']); } if (isset($_POST['lend_state'])){ $_SESSION['lend_state']=stripslashes($_POST['lend_state']); } if (isset($_POST['lend_lname'])){ $_SESSION['lend_zip']=stripslashes($_POST['lend_zip']); } if (isset($_POST['lend_email'])){ $_SESSION['lend_email']=stripslashes($_POST['lend_email']); } if (isset($_POST['lend_phone'])){ $_SESSION['lend_phone']=stripslashes($_POST['lend_phone']); } ? On the first page, Now what happens is it only sticks to the first two (lend_fname and lend_lname), the others still get lost. Any idea how or why the exact code works differently? Thanks Again. gary tedd tedd.sperl...@gmail.com wrote in message news:p06240800c7cbc0927...@[192.168.1.102]... At 2:22 PM -0400 3/20/10, Gary wrote: I have this perplexing issue of session varibles getting dropped. It is a 4 page form, the last page being a review page incase the submitter wants to change any of the information.If you go through the form, all of the information carries forward, and from the review page if you go back to edit, it is there, however is you go back to page 2, then to page 1, page one info is gone.It gets worse in that page 2 sessions drop (more likely over written) if you go from page 3 to 2. Each page is started with ?php if(!isset($_SESSION)) { session_start(); } Session varible: $_SESSION['lend_fname']=stripslashes($_POST['lend_fname']); Calling the session varible to the input field for review ?php if (isset($_SESSION['lend_fname'])) {echo 'value='.htmlentities($_SESSION['lend_fname']).'';}? The page starts at http://www.paulgdesigns.com/one2one/lend_bor_input.php Im confused as to why they keep getting dropped and how to stop it. Hopefully I have given enough information. Thank you Gary Gary: I think I know what the problem is. When you revisit previous pages, you write over the previous data from an empty $_POST. Here's a way to stop that. ?php session_start(); if (isset($_POST ['lend_fname']) { $_SESSION['lend_fname'] = $_POST['lend_fname']; } As far as using strip_slashes() and htmlentities() I wait until I am going to use the variables
php-general Digest 20 Mar 2010 10:35:42 -0000 Issue 6649
php-general Digest 20 Mar 2010 10:35:42 - Issue 6649 Topics (messages 303021 through 303041): Re: any reason *not* to use PEAR DB module when accessing mysql? 303021 by: Michael A. Peters 303032 by: Nilesh Govindarajan 303034 by: Michael A. Peters 303035 by: Nilesh Govindarajan 303039 by: Paul M Foster php compile / configure options 303022 by: Gregory Machin 303033 by: Nilesh Govindarajan 303036 by: Simon J Welsh Re: Spreadsheet_Excel_Reader problem 303023 by: Jason Pruim 303024 by: Ashley Sheridan 303026 by: Andrew Ballard 303027 by: Andrew Ballard 303037 by: Paul M Foster 303038 by: Paul M Foster Re: where to make observations about current PHP manual? 303025 by: Shawn McKenzie 303028 by: Robert P. J. Day 303029 by: Daniel Brown 303030 by: Daniel Brown 303031 by: Daniel Brown 303040 by: Robert P. J. Day 303041 by: Robert P. J. Day Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Mattias Thorslund wrote: Robert P. J. Day wrote: (just a warning -- as a relative newbie to PHP, i'll probably have the occasional dumb question. just humour me.) i'm looking at some existing PHP code that accesses a mysql 5.0 db, and it's coded using the mysql-specific calls: mysql_connect, mysql_select_db, etc, etc. is there any reason i *wouldn't* want to rewrite that code using the more general PEAR DB module, and use mysqli? certainly, as i read it, using the PEAR DB module would make it easier down the road if i suddenly decide to change the DB backend. anyway, any compelling arguments for or against? rday -- Well, the reason you shouldn't use PEAR DB in a new project is that it's being deprecated. MDB2 is the PEAR successor, and does provide emulation for some features that don't exist on all database platforms, such as LastInsertID. It can also help you convert your database from one platform to another, since it also provides methods for detecting and managing the database structure itself (the Manager and Reverse modules). That said, if I were to start a new project at this time, I would look closer at whether PDO fits my needs. I use MDB2. I hear PDO hyped a lot, what does it really give me that MDB2 does not, other than making the application dependent upon a binary module? ---End Message--- ---BeginMessage--- On 03/20/2010 02:31 AM, Michael A. Peters wrote: Mattias Thorslund wrote: Robert P. J. Day wrote: (just a warning -- as a relative newbie to PHP, i'll probably have the occasional dumb question. just humour me.) i'm looking at some existing PHP code that accesses a mysql 5.0 db, and it's coded using the mysql-specific calls: mysql_connect, mysql_select_db, etc, etc. is there any reason i *wouldn't* want to rewrite that code using the more general PEAR DB module, and use mysqli? certainly, as i read it, using the PEAR DB module would make it easier down the road if i suddenly decide to change the DB backend. anyway, any compelling arguments for or against? rday -- Well, the reason you shouldn't use PEAR DB in a new project is that it's being deprecated. MDB2 is the PEAR successor, and does provide emulation for some features that don't exist on all database platforms, such as LastInsertID. It can also help you convert your database from one platform to another, since it also provides methods for detecting and managing the database structure itself (the Manager and Reverse modules). That said, if I were to start a new project at this time, I would look closer at whether PDO fits my needs. I use MDB2. I hear PDO hyped a lot, what does it really give me that MDB2 does not, other than making the application dependent upon a binary module? binary module makes a lot of difference. If you use MDB2, the interpreter has to compile MDB2's code along with your program logic. Whereas PDO is already compiled one, so it will do the job much much faster. -- Nilesh Govindarajan Site Server Administrator www.itech7.com -- Nilesh Govindarajan Site Server Administrator www.itech7.com ---End Message--- ---BeginMessage--- Nilesh Govindarajan wrote: On 03/20/2010 02:31 AM, Michael A. Peters wrote: Mattias Thorslund wrote: Robert P. J. Day wrote: (just a warning -- as a relative newbie to PHP, i'll probably have the occasional dumb question. just humour me.) i'm looking at some existing PHP code that accesses a mysql 5.0 db, and it's coded using the mysql-specific calls: mysql_connect, mysql_select_db, etc, etc. is there any reason i *wouldn't* want to rewrite that code using the more general PEAR DB
php-general Digest 20 Mar 2010 22:57:03 -0000 Issue 6650
php-general Digest 20 Mar 2010 22:57:03 - Issue 6650 Topics (messages 303042 through 303061): PHP SMTP Mailers 303042 by: King Coffee 303044 by: Jan G.B. no svn checkout of the current PHP development repo? 303043 by: Robert P. J. Day 303045 by: Daniel P. Brown 303046 by: Peter Lind 303047 by: Robert P. J. Day 303048 by: Daniel Brown How do I upgrade GD? 303049 by: PmI 303050 by: Per Jessen blog design issue... 303051 by: Jason Pruim 303052 by: Ashley Sheridan 303053 by: Richard 303054 by: Robert Cummings 303055 by: Richard 303056 by: tedd 303057 by: Dan McCullough 303059 by: Rene Veerman Session Variable Problem 303058 by: Gary 303060 by: Adam Richardson 303061 by: Gary Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Hi, I'm executing a third-parity standard PHP application on a Windows IIS 7 shared hosting server. I need to convert, or use, a SMTP mailer service. I found two SMTP PHP scripts - I think may work. The sourceforge.net PHPMailer project and the pear.php.net (Mail, Net_SMTP) project. Can any body please help me choose one and probably give a code snip of useage? Currently, I'm leaning forward the PHPMailer, with little to base the decision on. Thanks in advanced, King Coffee ---End Message--- ---BeginMessage--- 2010/3/20 King Coffee kcof...@hotmail.com Hi, I'm executing a third-parity standard PHP application on a Windows IIS 7 shared hosting server. I need to convert, or use, a SMTP mailer service. I found two SMTP PHP scripts - I think may work. The sourceforge.net PHPMailer project and the pear.php.net (Mail, Net_SMTP) project. Can any body please help me choose one and probably give a code snip of useage? Currently, I'm leaning forward the PHPMailer, with little to base the decision on. Thanks in advanced, King Coffee Hi. I'd stick to a PEAR module as long as it exists, because you can update it easily. Check out the examples in the PEAR Documentation. http://pear.php.net/manual/en/package.mail.mail.intro.php There's also a full detail example here: http://pear.php.net/manual/en/package.mail.mail.send.php Bye ---End Message--- ---BeginMessage--- just for fun, i figured i'd check out the current PHP development stream. however, if you read the web page here: http://php.net/svn.php there's no mention of the trunk, simply references to branches such as 5.2 and 5.3. i popped over to: http://svn.php.net/viewvc/php/php-src/ and, sure enough, there's no trunk directory. am i just missing something? because if i click on the PHP 6 link up there on the right (which represents exactly what i'd expect for the URL of the trunk), bad things happen: An Exception Has Occurred Unknown location: /php/php-src/trunk HTTP Response Status 404 Not Found thoughts? i'll assume this is just a temporary thing but, in any event, if the trunk is normally available, the PHP svn page should really mention it explicitly, not just the 5.x branches. rday -- Robert P. J. Day Waterloo, Ontario, CANADA Linux Consulting, Training and Kernel Pedantry. Web page: http://crashcourse.ca Twitter: http://twitter.com/rpjday ---End Message--- ---BeginMessage--- This starts to get out of the scope of the General list. If you think it's a bug, report it. Did you check out the latest snap? It's an hourly build from the SVN repo. (If this top-posts, my apologies. I'm sitting in the living room with my little girl, typing from my DROID.) On Mar 20, 2010 7:36 AM, Robert P. J. Day rpj...@crashcourse.ca wrote: just for fun, i figured i'd check out the current PHP development stream. however, if you read the web page here: http://php.net/svn.php there's no mention of the trunk, simply references to branches such as 5.2 and 5.3. i popped over to: http://svn.php.net/viewvc/php/php-src/ and, sure enough, there's no trunk directory. am i just missing something? because if i click on the PHP 6 link up there on the right (which represents exactly what i'd expect for the URL of the trunk), bad things happen: An Exception Has Occurred Unknown location: /php/php-src/trunk HTTP Response Status 404 Not Found thoughts? i'll assume this is just a temporary thing but, in any event, if the trunk is normally available
php-general Digest 19 Mar 2010 07:06:30 -0000 Issue 6647
php-general Digest 19 Mar 2010 07:06:30 - Issue 6647 Topics (messages 302972 through 302994): Re: Spreadsheet_Excel_Reader problem 302972 by: Paul M Foster 302974 by: Paul M Foster 302977 by: Ashley Sheridan 302980 by: Andrew Ballard 302985 by: Paul M Foster Re: PHP in HTML code 302973 by: Ashley Sheridan 302975 by: Jan G.B. 302976 by: Ashley Sheridan 302978 by: Adam Richardson 302979 by: Jan G.B. 302981 by: Ashley Sheridan 302982 by: Jan G.B. 302983 by: Ashley Sheridan 302984 by: Adam Richardson web sniffer 302986 by: madunix 302987 by: Ashley Sheridan 302988 by: Adam Richardson 302989 by: madunix 302990 by: Ashley Sheridan 302991 by: Adam Richardson 302992 by: madunix Re: confirm subscribe to php-gene...@lists.php.net 302993 by: Blake Morgan Example of good PHP namespace usage? 302994 by: D. Dante Lorenso Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Thu, Mar 18, 2010 at 09:16:30AM -0700, Mattias Thorslund wrote: Paul M Foster wrote: I process a lot of CSV files, and what I typically see is that Excel will enclose fields which might contain commas in quotes. This gets messy. So I finally wrote a C utility which parses the file and yields tab-delimited records without the quotes. Paul And fgetcsv() didn't work for you? http://www.php.net/fgetcsv I wrote my utility (and the infrastructure to process these files) long before I was working with PHP. For what I do with the files, I must pipe one operation's results to another process/command to get the final result. This is impossible with web-based PHP. So I shell out from PHP to do it. Like this: // convert original file to tab-delimited cat maillist.csv | cqf | filter.cq3or4 jones.tab // filter unwanted fields and reorder fields mlt3.py nady jones.tab jones.rdb // build basic DBF file dbfsak -r mailers.rdb jones.dbf // append rdb records to DBF file dbfsak -a jones.rdb jones.dbf Paul -- Paul M. Foster ---End Message--- ---BeginMessage--- On Thu, Mar 18, 2010 at 04:15:33PM +, Ashley Sheridan wrote: On Thu, 2010-03-18 at 12:12 -0400, Paul M Foster wrote: On Thu, Mar 18, 2010 at 08:57:00AM -0700, Tommy Pham wrote: snip Personally, I find working with fixed widths is best. The text file might be larger but I don't have worry about escaping any type of characters ;) I find this impossible, since I never know the largest width of all the fields in a file. And a simple explode() call allows pulling all the fields into an array, based on a common delimiter. Paul -- Paul M. Foster Explode won't work in the case of a comma in a field value. That's why I convert the files to tab-delimited first. explode() does work in that case. Also, newlines can exist within a field value, so a line in the file doesn't equate to a row of data I've never seen this in the files I receive. The best way is just to start parsing at the beginning of the file and break it into fields one by one from there. The bit I don't like about characters other than a comma being used in a comma separated values file is that you can't automatically tell what character has been used as the delimiter. Hence being asked by spreadsheet programs what the delimiter is if a comma doesn't give up what it recognises as valid fields. I've honestly never seen a CSV or Comma-separated Values which used tabs for delimiters. At that point, it's really not a *comma* separated value file. My application for all this is accepting mailing lists from customers which I have to convert into DBFs for a commercial mailing list program. Because most of my customers can barely find the on/off switch on their computers, I never know what I'm going to get. So before I string together the filters to process the file, I have to actually look at and analyze the file to find out what it is. Could be a fixed-field length file, a CSV, a tab-delimited file, or anything in between. Once I've selected the filters, the sequence they will be put together in, and the fields from the file I want to capture, I hit the button. After it's all done, I now have to look at the result to ensure that the requested fields ended up where they were supposed to. Paul -- Paul M. Foster ---End Message--- ---BeginMessage--- On Thu, 2010-03-18 at 12:57 -0400, Paul M Foster wrote: On Thu, Mar 18, 2010 at 04:15:33PM +, Ashley Sheridan wrote: On Thu, 2010-03-18 at 12:12 -0400, Paul M Foster wrote: On Thu, Mar
php-general Digest 19 Mar 2010 21:01:36 -0000 Issue 6648
php-general Digest 19 Mar 2010 21:01:36 - Issue 6648 Topics (messages 302995 through 303020): Re: web sniffer 302995 by: Jochen Schultz 302996 by: Peter Lind 302997 by: madunix 303000 by: Jay Blanchard 303001 by: Ashley Sheridan 303002 by: Jochen Schultz 303003 by: Jochen Schultz 303004 by: Rene Veerman Re: PHP in HTML code 302998 by: Michael A. Peters 302999 by: Peter Lind any reason *not* to use PEAR DB module when accessing mysql? 303005 by: Robert P. J. Day 303007 by: Ashley Sheridan 303010 by: Paul M Foster 303011 by: Adam Richardson 303012 by: Rene Veerman 303014 by: Nilesh Govindarajan 303015 by: larry.garfieldtech.com 303016 by: Mattias Thorslund 303017 by: Lester Caine 303018 by: Robert P. J. Day need a free sql table layout diagram app for linux, not phpmyadmin coz it has a bug with 7 tables opened in its designer. 303006 by: Rene Veerman 303008 by: Ashley Sheridan 303013 by: Rene Veerman Re: Example of good PHP namespace usage? 303009 by: Adam Richardson Event/Exhibition Organizers Management Software 303019 by: Jochem Maas where to make observations about current PHP manual? 303020 by: Robert P. J. Day Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Btw., when you use file_get_contets, is there a good way to tell the script to stop recieving the file after let's say 2 seconds - just in case the server is not reachable - to avoid using fsockopen? regards Jochen madunix schrieb: okay ..it works now i use ?php $data=file_get_contents(http://www.my.com;); echo $data; ? On Fri, Mar 19, 2010 at 12:32 AM, Adam Richardson simples...@gmail.com wrote: On Thu, Mar 18, 2010 at 6:08 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Fri, 2010-03-19 at 00:11 +0200, madunix wrote: trying http://us3.php.net/manual/en/function.fsockopen.php do you a piece of code that read parts pages. On Fri, Mar 19, 2010 at 12:00 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Fri, 2010-03-19 at 00:03 +0200, madunix wrote: I've been trying to read the contents from a particular URL into a string in PHP, and can't get it to work. any help. Thanks -- If there is a way, I will find one...*** If there is none, I will make one...*** madunix ** How have you been trying to do it so far? There are a couple of ways. file_get_contents() and fopen() will work on URL's if the right ports are open. Most usually though cURL is used for this sort of thing. Thanks, Ash http://www.ashleysheridan.co.uk -- If there is a way, I will find one...*** If there is none, I will make one...*** madunix ** I think you're over-complicating things by using fsockopen(). Try one of the functions I mentioned in my last email Thanks, Ash http://www.ashleysheridan.co.uk I agree with Ashley, use one of the other options and then parse the response to get the part of the page you'd like to work with. -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com -- Sport Import GmbH - Amtsgericht Oldenburg - Tel: +49-4405-9280-63 Industriestrasse 39 - HRB 1202900- 26188 Edewecht - GF: Michael Müllmann ---End Message--- ---BeginMessage--- You should be able to do that by setting context options: http://www.php.net/manual/en/context.http.php On 19 March 2010 08:53, Jochen Schultz jschu...@sportimport.de wrote: Btw., when you use file_get_contets, is there a good way to tell the script to stop recieving the file after let's say 2 seconds - just in case the server is not reachable - to avoid using fsockopen? regards Jochen madunix schrieb: okay ..it works now i use ?php $data=file_get_contents(http://www.my.com;); echo $data; ? On Fri, Mar 19, 2010 at 12:32 AM, Adam Richardson simples...@gmail.com wrote: On Thu, Mar 18, 2010 at 6:08 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Fri, 2010-03-19 at 00:11 +0200, madunix wrote: trying http://us3.php.net/manual/en/function.fsockopen.php do you a piece of code that read parts pages. On Fri, Mar 19, 2010 at 12:00 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Fri, 2010-03-19 at 00:03 +0200, madunix wrote: I've been trying to read the contents from a particular URL into a string in PHP, and can't get
[PHP] Re: confirm subscribe to php-general@lists.php.net
On 3/18/2010 9:36 PM, php-general-h...@lists.php.net wrote: Hi! This is the ezmlm program. I'm managing the php-general@lists.php.net mailing list. I'm working for my owner, who can be reached at php-general-ow...@lists.php.net. To confirm that you would like bmorga...@gmail.com added to the php-general mailing list, please send an empty reply to this address: php-general-sc.1268962598.gpkmhgepijekphmnnice-bmorganva=gmail@lists.php.net Usually, this happens when you just hit the reply button. If this does not work, simply copy the address and paste it into the To: field of a new message. or click here: mailto:php-general-sc.1268962598.gpkmhgepijekphmnnice-bmorganva=gmail@lists.php.net This confirmation serves two purposes. First, it verifies that I am able to get mail through to you. Second, it protects you in case someone forges a subscription request in your name. Some mail programs are broken and cannot handle long addresses. If you cannot reply to this request, instead send a message to php-general-requ...@lists.php.net and put the entire address listed above into the Subject: line. --- Administrative commands for the php-general list --- I can handle administrative requests automatically. Please do not send them to the list address! Instead, send your message to the correct command address: For help and a description of available commands, send a message to: php-general-h...@lists.php.net To subscribe to the list, send a message to: php-general-subscr...@lists.php.net To remove your address from the list, just send a message to the address in the ``List-Unsubscribe'' header of any list message. If you haven't changed addresses since subscribing, you can also send a message to: php-general-unsubscr...@lists.php.net or for the digest to: php-general-digest-unsubscr...@lists.php.net For addition or removal of addresses, I'll send a confirmation message to that address. When you receive it, simply reply to it to complete the transaction. If you need to get in touch with the human owner of this list, please send a message to: php-general-ow...@lists.php.net Please include a FORWARDED list message with ALL HEADERS intact to make it easier to help you. --- Enclosed is a copy of the request I received. Return-Path:nore...@php.net Received: (qmail 37443 invoked from network); 19 Mar 2010 01:36:38 - Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2010 01:36:38 - Return-Path:nore...@php.net Authentication-Results: pb1.pair.com smtp.mail=nore...@php.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=bmorga...@gmail.com; sender-id=unknown Received-SPF: pass (pb1.pair.com: domain php.net designates 140.211.166.39 as permitted sender) X-PHP-List-Original-Sender: nore...@php.net X-Host-Fingerprint: 140.211.166.39 osu1.php.net Linux 2.4/2.6 Received: from [140.211.166.39] ([140.211.166.39:35224] helo=osu1.php.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/A0-31664-525D2AB4 forphp-general-subscribe-bmorganva=gmail@lists.php.net; Thu, 18 Mar 2010 20:36:38 -0500 Authentication-Results: osu1.php.net header.from=bmorga...@gmail.com; sender-id=neutral Authentication-Results: osu1.php.net smtp.mail=nore...@php.net; spf=neutral; sender-id=neutral Received: from [127.0.0.1] ([127.0.0.1:35215] helo=osu1.php.net) by osu1.php.net (envelope-fromnore...@php.net) (ecelerity 2.2.2.32 r(25190M)) with ESMTP id F4/25-12636-549D2AB4; Thu, 18 Mar 2010 17:54:18 -0800 Received: (from apa...@localhost) by osu1.php.net (8.12.11/8.12.11/Submit) id o2J1sBWu030283; Thu, 18 Mar 2010 17:54:11 -0800 Date: Thu, 18 Mar 2010 17:54:11 -0800 Message-Id:201003190154.o2j1sbwu030...@osu1.php.net To: php-general-subscribe-bmorganva=gmail@lists.php.net Subject: PHP Mailing List Website Subscription From: bmorga...@gmail.com This was a request generated from the form at http://www.php.net/mailing-lists.php by 71.246.203.235. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 17 Mar 2010 14:30:09 -0000 Issue 6644
php-general Digest 17 Mar 2010 14:30:09 - Issue 6644 Topics (messages 302920 through 302929): Re: Need routine to tell me number of dimensions in array. 302920 by: Robert Cummings 302925 by: Richard Quadling different php.ini for virtual host on apache2 with mod_php5 302921 by: Stanislaw V. Smetanin 302923 by: Rene Veerman 302924 by: Ashley Sheridan 302928 by: Shawn McKenzie Re: best way to set up an include path for a multi-level project? 302922 by: Robert P. J. Day 302926 by: Bob McConnell 302929 by: Robert P. J. Day natural language processing (nlp) (was: natural text / human text analysis) 302927 by: Rene Veerman Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Rene Veerman wrote: maybe you should be foreach()ing with references? php.net : search foreach : As of PHP 5, you can easily modify array's elements by preceding $value with . This will assign reference instead of copying the value. ?php $arr = array(1, 2, 3, 4); foreach ($arr as $value) { $value = $value * 2; } // $arr is now array(2, 4, 6, 8) unset($value); // break the reference with the last element ? This is possible only if iterated array can be referenced (i.e. is variable), References in foreach don't work the way you think they work. You will still incur the copy. At least I did when I tested earlier today :) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP ---End Message--- ---BeginMessage--- On 17 March 2010 01:10, Robert Cummings rob...@interjinn.com wrote: Rene Veerman wrote: maybe you should be foreach()ing with references? php.net : search foreach : As of PHP 5, you can easily modify array's elements by preceding $value with . This will assign reference instead of copying the value. ?php $arr = array(1, 2, 3, 4); foreach ($arr as $value) { $value = $value * 2; } // $arr is now array(2, 4, 6, 8) unset($value); // break the reference with the last element ? This is possible only if iterated array can be referenced (i.e. is variable), References in foreach don't work the way you think they work. You will still incur the copy. At least I did when I tested earlier today :) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php The peak memory usage when using references (or not) and using foreach() vs array_walk() was the same in all my testing. But surprisingly, the foreach() with references all round used the lowest memory during the looping. The worse case was mixing reference and value passing with array_walk(). My dataset was generated by reading the C:\PHP5 directory where the keys are the directories and saving the data as an include (var_export()-ing it). RIchard. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling ---End Message--- ---BeginMessage--- Hi there. the problem: I want to disable mail() function in the one of virtual hosts' that use PHP(I use mod_php for apache2), and regarding to the http://www.php.net/manual/en/ini.core.php#ini.disable-functions I can't use directives like php_value, etc, because value of disable_functions can be set only in php.ini, but I don't want to disable mail() on the all of my virtual hosts, just on one. the question: Can I use different php.ini for virtual hosts, in my case I want to use php.ini for one host, where disable_functions = mail will be. Here backgrounds: stanis...@smetanin:~$ uname -rv 2.6.31-19-generic #56-Ubuntu SMP Thu Jan 28 01:26:53 UTC 2010 stanis...@smetanin:~$ dpkg -l libapache2-mod-php5 | tail -n1 ii libapache2-mod-php5 5.2.10.dfsg.1-2ubuntu6.4 server-side, HTML-embedded scripting language (Apache 2 module) stanis...@smetanin:~$ apache2 -v Server version: Apache/2.2.12 (Ubuntu) Thanks to the community for any help. -- Stanislaw Smetanin. http://stanislaw.su/ ---End Message--- ---BeginMessage--- i dunno about overriding the entire php function, but you can disable mail() in the virtualhost section of your apache config with the following line: php_value disabled_functions mail On Wed, Mar 17, 2010 at 9:58 AM, Stanislaw V. Smetanin r...@stanislaw.su wrote: Hi there. the problem: I want to disable mail() function in the one of virtual hosts' that use PHP(I use
php-general Digest 18 Mar 2010 04:23:18 -0000 Issue 6645
php-general Digest 18 Mar 2010 04:23:18 - Issue 6645 Topics (messages 302930 through 302948): Re: best way to set up an include path for a multi-level project? 302930 by: Robert P. J. Day 302932 by: Teus Benschop open source bookshop 302931 by: Ali Reza Sajedi 302938 by: Tommy Pham 302941 by: O. Lavell 302942 by: Ali Reza Sajedi 302943 by: Tommy Pham 302944 by: Tommy Pham 302948 by: Kevin Kinsey Re: natural language processing (nlp) (was: natural text / human text analysis) 302933 by: Nathan Rixham 302936 by: Rene Veerman Re: $_FILE array being truncated 302934 by: Ford, Mike Re: PHP in HTML code 302935 by: tedd 302937 by: Rene Veerman 302940 by: Tommy Pham 302946 by: tedd best way to determine mime type of file these days? 302939 by: Robert P. J. Day Re: fresh look at storing variables in MySQL [Solution] 302945 by: tedd Re: I need a fresh look at storing variables in MySQL 302947 by: Tommy Pham Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Wed, 17 Mar 2010, Bob McConnell wrote: I suspect you will have to manage that on a machine by machine basis, unless you can convince the entire development team to create a common directory structure that encompasses all projects. i'm not sure what you mean by the above. while that single project (that others might want to take advantage of) will have to have a uniform and consistent layout for everyone, i don't see that that will enforce any sort of uniformity on *other* projects that might want to take advantage of it. or am i misunderstanding you? rday -- Robert P. J. Day Waterloo, Ontario, CANADA Linux Consulting, Training and Kernel Pedantry. Web page: http://crashcourse.ca Twitter: http://twitter.com/rpjday ---End Message--- ---BeginMessage--- let me emphasize that the layout of the entire proj directory will be consistent across all users and all machines since it will represent a single SVN checkout, so that's not an issue. of course, anyone will be free to check it out anywhere they want but once they do, its structure will be the same across all checkouts. The problem of an easy include path also came up in our project. The solution was to create a Bootstrap class, that sets the include path as follows: private function __construct() { // Set the include path, where to look for included files. // This is important so as to make pointing to the included files much easier, // and to avoid tortuous path references. $this-bibledit_root_folder = dirname (dirname(__FILE__)); $include_path = get_include_path () . : . $this-bibledit_root_folder; set_include_path ($include_path); ini_set('include_path', $include_path); } The central issue in the above is to use the __FILE__ variable as the starting point for the include path. Since the bootstrap.php is in a known location in the directory tree, we can always deduce a known include path from that. After that, each php file in each directory was set to include this bootstrap.php, in various forms, depending on where this php file was located in the directory tree: require_once (../bootstrap/bootstrap.php); or: require_once (../../bootstrap/bootstrap.php); or require_once (bootstrap/bootstrap.php); That way the include path got set bootstrap.php. It works well. Teus. ---End Message--- ---BeginMessage--- Hello all, Does anybody know a good open source bookshop/bookstore system written in php+mysql? Google and sourceforge search didn't yield good results. Any hint would be very much appreciated. Ali ---End Message--- ---BeginMessage--- On Wed, Mar 17, 2010 at 7:55 AM, Ali Reza Sajedi arsaj...@khanehjou.com wrote: Hello all, Does anybody know a good open source bookshop/bookstore system written in php+mysql? Google and sourceforge search didn't yield good results. Any hint would be very much appreciated. Ali -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Sounds like you're looking for an e-commerce solution. Did you search for 'open source e-commerce' ? ---End Message--- ---BeginMessage--- Tommy Pham wrote: Ali Reza Sajedi wrote: Hello all, Does anybody know a good open source bookshop/bookstore system written in php+mysql? Sounds like
php-general Digest 16 Mar 2010 12:34:24 -0000 Issue 6642
php-general Digest 16 Mar 2010 12:34:24 - Issue 6642 Topics (messages 302880 through 302889): Re: Need routine to tell me number of dimensions in array. 302880 by: Ashley Sheridan 302881 by: Jim Lucas 302882 by: Robert Cummings Re: PHP in HTML code 302883 by: Ford, Mike 302884 by: Ashley Sheridan 302885 by: Ford, Mike 302889 by: Bob McConnell Spreadsheet_Excel_Reader problem 302886 by: I am on the top of the world! Borlange University 302888 by: Ashley Sheridan Re: php-cli 302887 by: Richard Quadling Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Mon, 2010-03-15 at 17:23 -0700, Daevid Vincent wrote: Oh. I know it's not a simple solution to do right Ashley. And exacerbated by the fact that each array dimension can have different dimensions as well. This is why I wanted someone else's solution first before I spend hours or days on one that works reliably. :) _ From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: Monday, March 15, 2010 4:44 PM Subject: Re: [PHP] Need routine to tell me number of dimensions in array The only way to do it reliably would be to iterate the entire array, element by element, as all the elements of an array might not necessarily be all of the array type or int's. Best way I can think of is to iterate the entire thing and keep a count as you do. I'm not aware of any functions that can do what you need there. Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- Daevid Vincent wrote: Anyone have a function that will return an integer of the number of dimensions an array has? I did some quick searches and came up with nothing. The closest was here of someone asking the same thing, but his solution isn't right: http://www.bigresource.com/PHP-count-array-dimensions-VrIahx1b.html http://php.net/manual/en/function.count.php From a human standpoint, it's easy to see, oh, this is a TWO dimensional... How about this... Using a slightly modified array that you posted, I came up with this in about 10 minutes preI am working with the following data structure ?php $in = array( 0 = array( 0 = array('Flight Number', 'flight_number'), 1 = array( 0 = array('Timestamp Departure', 'timestamp_departure'), 1 = array('Timestamp Arrival', 'timestamp_arrival'), ) ), 1 = array('Departure City', 'departure_city'), 2 = array('Arrival City', 'arrival_city'), ); print_r($in); echo \n\n; $max_depth = 0; $cur_depth = 0; function max_array_depth($ar) { global $cur_depth, $max_depth; if ( is_array($ar) ) { $cur_depth++; if ( $cur_depth $max_depth ) { $max_depth = $cur_depth; } foreach ( $ar AS $row ) { max_array_depth($row); } $cur_depth--; } } max_array_depth($in); echo Max depth of array is: {$max_depth}; ?/pre http://www.cmsws.com/examples/php/testscripts/dae...@daevid.com/0002.php -- Jim Lucas NOC Manager 541-323-9113 BendTel, Inc. http://www.bendtel.com ---End Message--- ---BeginMessage--- Jim Lucas wrote: Daevid Vincent wrote: Anyone have a function that will return an integer of the number of dimensions an array has? I did some quick searches and came up with nothing. The closest was here of someone asking the same thing, but his solution isn't right: http://www.bigresource.com/PHP-count-array-dimensions-VrIahx1b.html http://php.net/manual/en/function.count.php From a human standpoint, it's easy to see, oh, this is a TWO dimensional... How about this... Using a slightly modified array that you posted, I came up with this in about 10 minutes preI am working with the following data structure ?php $in = array( 0 = array( 0 = array('Flight Number', 'flight_number'), 1 = array( 0 = array('Timestamp Departure', 'timestamp_departure'), 1 = array('Timestamp Arrival', 'timestamp_arrival'), ) ), 1 = array('Departure City', 'departure_city'), 2 = array('Arrival City', 'arrival_city'), ); print_r($in); echo \n\n; $max_depth = 0; $cur_depth = 0; function max_array_depth($ar) { global $cur_depth, $max_depth; if ( is_array($ar) ) { $cur_depth++; if ( $cur_depth $max_depth ) { $max_depth = $cur_depth; } foreach ( $ar AS $row ) { max_array_depth($row); } $cur_depth--; } } max_array_depth($in); echo
php-general Digest 17 Mar 2010 00:55:41 -0000 Issue 6643
php-general Digest 17 Mar 2010 00:55:41 - Issue 6643 Topics (messages 302890 through 302919): Re: Need routine to tell me number of dimensions in array. 302890 by: Richard Quadling 302893 by: Robert Cummings 302894 by: Peter Lind 302898 by: Robert Cummings 302899 by: Robert Cummings 302900 by: Peter Lind 302901 by: Robert Cummings 302912 by: Rene Veerman Re: Spreadsheet_Excel_Reader problem 302891 by: Jochen Schultz $_FILE array being truncated 302892 by: Richard H Lee 302902 by: Daniel Egeberg 302903 by: Ashley Sheridan 302904 by: Richard H Lee 302907 by: Kim Madsen 302911 by: Rene Veerman Re: Deleting multiple backslashes; regex? 302895 by: Al Re: PHP MySQL Insert Statements 302896 by: Jan G.B. 302897 by: Ryan Sun best way to set up an include path for a multi-level project? 302905 by: Robert P. J. Day 302908 by: John Black 302909 by: John Black 302910 by: Ryan Sun 302913 by: Rene Veerman Re: PHP in HTML code 302906 by: tedd 302914 by: Rene Veerman 302915 by: Ashley Sheridan 302919 by: Adam Richardson Database vs. Array 302916 by: Richard S. Crawford 302917 by: Bastien Koert 302918 by: Ryan Sun Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On 15 March 2010 23:45, Daevid Vincent dae...@daevid.com wrote: Anyone have a function that will return an integer of the number of dimensions an array has? /** * Get the maximum depth of an array * * @param array $Data A reference to the data array * @return int The maximum number of levels in the array. */ function arrayGetDepth(array $Data) { static $CurrentDepth = 1; static $MaxDepth = 1; array_walk($Data, function($Value, $Key) use($CurrentDepth, $MaxDepth) { if (is_array($Value)) { $MaxDepth = max($MaxDepth, ++$CurrentDepth); arrayGetDepth($Value); --$CurrentDepth; } }); return $MaxDepth; } Extending Jim and Roberts comments to this. No globals. By using a reference to the array, large arrays are not copied (memory footprint is smaller). And by using array_walk, a separate internal pointer is used, so no need to worry about losing your position on the array. Something to watch out for though is recursion in the array. If a value in the array is a reference to another part of the array, you are going to loop around for ever. $Data = array($Data); for example, with the line ... echo $CurrentDepth, $MaxDepth, $Key\n; in the callback function() will report 17701 before crashing out (no stack error surprisingly enough). Regards, Richard Quadling. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling ---End Message--- ---BeginMessage--- Richard Quadling wrote: On 15 March 2010 23:45, Daevid Vincent dae...@daevid.com wrote: Anyone have a function that will return an integer of the number of dimensions an array has? /** * Get the maximum depth of an array * * @param array $Data A reference to the data array * @return int The maximum number of levels in the array. */ function arrayGetDepth(array $Data) { static $CurrentDepth = 1; static $MaxDepth = 1; array_walk($Data, function($Value, $Key) use($CurrentDepth, $MaxDepth) { if (is_array($Value)) { $MaxDepth = max($MaxDepth, ++$CurrentDepth); arrayGetDepth($Value); --$CurrentDepth; } }); return $MaxDepth; } Extending Jim and Roberts comments to this. No globals. By using a reference to the array, large arrays are not copied (memory footprint is smaller). Using a reference actually increases overhead. References in PHP were mostly useful in PHP4 when assigning objects would cause the object to be copied. But even then, for arrays, a Copy on Write (COW) strategy was used (and is still used) such that you don't copy any values. Try it for yourself: ?php $copies = array(); $string = str_repeat( '*', 100 ); echo memory_get_usage().\n; for( $i = 0; $i 1000; $i++ ) { $copies[] = $string; } echo memory_get_usage().\n; ? Cheers, Rob. -- http://www.interjinn.com Application
php-general Digest 14 Mar 2010 11:14:37 -0000 Issue 6638
php-general Digest 14 Mar 2010 11:14:37 - Issue 6638 Topics (messages 302788 through 302795): Re: Migration Scheme - from one mysql DB to another mysql DB 302788 by: MEM Re: I need a fresh look at storing variables in MySQL 302789 by: Paul M Foster 302790 by: Paul M Foster 302791 by: Jochem Maas 302792 by: Rene Veerman 302793 by: Rene Veerman 302794 by: Ashley Sheridan 302795 by: Rene Veerman Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- I'd like to know - what type of hosting and OS the 2 databases are running. - if they're (staying) on the same machine, and if not: whats the available bandwith (updown, lowpeak) between the machines? any cost to that bandwith? - if you have admin rights on both databases. - how often you need to do this and for how much data (in Mb) Thank you all for your replies. I will leave you with more details, but, I believe the single query approach with two PDO (or mysqli) connections should be quite well. Both DB are on the same server, Linux based one, but different dsn should apply. The bandwith cost will not be an issue, because we are talking about 15MB of data, or something similar. I don't have admin rights but I can try to have them if I must to. I believe this will be a single time, or, one in a long time run but, we can never predict. The destination table also has some random data filled fields that I need to generate and introduce with the old data on this new database. Wondering if mySQL Migration Toolkit can do the job? Thanks a lot for your help, Márcio ---End Message--- ---BeginMessage--- On Sat, Mar 13, 2010 at 02:45:37PM -0500, Phpster wrote: I'd go with a mysql data modelled approach as it will allow mysql to do lots of the heavy lifting during analysis as you've mentioned. If there are a lot of entries, it's gonna get complex and expensive memory-wise to manage XML or session based datasets. Plus having each question as it's own record should give you greater flexibility in packaging the data for analysis and reporting. +1 I invariably find that the original design for a project needs to be tweaked. The customer wants to add or delete questions, they want to add/change reports for the data. So I nearly always approach this kind of project this way. Maybe: vote table: id serial/sequence not null primary key voter_idint references voters (voter_id) question_id varchar(10) answer varchar(10) You can easily subset by voter, or by question ID. Or analyze answers in relation to other answers, etc. Paul -- Paul M. Foster ---End Message--- ---BeginMessage--- On Sat, Mar 13, 2010 at 09:04:46PM +0100, Rene Veerman wrote: snip and the OP may not have good db design skills yet. for a noob, it's one timeconsuming thing to build a datamodel, but it's harder to get it efficient yet simple. snip OP: if you need a mysql datamodel for reports, i'm willing to give it a free shot. i'm sure others here would too, or improve upon mine. It's probably not more than 3 tables i think. Let us know eh.. Tedd's perfectly capable of speaking for himself, but I can tell you he's been on this list for a long time, and his skills are plenty adequate for this task. He's just asking for second opinions. Paul -- Paul M. Foster ---End Message--- ---BeginMessage--- Hi Tedd, just a few thoughts that might help ... Op 3/13/10 6:10 PM, tedd schreef: Hi gang: I just completed writing a survey that has approximately 180 questions in it and I need a fresh look at how to store the results so I can use them later. first off - wasn't there a cut'n'dried piece of survey software out there that did the job? don't know off hand what the 'market' currently offers but I'm pretty sure there are a number of candidate php-based wotsits. as such they might be worth looking at just to check out their data models. The survey requires the responder to identify themselves via an authorization script. After which, the responder is permitted to take the survey. Everything works as the client wants so there are no problems there. My question is how to store the results? I have the answers stored in a session variable, like: $_SESSION['answer']['e1'] $_SESSION['answer']['e2'] $_SESSION['answer']['e2a'] $_SESSION['answer']['e2ai'] $_SESSION['answer']['p1'] $_SESSION['answer']['p1a'] $_SESSION['answer']['p1ai'] and so on. As I said, there are around 180 questions/answers. Most of the answers are integers (less than 100), some are text, and some will be null. Each vote will have a unique number (i.e., time) assigned to it as well
php-general Digest 14 Mar 2010 23:56:56 -0000 Issue 6639
php-general Digest 14 Mar 2010 23:56:56 - Issue 6639 Topics (messages 302796 through 302816): Re: I need a fresh look at storing variables in MySQL 302796 by: Ashley Sheridan 302797 by: Rene Veerman 302798 by: Rene Veerman 302799 by: Ashley Sheridan 302816 by: Jochem Maas SimpleXML: convert xml to text 302800 by: Dasn 302801 by: Ashley Sheridan 302815 by: Dasn gmail filter test 302802 by: bruce 302803 by: Ashley Sheridan php - page flow issue... 302804 by: bruce 302809 by: Rene Veerman php-cli 302805 by: Rick Pasotto 302806 by: Ashley Sheridan 302811 by: Rick Pasotto 302814 by: Ashley Sheridan Re: CodeBubbles -- the coolest IDE innovation since since syntax highlighting and intellisense 302807 by: Nathan Rixham Using FreeType2 without having to suffer GD 302808 by: PmI Change displayed file name to download 302810 by: Php Developer 302812 by: Kim Madsen 302813 by: Peter Lind Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Sun, 2010-03-14 at 12:14 +0100, Rene Veerman wrote: On Sun, Mar 14, 2010 at 11:16 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: That function won't always work. You're using a PHP version check for mysql_real_escape_string() when the most likely failure point for it is if no database connection has been opened. I never call it without an open db connection.. Also, you shouldn't strip the tags from a string that's being inserted into the database. strip_tags() is for the display of data on a web page. It's best practice not to alter the actual data you've stored but to convert it once it's displayed. Don't forget that the browser display may not be the only use for that data. Let's call that a coder's / payer's preference.. If i'd need human text, i'd want to strip it of computer code before it enters the db. Possibly log the attempt to insert code. I have to deal with a lot of CMS's, so I expect the users to enter some HTML code through a rich-text editor, and they expect to be able to. Aside from that, it's good to have a complete copy of the code a user attempted to insert, to see the methodology of an attack should it ever occur. Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- On Sun, Mar 14, 2010 at 12:13 PM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: I have to deal with a lot of CMS's, so I expect the users to enter some HTML code through a rich-text editor, and they expect to be able to. I'd love to have a copy of whatever function you use to filter out bad HTML/js/flash for use cases where users are allowed to enter html. I'm aware of strip_tags() allowed tags param, but haven't got a good list for it. Aside from that, it's good to have a complete copy of the code a user attempted to insert, to see the methodology of an attack should it ever occur. I should've said possibly log mail the details of the attempt, which is what i'd do ;) ---End Message--- ---BeginMessage--- On Sun, Mar 14, 2010 at 12:24 PM, Rene Veerman rene7...@gmail.com wrote: I'd love to have a copy of whatever function you use to filter out bad HTML/js/flash for use cases where users are allowed to enter html. I'm aware of strip_tags() allowed tags param, but haven't got a good list for it. oh, and even img tags can be used for cookie-stuffing on many browsers.. ---End Message--- ---BeginMessage--- On Sun, 2010-03-14 at 12:25 +0100, Rene Veerman wrote: On Sun, Mar 14, 2010 at 12:24 PM, Rene Veerman rene7...@gmail.com wrote: I'd love to have a copy of whatever function you use to filter out bad HTML/js/flash for use cases where users are allowed to enter html. I'm aware of strip_tags() allowed tags param, but haven't got a good list for it. oh, and even img tags can be used for cookie-stuffing on many browsers.. Yes, and you call strip_tags() before the data goes to the browser for display, not before it gets inserted into the database. Essentially, you need to keep as much original information as possible. Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- Op 3/14/10 11:45 AM, Ashley Sheridan schreef: On Sun, 2010-03-14 at 12:25 +0100, Rene Veerman wrote: On Sun, Mar 14, 2010 at 12:24 PM, Rene Veerman rene7...@gmail.com wrote: I'd love to have a copy of whatever function you use to filter out bad HTML/js/flash for use
php-general Digest 13 Mar 2010 23:04:59 -0000 Issue 6637
php-general Digest 13 Mar 2010 23:04:59 - Issue 6637 Topics (messages 302771 through 302787): Re: PHP Sessions 302771 by: Andre Polykanine 302772 by: Ashley Sheridan 302773 by: Andre Polykanine 302774 by: Ashley Sheridan Migration Scheme - from one mysql DB to another mysql DB 302775 by: MEM 302777 by: Per Jessen 302778 by: Teus Benschop 302779 by: Robert Cummings 302783 by: Phpster 302786 by: Rene Veerman Re: PHP in HTML code 302776 by: Jorge Gomes I need a fresh look at storing variables in MySQL 302780 by: tedd 302781 by: paragasu 302782 by: Rene Veerman 302784 by: Phpster 302785 by: Rene Veerman natural text / human text analysis 302787 by: Rene Veerman Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Hello Martine, As you have been already told, the ?=...? is not always supported. However I'd suggest you to do the following (since I love this form of tag): td align=leftlaquo;?=$_SESSION['scripture_text']?raquo;/td Note: I put within the tag only the variable. -- With best regards from Ukraine, Andre Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: m_elensule - Original message - From: Martine Osias webi...@gmail.com To: php-gene...@lists.php.net php-gene...@lists.php.net Date: Saturday, March 13, 2010, 4:33:34 AM Subject: [PHP] Re: PHP Sessions The sessions variables are OK. They don't print when I put them on the HTML page with this code. tr td align=left?=laquo;.$_SESSION['scripture_text'].raquo;?/td /tr tr td style=font-size: smaller; align=right?=$_SESSION['scripture_ref']?/td /tr Thank you. Martine Martine Osias webi...@gmail.com wrote in message news:95.0c.13686.c7cda...@pb1.pair.com... Hi: I need to store variables to send then between pages. I don't need the variables in a database so I try to send them with sessions. The variables don't seem to be there when I try to get them. What could be the problem. Here are the pages where I store and retrieve the variables. Page 1 (variables stored): ?php session_start(); $_SESSION['scripture_text'] = $row_scripture['ScriptureText']; $_SESSION['scripture_ref'] = $row_scripture['ScriptureRef']; ? Page 2 (variables retrieved): ?php session_start(); include(includes/config.php); ? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head /head body table width=100% align=center border=0 tr td align=left?=laquo;.$_SESSION['scripture_text'].raquo;?/td /tr tr td style=font-size: smaller; align=right?=$_SESSION['scripture_ref']?/td /tr /table /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- On Sat, 2010-03-13 at 12:22 +0200, Andre Polykanine wrote: Hello Martine, As you have been already told, the ?=...? is not always supported. However I'd suggest you to do the following (since I love this form of tag): td align=leftlaquo;?=$_SESSION['scripture_text']?raquo;/td Note: I put within the tag only the variable. -- With best regards from Ukraine, Andre Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: m_elensule - Original message - From: Martine Osias webi...@gmail.com To: php-gene...@lists.php.net php-gene...@lists.php.net Date: Saturday, March 13, 2010, 4:33:34 AM Subject: [PHP] Re: PHP Sessions The sessions variables are OK. They don't print when I put them on the HTML page with this code. tr td align=left?=laquo;.$_SESSION['scripture_text'].raquo;?/td /tr tr td style=font-size: smaller; align=right?=$_SESSION['scripture_ref']?/td /tr Thank you. Martine Martine Osias webi...@gmail.com wrote in message news:95.0c.13686.c7cda...@pb1.pair.com... Hi: I need to store variables to send then between pages. I don't need the variables in a database so I try to send them with sessions. The variables don't seem to be there when I try to get them. What could be the problem. Here are the pages where I store and retrieve the variables. Page 1 (variables stored): ?php session_start(); $_SESSION['scripture_text'] = $row_scripture['ScriptureText']; $_SESSION['scripture_ref'] = $row_scripture['ScriptureRef']; ? Page 2 (variables retrieved
php-general Digest 12 Mar 2010 17:52:38 -0000 Issue 6635
php-general Digest 12 Mar 2010 17:52:38 - Issue 6635 Topics (messages 302736 through 302750): Re: PHP MySQL Insert Statements 302736 by: Kevin Kinsey Doing dynamic routing for an office 302737 by: Ian 302738 by: Per Jessen mysqli procedural calls and manual entries ? 302739 by: Per Jessen 302746 by: Daniel Brown 302747 by: Per Jessen how to upload large file ( bigger than 1G) with PHP 302740 by: ¶ÅÔ½ 302741 by: vikash.iitb.gmail.com 302743 by: Rene Veerman 302744 by: Devendra Jadhav 302745 by: Ashley Sheridan headers help 302742 by: MEM 302750 by: Nathan Rixham Re: Object Oriented Programming question 302748 by: Andrew Brookins 302749 by: Ashley Sheridan Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Martine Osias wrote: Hi, My insert statements on this web page don't execute. The select statements do work. This tells me that the database connection is working. The username and password are the administrator's. What else could prevent the insert statements from executing? Thank you. Martine Should be trivial to find out what's happening. Something like: $success=mysql_query($insert_statement) or die(Uh-oh, mysql said:.mysql.error()); HTH, Kevin Kinsey ---End Message--- ---BeginMessage--- Hi, I have had a weird request as a project and that is to build a system where the clients can put down their office plans into a system and based on where you are in the buliding (either via defined kiosks or mobile dropdown filters) it will print out directions on how to get somewhere within that building. Now, to do it from a fixed location is okay - that could just be a manual input for each building, but for the variable start point I have no idea how to do it. To explain in another way: * You enter one of the clients offices - you walk up to the touch screen kiosk and say you are looking to go to Mr Awesomes office. The system then says, okay - head to the elevators on your right, go to the eighth floor, turn right walk to the end of the passage and the office is on your left. This part is easy - the following isnt. * You are new to the company. You are having a smoke break in a smoking room and remember you have a meeting. You logon to a mobile site from your phone (or from your workstation) and you are presented with some filtering options to pin point where you are (since we cant use GPS here), you then again say you need to go to Mr Awesomes offices and the system works out that you need to exit the smoking room left, second passage way right, first left, into the elevators, up 2 floors, right out the elevators and walk to the end of the passage and office is on your left. Any ideas how I could do this easily? The front end isnt a problem, its the processing behind it actually working out the route. Hope my description is clear enough and sorry if this has been discussed before - I have no idea what to search for :) Thanks Ian ---End Message--- ---BeginMessage--- Ian wrote: Hi, I have had a weird request as a project and that is to build a system where the clients can put down their office plans into a system and based on where you are in the buliding (either via defined kiosks or mobile dropdown filters) it will print out directions on how to get somewhere within that building. Now, to do it from a fixed location is okay - that could just be a manual input for each building, but for the variable start point I have no idea how to do it. I don't know exactly where to go and look, but such mapping systems are very common these days (think GPS navigation systems etc), so the algorithms involved must be equally well known and -documented. /Per -- Per Jessen, Zürich (-1.7°C) ---End Message--- ---BeginMessage--- I run a local mirror of the PHP manual, and I most often go straight to the Search for box to look up the format of a function. With the mysqli functions, I've found than many of them simply aren't available that way. E.g. mysqli_connect() - Sorry, but the function mysqli_connect is not in the online manual.. Would it be a lot of effort to create function manual entries for the procedural style of mysqli_*? /Per -- Per Jessen, Zürich (-1.4°C) ---End Message--- ---BeginMessage--- On Fri, Mar 12, 2010 at 02:49, Per Jessen p...@computer.org wrote: I run a local mirror of the PHP manual, and I most often go straight to the Search for box to look up the format of a function. With the mysqli functions, I've found than many of them simply aren't available that way. E.g. mysqli_connect() - Sorry, but the function mysqli_connect
php-general Digest 11 Mar 2010 15:27:47 -0000 Issue 6633
php-general Digest 11 Mar 2010 15:27:47 - Issue 6633 Topics (messages 302688 through 302701): Re: Array Search Not Working? 302688 by: clancy_1.cybec.com.au Re: Array Search Problem 302689 by: Rene Veerman 302696 by: Alice Wei Re: Execution order of PHP 302690 by: Rene Veerman 302698 by: Auke van Slooten Re: php string syntax question with html 302691 by: Rene Veerman 302692 by: Ashley Sheridan 302694 by: Rene Veerman changing values deep in an array by reference, with some index vars in array.. 302693 by: Rene Veerman 302695 by: Rene Veerman Re: Division by 0 302697 by: Jochem Maas 302699 by: Gary 302700 by: Mike Roberts Drawing Images Without Writing To a File 302701 by: Floyd Resler Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Wed, 10 Mar 2010 09:52:30 -0500, aj...@alumni.iu.edu (Alice Wei) wrote: Hi, I have two arrays here that I have combined into a new array, as shown here: $from = explode(-, $from); $change = explode(-,$change); $new_array = array_combine($from,$change); I then tried reading it from a file and do string matches, trying to find out the key using the array_search of the individual array elements. I seem to have no such luck, even when I copied one of the elements after I do a print_r($new_array); Here is the code, foreach ($lines2 as $line_num = $line2) { $style_line_num = $line_num+3; if(preg_match(/^style/,$line2)) { if(preg_match(/inkscape:label/,$lines2[$style_line_num])) { $location = explode(=,$lines2[$style_line_num]); $location2 = substr($patient_location[1],1,-6); if(in_array($location2, $from)) { $key= array_search($location2,$new_array); //Find out the position of the index in the array echo Key . $key . br; //This only gives me a blank space after the word Key } } //end preg_match inkscape } //If preg_match style I looked at the example from http://php.net/manual/en/function.array-search.php, and looks like what I am trying to do here is possible, and yet, why am I not getting a proper key return? Thanks for your help. Alice I have a very handy utility for problems like this: // Expand string array, list all terms function larec($array, $name) // List array recursive { if (is_array($array)) { $j = count ($array); $temp = array_keys($array); $i = 0; while ($i $j) { if(isset($array[$temp[$i]])) { $new_line = $name.['.$temp[$i].']; larec ($array[$temp[$i]], $new_line); } $i++; } } else { echo 'p'.$name.' = '.$array.'/p'; } } If you have some array $foo then larec($foo,'Foo'); will list all the elements of $foo recursively, without any obvious limits. This makes it very easy to see what you have actually got, as opposed to what you thought you would get. The following is an abridged example of the result of listing an array $wkg_sys of mine, using: larec ($wkg_sys,'Sys'); Sys['class'] = W Sys['style']['0']['wkg_style'] = basic_tab Sys['style']['0']['pad'] = Sys['style']['0']['stripe'] = 0 Sys['style']['1']['wkg_style'] = nrml_style Sys['style']['1']['pad'] = 1 Sys['style']['1']['stripe'] = 0 Sys['valid'] = 1 Sys['entries'] = 15 Sys['f_title'] = Developmental Web Page Sys['version'] = IF1.4 Sys['ident'] = 0800 Sys['directory_id'] = Sys['index'] = 2 Sys['date'] = CCY2N Clancy ---End Message--- ---BeginMessage--- (almost) all the tricks are in the comments of the help page for a function, on php.net but all functions accept only a given (and usually documented) set of parameter(type)s, so you'll probably have to prepare the var, or even call the function in a loop, outputting to yet another descriptively named array that'll be used as wanted list later in the code. On Wed, Mar 10, 2010 at 6:57 PM, Alice Wei aj...@alumni.iu.edu wrote: did you read the help for those functions on php.net? Yes, I found a recursive way to find out the index like I wanted, by doing something like $from = explode(-, $from); $state_colors= explode(-, $state_colors); $change = explode(-,$change); $count = count($new_array); $i=0; foreach
php-general Digest 9 Mar 2010 11:10:23 -0000 Issue 6629
php-general Digest 9 Mar 2010 11:10:23 - Issue 6629 Topics (messages 302622 through 302629): Re: Mail Function In PHP 302622 by: james.stojan.gmail.com EHLO error 554: what can it be? 302623 by: Andre Polykanine 302626 by: Kevin Kinsey Re: Anyone good with multiple SSL on Apache? 302624 by: Kim Madsen 302625 by: Daniel Egeberg Re: best way to determine (MIME) content type of a stream ofbytes? 302627 by: Auke van Slooten how to capture INF return from exp() 302628 by: Info 302629 by: Daniel Egeberg Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Any volume of mail sent direct to mx records is a red flag for anti spammers and without an smtp spf dkim and rdns you are wasting your time. The logic is that only people sending spam would be sending direct to mx like that. Fair or not that is just how life works. Oh and most mail servers do check rdns spf etc. It is kind of pointless to send emails if they end up in the spam folder or worse don't get delivered at all. Do it right the first time use an smtp rdns and spf at the very least. Sent via BlackBerry from T-Mobile -Original Message- From: Richard Quadling rquadl...@googlemail.com Date: Mon, 8 Mar 2010 10:21:53 To: Kannankanna...@gmail.com Cc: php-gene...@lists.php.net Subject: Re: [PHP] Mail Function In PHP On 7 March 2010 04:54, Kannan kanna...@gmail.com wrote: Hello I am creating a application for our college using the php.In that i want to send mail to all who are all the list. For that i am just simply use the mail function in php without configuring any mail system in the system.But the mail didn't send. For sending the mails wat are requirements and if u have any tutorials send it to me? Thanks.. -- With regards, Kannan. R. P, Blog @: http://kannan4k.wordpress.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Contrary to popular belief, to send an email you do not need to have your own SMTP server. All you need to know is the SMTP server responsible for your recipients email. This information is held as part of the domain registration details and is known as the MX records (as I understand it). PHP has a function called getmxrr() [1]. This allows you to supply a domain name and get back the list of MX records suitable for handling the SMTP mail. This function wasn't available on Windows until recently, and I created a userland version utilising Windows nslookup.exe program [2]. So, once you've got the list of SMTP servers for the domain you are sending email to, you can use the ini_set('SMTP', 'xx'); function to set the server to handle the mail() call you are about to make. Upside : No local SMTP server - you are not responsible for maintaining/administering/etc. any aspect of the SMTP process. Upside : If the mail() call fails, you can try the other MX records (I tend to sort the results based upon weight and try them in sequence). If it fails all of them, you know straight away and can deal with it. Upside : No relaying. No permission issues to worry about. You are simply talking to the public SMTP servers just like any other SMTP server or sender. Downside : No queuing. Without a_LOCAL_ SMTP server, you can only deal with sending email in real time. Downside : One domain at a time. You cannot send email to a...@domain1.com, b...@domain2.com_and_ c...@domain3.com in the 1 email. None of these steps affect the use of mail() or a mail sending class (phpmailer, RMail, html_mime_mail5, etc.). Regards, Richard. [1] http://docs.php.net/getmxrr [2] http://docs.php.net/getmxrr#53182 Richard. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- Hello everyone, I'm writing a class to send mail via an SMTP server with authorization. Everything seems to work but I get an EHLO error: 554 SMTP synchronization error Where should I look to avoid this? Thanks! -- With best regards from Ukraine, Andre Http://oire.org/ - The Fantasy blogs of Oire Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: http://twitter.com/m_elensule ---End Message--- ---BeginMessage--- Andre
php-general Digest 10 Mar 2010 00:07:44 -0000 Issue 6630
php-general Digest 10 Mar 2010 00:07:44 - Issue 6630 Topics (messages 302630 through 302640): Using ArrayObject 302630 by: Peter van der Does 302631 by: Timo Witte Re: EHLO error 554: what can it be? 302632 by: Kevin Kinsey 302636 by: Adam Richardson 302638 by: Andre Polykanine 302639 by: Bob McConnell Re: pear for fedora 11 302633 by: Edward. S. P. Leong 302635 by: Ashley Sheridan 302637 by: Edward. S. P. Leong Re: Load simulation tests 302634 by: John Black Re: Anyone good with multiple SSL on Apache? 302640 by: Manuel Lemos Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- What is the advantage of using ArrayObject to build a Registry class? -- Peter van der Does GPG key: E77E8E98 IRC: Ganseki on irc.freenode.net Twitter: @petervanderdoes WordPress Plugin Developer Blog: http://blog.avirtualhome.com Forums: http://forums.avirtualhome.com Twitter: @avhsoftware ---End Message--- ---BeginMessage--- you can use ArrayObject functions? an Object is always easier to handle / convert. instead of $serialized = serialize($array); you can do things like $serialized = (string)$arrayObject; and things like that. Peter van der Does wrote: What is the advantage of using ArrayObject to build a Registry class? ---End Message--- ---BeginMessage--- Thilo Klein wrote: Kevin Kinsey schrieb: Andre Polykanine wrote: Hello everyone, I'm writing a class to send mail via an SMTP server with authorization. Everything seems to work but I get an EHLO error: 554 SMTP synchronization error Where should I look to avoid this? Thanks! Be polite :-D Make sure your class waits for the other server's greeting before you send HELO/EHLO. ;-) HTH, Kevin Kinsey He is polite. You are not. I'm afraid that you've misinterpreted at the very least. I'm not accusing him of being impolite, but saying that what is probably happening is that his script is sending HELO/EHLO before the receiving server sends its greeting. Im comparing that to talking when you should be listening, which is impolite in general conversation, at least where I live. If Andre really thought I meant he was impolite, I apologize. I did not. That is, incidentally, the reason there is a smiley there. Also, I have to beg this question: if I am impolite, then why am I the only person who has attempted to answer his question thus far? ;-) KDK ---End Message--- ---BeginMessage--- On Mon, Mar 8, 2010 at 11:46 PM, Kevin Kinsey k...@daleco.biz wrote: Andre Polykanine wrote: Hello everyone, I'm writing a class to send mail via an SMTP server with authorization. Everything seems to work but I get an EHLO error: 554 SMTP synchronization error Where should I look to avoid this? Thanks! Be polite :-D Make sure your class waits for the other server's greeting before you send HELO/EHLO. ;-) HTH, Kevin Kinsey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I learned something and chuckled at the same time. Thanks for the info, Kevin. Adam -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com ---End Message--- ---BeginMessage--- Hello Kevin and all, Sorry Kevin, How do I do that? Excuse me if it's a stupid question...( the only way I know is to set the timeout on the fsockopen function (the fifth parameter). I set it even to 60 but no change... Thanks a lot! -- With best regards from Ukraine, Andre Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: m_elensule - Original message - From: Kevin Kinsey k...@daleco.biz To: Andre Polykanine an...@oire.org Date: Tuesday, March 9, 2010, 6:46:24 AM Subject: [PHP] EHLO error 554: what can it be? Andre Polykanine wrote: Hello everyone, I'm writing a class to send mail via an SMTP server with authorization. Everything seems to work but I get an EHLO error: 554 SMTP synchronization error Where should I look to avoid this? Thanks! Be polite :-D Make sure your class waits for the other server's greeting before you send HELO/EHLO. ;-) HTH, Kevin Kinsey ---End Message--- ---BeginMessage--- After you open the socket, you first need to read from it to receive the welcome message. After you verify the contents of that message, then send the hello and wait for the response from it. Bob McConnell -Original Message- From: Andre Polykanine [mailto:an...@oire.org] Sent: Tuesday, March 09, 2010 10:50 AM To: Kevin Kinsey Cc: Php general list Subject: Re
php-general Digest 8 Mar 2010 10:22:20 -0000 Issue 6627
php-general Digest 8 Mar 2010 10:22:20 - Issue 6627 Topics (messages 302593 through 302597): Re: pear for fedora 11 302593 by: Ashley Sheridan Re: Mail Function In PHP 302594 by: Al 302597 by: Richard Quadling int $number = decode_dtmf(string $wavefile) 302595 by: Thilo Klein 302596 by: muzy Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Mon, 2010-03-08 at 01:07 +0800, Edward. S. P. Leong wrote: Dear All, Which can we download pear ann install into fc 11 system ? Thank for your help ! Edward. I'm not sure I understand your question. Do you mean what Pear components can be installed on a Fedora 11 system? I'm running Fedora 11 on my desktop and laptop at the moment, and both systems are running 5.2.12, so any of the Pear modules that say they will run on that are fine. If you need to check to see what version of PHP is running, in a console or text login, type 'yum list php' and you'll get a line that reads something like: php.i5865.2.12-1.fc11@updates Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- Use the Pear Mail package. In particular the smtp class. It will save you much grief and time. On 3/6/2010 11:54 PM, Kannan wrote: Hello I am creating a application for our college using the php.In that i want to send mail to all who are all the list. For that i am just simply use the mail function in php without configuring any mail system in the system.But the mail didn't send. For sending the mails wat are requirements and if u have any tutorials send it to me? Thanks.. ---End Message--- ---BeginMessage--- On 7 March 2010 04:54, Kannan kanna...@gmail.com wrote: Hello I am creating a application for our college using the php.In that i want to send mail to all who are all the list. For that i am just simply use the mail function in php without configuring any mail system in the system.But the mail didn't send. For sending the mails wat are requirements and if u have any tutorials send it to me? Thanks.. -- With regards, Kannan. R. P, Blog @: http://kannan4k.wordpress.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Contrary to popular belief, to send an email you do not need to have your own SMTP server. All you need to know is the SMTP server responsible for your recipients email. This information is held as part of the domain registration details and is known as the MX records (as I understand it). PHP has a function called getmxrr() [1]. This allows you to supply a domain name and get back the list of MX records suitable for handling the SMTP mail. This function wasn't available on Windows until recently, and I created a userland version utilising Windows nslookup.exe program [2]. So, once you've got the list of SMTP servers for the domain you are sending email to, you can use the ini_set('SMTP', 'xx'); function to set the server to handle the mail() call you are about to make. Upside : No local SMTP server - you are not responsible for maintaining/administering/etc. any aspect of the SMTP process. Upside : If the mail() call fails, you can try the other MX records (I tend to sort the results based upon weight and try them in sequence). If it fails all of them, you know straight away and can deal with it. Upside : No relaying. No permission issues to worry about. You are simply talking to the public SMTP servers just like any other SMTP server or sender. Downside : No queuing. Without a _LOCAL_ SMTP server, you can only deal with sending email in real time. Downside : One domain at a time. You cannot send email to a...@domain1.com, b...@domain2.com _AND_ c...@domain3.com in the 1 email. None of these steps affect the use of mail() or a mail sending class (phpmailer, RMail, html_mime_mail5, etc.). Regards, Richard. [1] http://docs.php.net/getmxrr [2] http://docs.php.net/getmxrr#53182 Richard. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling ---End Message--- ---BeginMessage--- Hello, I want to read a wav-file CCITT u-Law 64 kbit/s, 8Bit, Mono, 8 kHz into PHP which contains a DTMF-Code and I want PHP to output the numbers, so I am looking for a function like int $number = decode_dtmf(string $wavefile); Is such a function available or is someone kind enough to code it under the GPL? Regards Thilo
php-general Digest 8 Mar 2010 22:54:48 -0000 Issue 6628
php-general Digest 8 Mar 2010 22:54:48 - Issue 6628 Topics (messages 302598 through 302621): Re: Mail Function In PHP 302598 by: Teus Benschop 302607 by: Richard Quadling 302608 by: Richard Quadling 302609 by: Ashley Sheridan 302610 by: Marc Trudel 302611 by: Teus Benschop 302616 by: John Black 302617 by: John Black Re: pear for fedora 11 302599 by: Edward. S. P. Leong 302600 by: Ashley Sheridan best way to determine (MIME) content type of a stream of bytes? 302601 by: Robert P. J. Day 302602 by: Ashley Sheridan 302603 by: Robert P. J. Day 302604 by: Ashley Sheridan 302605 by: Robert P. J. Day 302606 by: Ashley Sheridan Load simulation tests 302612 by: Ashley Sheridan 302613 by: Richard 302614 by: shiplu 302615 by: shiplu Anyone good with multiple SSL on Apache? 302618 by: Skip Evans 302619 by: Frank M. Kromann 302620 by: Skip Evans 302621 by: Frank M. Kromann Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Mon, 2010-03-08 at 10:21 +, Richard Quadling wrote: Contrary to popular belief, to send an email you do not need to have your own SMTP server. All you need to know is the SMTP server responsible for your recipients email. [...] While the above is true, there is also another thing that comes into play. We used to send email directly to the receiver the way described above. But at times it happens that the receiving smtp server refuses to accept mail from the sender since the sender is not known to be a good smtp server, and at times it could get blacklisted. Rules like this get tightened up because of the desire to curb spam at the source. Teus. ---End Message--- ---BeginMessage--- On 8 March 2010 13:06, Teus Benschop teusjanne...@gmail.com wrote: On Mon, 2010-03-08 at 10:21 +, Richard Quadling wrote: Contrary to popular belief, to send an email you do not need to have your own SMTP server. All you need to know is the SMTP server responsible for your recipients email. [...] While the above is true, there is also another thing that comes into play. We used to send email directly to the receiver the way described above. But at times it happens that the receiving smtp server refuses to accept mail from the sender since the sender is not known to be a good smtp server, and at times it could get blacklisted. Rules like this get tightened up because of the desire to curb spam at the source. Teus. Black listing can happen even for valid domains. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling ---End Message--- ---BeginMessage--- On 8 March 2010 13:06, Teus Benschop teusjanne...@gmail.com wrote: On Mon, 2010-03-08 at 10:21 +, Richard Quadling wrote: Contrary to popular belief, to send an email you do not need to have your own SMTP server. All you need to know is the SMTP server responsible for your recipients email. [...] While the above is true, there is also another thing that comes into play. We used to send email directly to the receiver the way described above. But at times it happens that the receiving smtp server refuses to accept mail from the sender since the sender is not known to be a good smtp server, and at times it could get blacklisted. Rules like this get tightened up because of the desire to curb spam at the source. Teus. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php So, say I did go and setup a local SMTP relay, how would I make it known that it was a real smtp server and not just some script pushing spam? -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling ---End Message--- ---BeginMessage--- On Mon, 2010-03-08 at 17:18 +, Richard Quadling wrote: On 8 March 2010 13:06, Teus Benschop teusjanne...@gmail.com wrote: On Mon, 2010-03-08 at 10:21 +, Richard Quadling wrote: Contrary to popular belief, to send an email you do not need to have your own SMTP server. All you need to know is the SMTP server responsible for your recipients email
php-general Digest 7 Mar 2010 17:07:24 -0000 Issue 6626
php-general Digest 7 Mar 2010 17:07:24 - Issue 6626 Topics (messages 302590 through 302592): Re: Mail Function In PHP 302590 by: Kevin Kinsey Re: Parse a string containing name and email 302591 by: Kevin Kinsey pear for fedora 11 302592 by: Edward. S. P. Leong Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Kannan wrote: Hello I am creating a application for our college using the php.In that i want to send mail to all who are all the list. For that i am just simply use the mail function in php without configuring any mail system in the system.But the mail didn't send. For sending the mails wat are requirements and if u have any tutorials send it to me? Thanks.. Hello, Read the manual page for the mail() function ... http://www.php.net/mail Mail() requires an operating SMTP server. This can be set in php.ini, and possibly via the ini_set() function. These might be worth looking into: $config1=ini_set(sendmail_path,/usr/sbin/sendmail -t -i); $config2=ini_set(SMTP,localhost); $config3=ini_set(smtp_port,25); If you absolutely can't run an SMTP server or use a remote server, you'd probably have to hack something together with sockets or streams. My $0.02, Kevin Kinsey ---End Message--- ---BeginMessage--- Don wrote: Hi, I am pulling email values out of a database and the format is as follows: John Smithjohn.sm...@somedomain.com I need to parse the string into two variables as such $name = John Smith $email = john.sm...@somedomain.com What would be the easiest way to do this? Thanks. [36] Sun 07.Mar.2010 0:27:35 [kad...@archangel][~/scripts] cat split ?php $data=John Smithj...@foo.com; list($name,$email)=explode(,str_replace(,,$data)); echo $name's email address is $email; ? [37] Sun 07.Mar.2010 0:27:40 [kad...@archangel][~/scripts] php split John Smith's email address is j...@foo.com Throw in a foreach() and some data writes or w/e, and you're done. Kevin Kinsey ---End Message--- ---BeginMessage--- Dear All, Which can we download pear ann install into fc 11 system ? Thank for your help ! Edward. ---End Message---
php-general Digest 6 Mar 2010 16:57:20 -0000 Issue 6624
php-general Digest 6 Mar 2010 16:57:20 - Issue 6624 Topics (messages 302578 through 302579): Re: PEAR clases don't work with PHP 5.3 302578 by: Lester Caine XML functions 302579 by: Ahmad F AlTwaijiry Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Michael A. Peters wrote: Martín Marqués wrote: A few days ago I upgraded my development server with PHP 5.3, and found that some pear packages stopped working giving FATAL ERRORs, like this (this one is from package Image_Graph): PHP Fatal error: Call to undefined method Image_Graph_Plotarea_Element::Image_Graph_Element() in /usr/share/php/Image/Graph/Layout.php on line 73 I found that the problem is when calling the parents constructors like parent::ClassName. Changing that fixes the problem, but there are alot of clases with this problem. Are these problems being addressed? I found similar problems with some of the pear stuff I use when I tried 5.3.0 awhile back. For the present, I am just sticking with 5.2.x branch and will give some time for the various pear maintainers to work out the kinks. One thing you can do is file bug reports with the pear components you use. I did not because I moved my test server back to 5.2.x thus I would have no way of testing whether the fixes actually worked, but if you have a box you can dedicate to 5.3.x testing, file the bug reports and it will bring the problem to the attention of the pear maintainers. Some pear packages are better maintained than others. It is not just PEAR that needs a lot of work to make it compatible with PHP5.3 ! pecl needs some TLC as well, along with a large number of projects providing third party add-ons, or using PHP. We need to keep 5.2.x supported as a switch to PHP5.3 IS NOT a simple option, and will take a lot longer before it is a practical one for many users. -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php ---End Message--- ---BeginMessage--- Dears When i checked the php manual i found many Solutions to read/write xml files and im confused now :) Which function/library is better and is there any new article that compare each function/library? Thanks Ahmad AlTwaijiry http://www.AlTwaijiry.com ---End Message---
php-general Digest 7 Mar 2010 05:03:44 -0000 Issue 6625
php-general Digest 7 Mar 2010 05:03:44 - Issue 6625 Topics (messages 302580 through 302589): Re: XML functions 302580 by: Andre Polykanine 302581 by: Ashley Sheridan 302582 by: Michael A. Peters 302583 by: Michael A. Peters int $number = decode_dtmf(string wavefile) 302584 by: Thilo Klein int $number = decode_dtmf(string $wavefile) 302585 by: Thilo Klein Parse a string containing name and email 302586 by: Don 302587 by: Manuel Lemos Mail Function In PHP 302588 by: Kannan 302589 by: Devendra Jadhav Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Hello Ahmad and all, I will expand a little bit your question joining to it: what is the better technique to make an RSS feed on the website? The website is manually written, no CMS. -- With best regards from Ukraine, Andre Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: m_elensule - Original message - From: Ahmad F AlTwaijiry ah...@altwaijiry.com To: php-gene...@lists.php.net php-gene...@lists.php.net Date: Saturday, March 6, 2010, 7:00:04 PM Subject: [PHP] XML functions Dears When i checked the php manual i found many Solutions to read/write xml files and im confused now :) Which function/library is better and is there any new article that compare each function/library? Thanks Ahmad AlTwaijiry http://www.AlTwaijiry.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- On Sat, 2010-03-06 at 21:50 +0200, Andre Polykanine wrote: Hello Ahmad and all, I will expand a little bit your question joining to it: what is the better technique to make an RSS feed on the website? The website is manually written, no CMS. -- With best regards from Ukraine, Andre Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: m_elensule - Original message - From: Ahmad F AlTwaijiry ah...@altwaijiry.com To: php-gene...@lists.php.net php-gene...@lists.php.net Date: Saturday, March 6, 2010, 7:00:04 PM Subject: [PHP] XML functions Dears When i checked the php manual i found many Solutions to read/write xml files and im confused now :) Which function/library is better and is there any new article that compare each function/library? Thanks Ahmad AlTwaijiry http://www.AlTwaijiry.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php That's a very different question, and ought to be in a new thread. Please don't hijack threads like this. Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- Ahmad F AlTwaijiry wrote: Dears When i checked the php manual i found many Solutions to read/write xml files and im confused now :) Which function/library is better and is there any new article that compare each function/library? I use DOMDocument. It works best if the input file you are reading is UTF-8. It has some issues I haven't yet figured out related to namespaces, sometimes when loading perfectly valid XML that uses namespaces for import into another document, I lose the namespace and get default prepended to the node name. I do not understand why it feels it needs to do this, but it apparently does in some cases. For those cases, I currently use hackish workarounds where I remove the namespace with a preg_replace before import into the DOM and then add the namespace again using the DOM tools after it has been imported. Where I have run into this problem is MathML and SVG within XHTML when I cache the MathML/SVG as a string in APC for import into documents. It is not so much an issue with SVG in XHTML as SVG probably is best done as an object rather than directly embedded (but when generating SVG via DOMDocument I have a similar problem if I am using xlink namespace) but it is a problem with MathML which is usually done inline. It could just be that I'm doing things wrong, but the documentation isn't exactly full of working example code. So anyway, if you use namespaces, you may run into a few frustrating kinks, but DOMDocument is what I use, and it is very convenient because it is very similar to the JavaScript DOM2 methods (I believe intentionally). ---End Message--- ---BeginMessage--- Andre Polykanine wrote: Hello Ahmad and all, I will expand a little bit your question joining to it: what
php-general Digest 5 Mar 2010 12:03:36 -0000 Issue 6622
php-general Digest 5 Mar 2010 12:03:36 - Issue 6622 Topics (messages 302548 through 302555): Re: Want to learn to work with Zend Framework? 302548 by: Jochen Schultz 302549 by: Ashley Sheridan 302551 by: Jochen Schultz 302552 by: Lester Caine 302553 by: Jochen Schultz 302554 by: Ashley Sheridan 302555 by: dsiembab01.gmail.com Re: Delayed page display 302550 by: Ford, Mike Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Spam! Daniel Brown schrieb: On Thu, Mar 4, 2010 at 14:59, mrfroasty mrfroa...@gmail.com wrote: Looks expensive, definately NO Then do not reply. It was an offer to the community at large, not just you and the other top-poster. ;-P -- Sport Import GmbH - Amtsgericht Oldenburg - Tel: +49-4405-9280-63 Industriestrasse 39 - HRB 1202900- 26188 Edewecht - GF: Michael Müllmann ---End Message--- ---BeginMessage--- On Fri, 2010-03-05 at 08:11 +0100, Jochen Schultz wrote: Spam! Daniel Brown schrieb: On Thu, Mar 4, 2010 at 14:59, mrfroasty mrfroa...@gmail.com wrote: Looks expensive, definately NO Then do not reply. It was an offer to the community at large, not just you and the other top-poster. ;-P -- Sport Import GmbH - Amtsgericht Oldenburg - Tel: +49-4405-9280-63 Industriestrasse 39 - HRB 1202900- 26188 Edewecht - GF: Michael Müllmann If it's spam, it's the first I've seen that actually has something to do with PHP and not drugs, money or sex! Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- and not drugs, money or sex! So everyone should post their ads here, which are related to PHP? I think not. regards Jochen Ashley Sheridan schrieb: On Fri, 2010-03-05 at 08:11 +0100, Jochen Schultz wrote: Spam! Daniel Brown schrieb: On Thu, Mar 4, 2010 at 14:59, mrfroasty mrfroa...@gmail.com mailto:mrfroa...@gmail.com wrote: Looks expensive, definately NO Then do not reply. It was an offer to the community at large, not just you and the other top-poster. ;-P -- Sport Import GmbH - Amtsgericht Oldenburg - Tel: +49-4405-9280-63 Industriestrasse 39 - HRB 1202900- 26188 Edewecht - GF: Michael Müllmann If it's spam, it's the first I've seen that actually has something to do with PHP and not drugs, money or sex! Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- Jochen Schultz wrote: and not drugs, money or sex! So everyone should post their ads here, which are related to PHP? I think not. As someone who gets totally pigged off with the amount of 'advertising' that gets rammed down our throats, I should probably agree. But in this particular case, while I may not like it, Zend are one of the major supporters of PHP and actually need to make money to continue that support. Now if someone wants to advertise alternative courses using Eclipse and PHPEclipse ... 1000EUR does seem somewhat steep ;) -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php ---End Message--- ---BeginMessage--- Sure Zend is one of the most valuables, if not the most valuable, companies in the PHP community. But if we allow ads here, we should think about selling them (like footer ads in all messages of the list). This way the community gets income, which can be used to support the community, while the community stays free from some companies decissions. Or just keep Ads out of here...no exceptions! just my 2 cents Lester Caine schrieb: Jochen Schultz wrote: and not drugs, money or sex! So everyone should post their ads here, which are related to PHP? I think not. As someone who gets totally pigged off with the amount of 'advertising' that gets rammed down our throats, I should probably agree. But in this particular case, while I may not like it, Zend are one of the major supporters of PHP and actually need to make money to continue that support. Now if someone wants to advertise alternative courses using Eclipse and PHPEclipse ... 1000EUR does seem somewhat steep ;) -- Sport Import GmbH - Amtsgericht Oldenburg - Tel: +49-4405-9280-63 Industriestrasse 39 - HRB 1202900- 26188 Edewecht - GF: Michael Müllmann ---End Message--- ---BeginMessage--- On Fri, 2010-03-05 at 11:21 +0100, Jochen Schultz wrote: Sure Zend is one of the most
php-general Digest 6 Mar 2010 00:14:15 -0000 Issue 6623
php-general Digest 6 Mar 2010 00:14:15 - Issue 6623 Topics (messages 302556 through 302577): Re: Want to learn to work with Zend Framework? 302556 by: Richard Quadling 302557 by: Ashley Sheridan 302558 by: Jochem Maas 302559 by: Daniel Brown 302560 by: Ashley Sheridan 302561 by: Daniel Brown 302562 by: tedd 302563 by: Daniel Brown 302564 by: Ashley Sheridan 302565 by: Richard Quadling 302566 by: Ashley Sheridan 302567 by: Daniel Brown 302568 by: Ashley Sheridan 302573 by: Bastien Koert PEAR clases don't work with PHP 5.3 302569 by: MartÃn Marqués 302577 by: Michael A. Peters Microsoft outlook takes out all stressed letters on subject. 302570 by: João Cândido de Souza Neto 302571 by: Bob McConnell 302572 by: João Cândido de Souza Neto Re: Best Practices Book, Document, Web Site? 302574 by: J Ravi Menon sell with php 302575 by: gato chlr 302576 by: Rene Veerman Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On 5 March 2010 10:26, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Fri, 2010-03-05 at 11:21 +0100, Jochen Schultz wrote: Sure Zend is one of the most valuables, if not the most valuable, companies in the PHP community. But if we allow ads here, we should think about selling them (like footer ads in all messages of the list). This way the community gets income, which can be used to support the community, while the community stays free from some companies decissions. Or just keep Ads out of here...no exceptions! just my 2 cents Lester Caine schrieb: Jochen Schultz wrote: and not drugs, money or sex! So everyone should post their ads here, which are related to PHP? I think not. As someone who gets totally pigged off with the amount of 'advertising' that gets rammed down our throats, I should probably agree. But in this particular case, while I may not like it, Zend are one of the major supporters of PHP and actually need to make money to continue that support. Now if someone wants to advertise alternative courses using Eclipse and PHPEclipse ... 1000EUR does seem somewhat steep ;) -- Sport Import GmbH - Amtsgericht Oldenburg - Tel: +49-4405-9280-63 Industriestrasse 39 - HRB 1202900 - 26188 Edewecht - GF: Michael Müllmann Actually, footer ads doesn't seem such a bad idea. I don't know how you'd work out the details like how often an ad is shown, but I for one wouldn't mind a discrete ad at the bottom of the email if the proceeds would go back into making PHP better. I would assume though that most people on this list wouldn't like that, as it would possibly make it too commercially driven, i.e. think people posting more and more simple to get their ad more coverage, etc. Thanks, Ash http://www.ashleysheridan.co.uk Ad-block would get in the way though !? -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling ---End Message--- ---BeginMessage--- On Fri, 2010-03-05 at 12:03 +, Richard Quadling wrote: On 5 March 2010 10:26, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Fri, 2010-03-05 at 11:21 +0100, Jochen Schultz wrote: Sure Zend is one of the most valuables, if not the most valuable, companies in the PHP community. But if we allow ads here, we should think about selling them (like footer ads in all messages of the list). This way the community gets income, which can be used to support the community, while the community stays free from some companies decissions. Or just keep Ads out of here...no exceptions! just my 2 cents Lester Caine schrieb: Jochen Schultz wrote: and not drugs, money or sex! So everyone should post their ads here, which are related to PHP? I think not. As someone who gets totally pigged off with the amount of 'advertising' that gets rammed down our throats, I should probably agree. But in this particular case, while I may not like it, Zend are one of the major supporters of PHP and actually need to make money to continue that support. Now if someone wants to advertise alternative courses using Eclipse and PHPEclipse ... 1000EUR does seem somewhat steep ;) -- Sport Import GmbH - Amtsgericht Oldenburg - Tel: +49-4405-9280-63
php-general Digest 4 Mar 2010 11:34:02 -0000 Issue 6620
php-general Digest 4 Mar 2010 11:34:02 - Issue 6620 Topics (messages 302515 through 302532): Re: Memory investigation 302515 by: dsiembab01.gmail.com 302516 by: larry.garfieldtech.com 302522 by: Rene Veerman 302525 by: dsiembab01.gmail.com 302526 by: larry.garfieldtech.com Re: Database design 302517 by: dsiembab01.gmail.com basic authentication and redirection 302518 by: Bill Rausch 302521 by: Rene Veerman 302523 by: Jay Blanchard 302524 by: Robert Cummings Best os shopping cart 302519 by: Haig Davis 302520 by: Robert Cummings 302527 by: Ashley Sheridan 302528 by: tedd 302529 by: Shawn McKenzie Re: inexplicable behaviour of pre- and post-increment operators 302530 by: clancy_1.cybec.com.au XMLRPC issue 302531 by: Dmitry Ruban Re: App to put a whole PHP Site in CD/DVD 302532 by: David Robley Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- function check_memory_usage($memory) { $memory[] = memory_get_usage(); return $memory; } something like this? you can put it wherever you like and returns an array for further processing. You could optionally add a second argument to set the index to a name and check if the name exists to add 1 to the end of the name so your indexes stay maintained. ---End Message--- ---BeginMessage--- That's not really what I'm after. Let me try an example: function foo($id) { static $foos = array(); if (empty($foos[$id]) { $foos[$id] = load_foo($id); } return $foos[$id]; } When load_foo() is slow (e.g., lots of DB traffic or remote-server calls or whatever), such caching can have a significant performance boost. Sometime after foo() has been called 15 times from 30 places in code, when I get to the end of the request (or just every time I call foo() would be fine) I want to be able to do something like: $cost = get_memory_used_by($foos); So that I can determine how much memory that caching is costing me over the lifetime of the page, and determine if it's a worthwhile trade-off. --Larry Garfield dsiemba...@gmail.com wrote: function check_memory_usage($memory) { $memory[] = memory_get_usage(); return $memory; } something like this? you can put it wherever you like and returns an array for further processing. You could optionally add a second argument to set the index to a name and check if the name exists to add 1 to the end of the name so your indexes stay maintained. ---End Message--- ---BeginMessage--- global $fooSize = 0; function foo($id) { global $fooSize; if (empty($foos($id)) { $b = get_memory_usage(true); $foos[$id] = load_foo($id); $fooSize+= $b - get_memory_usage(true); } ... } On Wed, Mar 3, 2010 at 8:16 PM, la...@garfieldtech.com la...@garfieldtech.com wrote: That's not really what I'm after. Let me try an example: function foo($id) { static $foos = array(); if (empty($foos[$id]) { $foos[$id] = load_foo($id); } return $foos[$id]; } When load_foo() is slow (e.g., lots of DB traffic or remote-server calls or whatever), such caching can have a significant performance boost. Sometime after foo() has been called 15 times from 30 places in code, when I get to the end of the request (or just every time I call foo() would be fine) I want to be able to do something like: $cost = get_memory_used_by($foos); So that I can determine how much memory that caching is costing me over the lifetime of the page, and determine if it's a worthwhile trade-off. --Larry Garfield dsiemba...@gmail.com wrote: function check_memory_usage($memory) { $memory[] = memory_get_usage(); return $memory; } something like this? you can put it wherever you like and returns an array for further processing. You could optionally add a second argument to set the index to a name and check if the name exists to add 1 to the end of the name so your indexes stay maintained. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- couple questions Larry is this application composed of classes or straight up no holes barred procedural code? la...@garfieldtech.com wrote: That's not really what I'm after. Let me try an example: function foo($id) { static $foos = array(); if (empty($foos[$id]) { $foos[$id] = load_foo($id); } return $foos[$id]; } When load_foo() is slow (e.g., lots of DB traffic or remote-server calls or whatever), such caching can have a significant performance boost. Sometime after foo() has been called 15 times from 30 places
php-general Digest 5 Mar 2010 00:00:21 -0000 Issue 6621
php-general Digest 5 Mar 2010 00:00:21 - Issue 6621 Topics (messages 302533 through 302547): Re: App to put a whole PHP Site in CD/DVD 302533 by: Juan Re: Memory investigation 302534 by: dsiembab01.gmail.com Delayed page display 302535 by: robert.visualize.info 302547 by: robert.visualize.info Entry-Level Slot Available in Denver 302536 by: Nathan Nobbe Replacing accented characters 302537 by: Skip Evans 302538 by: Ashley Sheridan 302539 by: Daniel Brown xoops 302540 by: Ryan Cunningham 302546 by: Bastien Koert Want to learn to work with Zend Framework? 302541 by: Debbie Otterstetter 302543 by: dsiembab01.gmail.com 302544 by: mrfroasty 302545 by: Daniel Brown PHP 5.3.2 released! 302542 by: Johannes Schlüter Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- 2010/3/2 Sion Duncan casti...@aurorais.co.uk: The way I've done this in the past it with XAMPP and a simple autorun.inf file. Code the autorun.inf file to start Apache and MySQL, then launch the users web browser (I used IE for this, as i knew everyone would have it installed). The only problem, is that this method only works on windows systems. That's great. This is what I've been looking form. Thanks!. Juan ---End Message--- ---BeginMessage--- you could read this http://xdebug.org/docs/execution_trace and then parse trace files to get the memory usage create a global to store user functions, I think user function do not populate get_defined_functions(); until the function is called; $t = get_defined_functions(); $userFunctions = $t['user']; $file = xdebug_get_tracefile_name(); parse the file and then create a function to call the said variable. I think you can figure it out. la...@garfieldtech.com wrote: Currently it's mostly procedural with some components that are OO. I suspect most of the memory sinks are large arrays (we have a lot of them), but I am not certain of that. Hence my interest in more accurate investigation tools. --Larry Garfield dsiemba...@gmail.com wrote: couple questions Larry is this application composed of classes or straight up no holes barred procedural code? la...@garfieldtech.com wrote: That's not really what I'm after. Let me try an example: function foo($id) { static $foos = array(); if (empty($foos[$id]) { $foos[$id] = load_foo($id); } return $foos[$id]; } When load_foo() is slow (e.g., lots of DB traffic or remote-server calls or whatever), such caching can have a significant performance boost. Sometime after foo() has been called 15 times from 30 places in code, when I get to the end of the request (or just every time I call foo() would be fine) I want to be able to do something like: $cost = get_memory_used_by($foos); So that I can determine how much memory that caching is costing me over the lifetime of the page, and determine if it's a worthwhile trade-off. --Larry Garfield dsiemba...@gmail.com wrote: function check_memory_usage($memory) { $memory[] = memory_get_usage(); return $memory; } something like this? you can put it wherever you like and returns an array for further processing. You could optionally add a second argument to set the index to a name and check if the name exists to add 1 to the end of the name so your indexes stay maintained. ---End Message--- ---BeginMessage--- I have a script that retrieves several queued email messages from a MySQL database and sends them out, printing out progress as it goes along; for example: ema...@example.com ... sent ema...@example.com ... sent ema...@example.com ... sent Either sent or failed is displayed based on the result of the mail() call. When accessing the script however, the browser(?) waits until the script has completely processed prior to displaying the page (instead of displaying it in progress). Other scripts on the same system display in progress, and it's unclear what's different/special about this one. The page header contains several hundred characters, and line breaks are included after each sent, so I don't think it's a browser buffering issue. The behavior is the same in both Firefox IE. The engine is PHP 5.2 under Apache. And none of the ob_ functions are being used. I did try adding a flush(), but the behavior is still the same. So what else could cause the page to buffer completely prior to being displayed? Any insights appreciated, Robert ---End Message--- ---BeginMessage--- Additional info: php.ini has output_buffering=4096. Calling flush() or ob_implicit_flush() within the script doesn't seem to help
php-general Digest 3 Mar 2010 17:54:26 -0000 Issue 6619
php-general Digest 3 Mar 2010 17:54:26 - Issue 6619 Topics (messages 302495 through 302514): Re: When to use namespaces 302495 by: Adam Richardson Re: inexplicable behaviour of pre- and post-increment operators 302496 by: Adam Richardson 302511 by: haliphax Re: Wondering if anyone has experince with lastRSS 302497 by: Rene Veerman Re: session.entropy_file and hostname 302498 by: Sascha Wojewsky 302502 by: Daniel Egeberg Memory investigation 302499 by: Larry Garfield 302504 by: user.domain.invalid 302513 by: Larry Garfield 302514 by: David Otton svg 2 gif/png 302500 by: Michael A. Peters 302501 by: Michael A. Peters 302503 by: Michael A. Peters 302505 by: Michael A. Peters Help with exec. 302506 by: Paul Halliday 302507 by: Richard Quadling 302508 by: Teus Benschop 302509 by: Paul Halliday 302510 by: Ian 302512 by: Paul Halliday Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Thanks, Richard, I wasn't aware of that function. Another nice option. On Tue, Mar 2, 2010 at 6:18 AM, Richard Quadling rquadl...@googlemail.comwrote: On 1 March 2010 19:34, Adam Richardson simples...@gmail.com wrote: I use namespaces within my web framework because the framework takes a more functional approach (no objects are created within the framework other than from existing classes such as PDO or Exception, immutability is promoted, etc.), and in this context, the namespaces felt quite natural for breaking up the various groupings of functions. My framework does require PHP 5.3, and, honestly that has caused some pain in some situations to get that supported. However, using namespaces does offer some flexibility that naming conventions can't. If the objects in your framework make use of frequent static method calls, maybe it's worth it. For instance, if you've used the naming convention, you might have to call a static method like below: App_Util_DB_Query::Insert(); Namespaces allow you to shorten subsequent calls, such as: use App\Util\DB\Query as Query; Query::Insert(); Just a quick couple thoughts on the decision. Both have their strengths :) Adam On Mon, Mar 1, 2010 at 11:14 AM, Auke van Slooten a...@muze.nl wrote: Hi everyone, I'm doing a small hobby project to better my understanding of php5, specifically php5.3 and I'm wondering when a namespaced project is better and when it is better to simply use a prefix to all class names. I've been trying to get a feeling for what is considered the best practice, but most of the pages dealing with namespaces start with the assumption that you are building a complex application with lots of modules and say things like: Namespaces should be all lowercase and must follow the following conention: vendor\package_name\ (thats from the php.standards mailing list btw) In my case the project is a single module, single php file, with about 6 classes. It is an OO wrapper for PHP's xmlrpc methods (client and server) and meant to be used in a number of different projects. Is it considered a good idea to use a namespace in such a case? And if so, what should that be? I've named the project 'ripcord', and used that as a namespace as well. I could probably name it 'muze.ripcord', but somehow that feels less 'open' to me. Thanks in advance for any thoughts, Auke van Slooten Muze (www.muze.nl) PS. The project is at http://code.google.com/p/ripcord/, the PHP5.3 version is at http://code.google.com/p/ripcord/source/browse/#svn/branches/php5.3 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com Something I came across which has been useful in removing the long names (php5.3 namespaces), is the use of class_alias(). My specific use is in DocBlocks for SOAP services. Using the Zend AutoLoader, my classes are structured so that Namespace_Package_Class_Exception is available in \includes\Namespace\Package\Class\Exception.php But having those long names in the SOAP WSDL file were a bit cumbersome. So by having a class_alias in the important class files (just after the class definition), I could use the alias names in the docblock and all is well. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com
php-general Digest 3 Mar 2010 04:54:39 -0000 Issue 6618
php-general Digest 3 Mar 2010 04:54:39 - Issue 6618 Topics (messages 302472 through 302494): Re: Error Message - Need help troubleshooting 302472 by: Rick Dwyer 302473 by: Rene Veerman 302474 by: Ashley Sheridan 302476 by: Rick Dwyer 302478 by: Ashley Sheridan 302479 by: Joseph Thayne 302480 by: Rick Dwyer 302481 by: Rick Dwyer Re: App to put a whole PHP Site in CD/DVD 302475 by: Bastien Koert 302488 by: Sion Duncan 302491 by: Daevid Vincent 302493 by: David Murphy Re: Best Practices Book, Document, Web Site? 302477 by: Paul M Foster 302482 by: Bob McConnell 302486 by: Hansen, Mike 302487 by: Shawn McKenzie gentoo php 302483 by: Kaushal Shriyan 302484 by: Ashley Sheridan 302485 by: Teus Benschop 302489 by: Krzysztof Antczak 302490 by: mrfroasty 302494 by: Kaushal Shriyan Re: Wondering if anyone has experince with lastRSS 302492 by: Watson Blair Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Mar 2, 2010, at 12:31 AM, Rene Veerman wrote: i doubt you passed us the entire .js.php script.. The rest of the JS is as follows: a href='javascript:loadOSS()'img src='/images/myimage.jpg' width='161' height='57' align='right' /Open Window... As far as other PHP goes, the whole page is PHP so I wouldn't know where to even start. My guess was that the problem was originating from the previous code I sent over, but I don't know enough PHP to be sure. does the script itself ever fail, asides from showing this msg? No it works fine. The most annoying thing in making it difficult to to troubleshoot is this message does not always appear. --Rick On Tue, Mar 2, 2010 at 5:46 AM, Rick Dwyer rpdw...@earthlink.net wrote: Hello List. I have some JS code that open a new window with a contact form in it. When the link is clicked to open the new window, I will get the following error SOMETIMES: Warning: Unknown: Your script possibly relies on a session side- effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 My JS code with a bit of PHP in it looks like this: function loadOSS() var oss_itemid = ?php echo $item_id; ?; var loadOSS = window.open(my_url/my_file.php?iid= + oss_itemid, , scrollbars = no ,menubar = no ,height =600,width=600,resizable=yes,toolbar=no,location=no,status=no); } As I said above, the error message does not always appear. Is the error due to the fact I am JS PHP together? Any help in understanding what I am doing wrong is appreciated. --Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- k, add ?php error_reporting(0); ? to your script, to prevent the error from showing. On Tue, Mar 2, 2010 at 2:38 PM, Rick Dwyer rpdw...@earthlink.net wrote: On Mar 2, 2010, at 12:31 AM, Rene Veerman wrote: does the script itself ever fail, asides from showing this msg? No it works fine. The most annoying thing in making it difficult to to troubleshoot is this message does not always appear. ---End Message--- ---BeginMessage--- On Tue, 2010-03-02 at 14:49 +0100, Rene Veerman wrote: k, add ?php error_reporting(0); ? to your script, to prevent the error from showing. On Tue, Mar 2, 2010 at 2:38 PM, Rick Dwyer rpdw...@earthlink.net wrote: On Mar 2, 2010, at 12:31 AM, Rene Veerman wrote: does the script itself ever fail, asides from showing this msg? No it works fine. The most annoying thing in making it difficult to to troubleshoot is this message does not always appear. If there is a genuine problem, that won't actually fix it though. How is $item_id created? You've not shown that in your PHP script examples. Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- On Mar 2, 2010, at 8:48 AM, Ashley Sheridan wrote: How is $item_id created? You've not shown that in your PHP script examples. // parse item id from the url $refer=$_SERVER['HTTP_REFERER']; $thispage=$_SERVER['PHP_SELF']; $item_id=substr($thispage, -9); $item_id=substr($item_id, 0, 5); $_SESSION['item_id'] = $item_id; The above is where item_id is created and added to a session. The important thing is that this error never showed up before until I added
php-general Digest 1 Mar 2010 11:14:25 -0000 Issue 6615
php-general Digest 1 Mar 2010 11:14:25 - Issue 6615 Topics (messages 302430 through 302434): Re: Wondering if anyone has experince with lastRSS 302430 by: Rene Veerman mysqli_connect problem 302431 by: Thomas H. George 302432 by: Rene Veerman Re: Header function 302433 by: Ashley Sheridan 302434 by: Kim Madsen Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- yea, google for lastrss.. or get wild and google for lastrss example or tutorial On Sun, Feb 28, 2010 at 12:05 AM, Watson Blair bestudios...@gmail.com wrote: Hey all, I'm looking at lastRSS as a solution for displaying an Ebay RSS feed on a website, however i'm having a hard time wrapping my head around it, could you guys suggest a good tutorial? also, if there are better solutions for what i'm trying to do, bring it on. Thanks, Watson ---End Message--- ---BeginMessage--- I am a newbie. The following script works but the second one (below) loads the variables from an html form and then fails. The connection command in the second sript are identical as the first script was copied from the first. Only the variable values have been changed. #!/usr/bin/php # ?php $first_name = 'Harry'; $last_name = 'Potter'; $when_it_happened = 'This morning'; $how_long = '6 ms'; $how_many = 'millions'; $alien_description = 'angels'; $what_they_did = 'danced on the head of a pin'; $fang_spotted = 'No'; $other = 'There were bright flashing lights'; $email = 'ha...@aol.com'; $dbc = mysqli_connect('localhost', 'tom', 'fog^horn9', 'aliendatabase') or die('Error connecting to MySQL server'); $query = INSERT INTO aliens_abduction (first_name, last_name, when_it_happened, how_long, . how_many, alien_description, what_they_did, fang_spotted, other, email) . VALUES ('$first_name', '$last_name', '$when_it_happened', '$how_long', '$how_many', . '$alien_description', '$what_they_did', '$fang_spotted', '$other', '$email'); $result = mysqli_query($dbc,$query) or die('Error Querying the database'); mysqli_close($dbc); ? The following program successfully loads the variables from an html form and then fails. ?php $first_name = $_POST['firstname']; $last_name = $_POST['lastname']; $when_it_happened = $_POST['whenithappened']; $how_long =$_POST['howlong']; $how_many = $_POST['howmany']; $alien_description = $_POST['aliendescription']; $what_they_did = $_POST['whattheydid']; $fang_spotted = $_POST['fangspotted']; $other = $_POST['other']; $email = $_POST['email']; echo 'got to here, '; echo $last_name\n\n; $dbc = mysqli_connect('localhost', 'tom', 'fog^horn9', 'aliendatabase') or die('Error connecting to MySQL server'); $query = INSERT INTO aliens_abduction (first_name, last_name, when_it_happened, how_long, . how_many, alien_description, what_they_did, fang_spotted, other, email) . VALUES ('$first_name', '$last_name', '$when_it_happened', '$how_long', '$how_many', . '$alien_description', '$what_they_did', '$fang_spotted', '$other', '$email'); $result = mysqli_query($dbc,$query) or die('Error Querying the database'); mysqli_close($dbc); ? The echo entries confirm the variables a have been loaded from an html form. The program just stops after the echo entries - no die message, nothing in /var/log/mysql.err or mysql.log. I believe the problem is a permissions problem. I had to make the first script executable so of course I also made the second executable but this did not help. My system is Debian Squeeze, 64 bit. I found I had to install php5-mysql to use the mysqli_connect command. Tom ---End Message--- ---BeginMessage--- ok, couple of things; - if you're using user input in SQL queries, you have to push 'm through a function that sanitizes the input against sql-insertions. For now, let that be function antiSQLinsertion ($var) { return mysql_real_escape($var); }; - if you're going to output values from the DB into HTML that have been put there by the user, you have to also guard against HTML-level insertions (malicious html/js/flash to name a few). however, this is not easy, and i havent found a good way of doing this, save stripping all js,iframe,img and flash.. :( - you may want to add adodb.sf.net as a database abstraction layer. it will help if you ever want to switch mysql to another rdbms
php-general Digest 1 Mar 2010 23:21:09 -0000 Issue 6616
php-general Digest 1 Mar 2010 23:21:09 - Issue 6616 Topics (messages 302435 through 302461): Re: inexplicable behaviour of pre- and post-increment operators 302435 by: Martin Zvarík Re: Header function 302436 by: Ashley Sheridan Re: Uninstalling PHP? 302437 by: Jochem Maas Re: Excel Spreadsheets and PHP 302438 by: Andrew Ballard Generating end user documentation for SOAP services. 302439 by: Richard Quadling Custom php extension 302440 by: liveq 302441 by: liveq When to use namespaces 302442 by: Auke van Slooten 302443 by: Ashley Sheridan 302445 by: Richard Quadling 302455 by: tedd 302456 by: Adam Richardson how to download files require login 302444 by: Ryan Sun 302447 by: Ashley Sheridan 302448 by: Richard Quadling session.entropy_file and hostname 302446 by: Sascha Wojewsky Going from IIS6 to WAMP 302449 by: David Stoltz 302450 by: Robert Cummings 302451 by: David Stoltz 302452 by: Ashley Sheridan 302453 by: Jim Lucas mysqli_connect problem 302454 by: Thomas H. George 302457 by: John Black Best Practices Book, Document, Web Site? 302458 by: Hansen, Mike 302459 by: Shawn McKenzie Is there a way to get PHP to release this file? 302460 by: Andrew Ballard 302461 by: Shawn McKenzie Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Mess Dne 27.2.2010 5:01, clanc...@cybec.com.au napsal(a): A week ago Dasn asked a question about converting arrays, and I quoted one possible way of achieving his task, using the operation: $i = 0; while ($i $k) { $b[$a[$i++]] = $a[$i++]; } I added the comment that I have always been wary of using statements like this because I was unsure when the incrementing would occur, so I tried it. I received several CC e-mails replying to this post, including one rather critical comment to the effect that pre-and post-increment were all quite simple, and I really ought to learn the fundamentals before I started trying to do anything elaborate. I posted a reply to these e-mails, but as neither they, nor my reply, or any follow-up discussion ever appeared in the discussion group I will repost this reply. (I did have a power failure at this time, so it is conceivable that any follow-up was lost as a result of a glitch in my mailer, but I think it is more likely that there was a glitch in the discussion group server.) Unfortunately things aren't nearly as simple as this writer believes. The rule I have always used is that if you use the same variable as an index on both sides of an assign statement it is not safe to change the value of the index within the statement. While I have achieved the result I wanted in the example above (using PHP 5.1.6 -- there is no guarantee it would work with other implementations of PHP) the results of doing this in the general case can be quite inexplicable. The particular case which prompted my comment was the one where you want to copy part of one array into the corresponding elements of another array. In accordance with my rule, I normally write: $i = 0; $j=count($a); while ($i $j) { $b[$i] = $a[$i]; ++$i; } It is tempting to try to put the increment into the assignment statement. Clearly the value of $a[$i] has to be read before it can be written to $b[$i], so the logical expression would be: while ($i $j) { $b[$i++] = $a[$i]; } A. However if you try this, you get $b[1] = $a[0], and so on. But if you try the alternative: while ($i $j) { $b[$i] = $a[$i++]; } B. You get $b[0] = $a[1], and so on (as you would expect). Out of curiosity, I then tried: $i = -1; $j=count($a) - 1; while ($i $j) { $b[$i] = $a[++$i]; }C This gave the desired result, and seemed moderately logical. However when I tried: $i = -1; $j=count($a) - 1; while ($i $j) { $b[++$i] = $a[$i]; }D This gave exactly the same result. It is quite impossible to explain the results in cases A and D from the definitions of the pre-and post-increment operator, so I think I will stick to my safe rule! ---End Message--- ---BeginMessage--- On Mon, 2010-03-01 at 12:14 +0100, Kim Madsen wrote: Ashley Sheridan wrote on 01/03/2010 07:13: The HTTP header doesn't treat quoteation marks in the same way that PHP does. It needs double quote marks to function correctly. How do you mean? And do you have a link to this information? Even if this is true, then the first Nick did should still be correct? header('Content-Disposition: attachment; filename=PurchaseReq.doc'); I'm using
php-general Digest 28 Feb 2010 18:46:36 -0000 Issue 6614
php-general Digest 28 Feb 2010 18:46:36 - Issue 6614 Topics (messages 302428 through 302429): Re: Uninstalling PHP? 302428 by: Austin Powers 302429 by: Colin Guthrie Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Austin Powers austinpow...@pobox.com wrote in message news:ca.b0.29124.619a8...@pb1.pair.com... Three weeks ago I was working through the Lynda.com PHP with MySQL Training because I wanted to begin using PHP (surprise, surprise). Anyway, on this video course the teacher explains that because installing PHP and MySQL is so well understood on a Mac that we may as well just follow his steps and do it manually. Well, he is installing a different version of PHP and MySQL to the ones that I was able to download and while what he was saying way somewhat similar I am guessing that there is a difference somewhere, and (well) it's not working. I AM A COMPLETE NOVICE WITH LINUX/FREEBSD. It had not been my intention to learn the intricacies of Linux. However, I am now neck deep in a mire of confusion that even MAMP can't seem to sort out for me. It is purely a guess that I need to start again from a complete clean setup (reformatting my hard disk and reinstall OS X again) but that is pretty much out of the question. I guess my question is: How can I completely uninstall PHP so that I can start again? Thanks. I did a: find / -name 'apachectl' 2. /dev/null and it came back with: /usr/sbin/apachectl /Applications/MAMP/Library/bin/apachectl so I do: cd /Application/MAMP/Library/bin and then: ./apachectl graceful and it came back with: httpd not running, trying to start (13) permission denied: make_sock: could not bind to address {::]:80 (13 permission denied: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs Does this mean that httpd is not running, and that I need to make some change to the httpd.conf file? If so, then what changes do I need to make? ---End Message--- ---BeginMessage--- 'Twas brillig, and Austin Powers at 27/02/10 23:08 did gyre and gimble: Austin Powers austinpow...@pobox.com wrote in message news:ca.b0.29124.619a8...@pb1.pair.com... Three weeks ago I was working through the Lynda.com PHP with MySQL Training because I wanted to begin using PHP (surprise, surprise). Anyway, on this video course the teacher explains that because installing PHP and MySQL is so well understood on a Mac that we may as well just follow his steps and do it manually. Well, he is installing a different version of PHP and MySQL to the ones that I was able to download and while what he was saying way somewhat similar I am guessing that there is a difference somewhere, and (well) it's not working. I AM A COMPLETE NOVICE WITH LINUX/FREEBSD. It had not been my intention to learn the intricacies of Linux. However, I am now neck deep in a mire of confusion that even MAMP can't seem to sort out for me. It is purely a guess that I need to start again from a complete clean setup (reformatting my hard disk and reinstall OS X again) but that is pretty much out of the question. I guess my question is: How can I completely uninstall PHP so that I can start again? Thanks. I did a: find / -name 'apachectl' 2. /dev/null and it came back with: /usr/sbin/apachectl /Applications/MAMP/Library/bin/apachectl so I do: cd /Application/MAMP/Library/bin and then: ./apachectl graceful and it came back with: httpd not running, trying to start (13) permission denied: make_sock: could not bind to address {::]:80 (13 permission denied: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs Does this mean that httpd is not running, and that I need to make some change to the httpd.conf file? If so, then what changes do I need to make? You are probably not privileged enough (as a user) to do this. You likely want to pass it through sudo first. e.g. sudo ./apachectl graceful. You should be prompted for you *user* password. If you user is allowed to administer the machine, you should become root temporarily and run the command. If you run several sudo commands in relatively quick succession, you wont have to type your password in again. Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http
php-general Digest 27 Feb 2010 23:05:16 -0000 Issue 6613
php-general Digest 27 Feb 2010 23:05:16 - Issue 6613 Topics (messages 302420 through 302427): Re: Uninstalling PHP? 302420 by: Lester Caine 302423 by: Ashley Sheridan 302424 by: mrfroasty 302426 by: Ashley Sheridan Re: Registry class question. 302421 by: Richard Quadling Re: Header function 302422 by: Richard Quadling 302425 by: Nick allan Wondering if anyone has experince with lastRSS 302427 by: Watson Blair Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Austin Powers wrote: How can I completely uninstall PHP so that I can start again? Not knowing the Mac I'm fishing ;) How did you INSTALL PHP? We normally do this via a 'package manager' of some sort, where you find the 'PHPxx' and select it. Uninstalling is simply a matter of 'deslecting' it. If you loaded this from a 'command line' script then I would think that perhaps this is a book that needs a health warning :( -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php ---End Message--- ---BeginMessage--- On Sat, 2010-02-27 at 07:28 +, Lester Caine wrote: Austin Powers wrote: How can I completely uninstall PHP so that I can start again? Not knowing the Mac I'm fishing ;) How did you INSTALL PHP? We normally do this via a 'package manager' of some sort, where you find the 'PHPxx' and select it. Uninstalling is simply a matter of 'deslecting' it. If you loaded this from a 'command line' script then I would think that perhaps this is a book that needs a health warning :( -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php You mentioned MAMP, which is the usual way I've seen people install PHP and MySQL on a Mac. Did this not work at all? I believe the .dmg file for it will allow you an option to uninstall and try from the beginning. If you do use MAMP, where abouts is it all becoming unstuck? Are you seeing any particular errors or anything? Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- Hello, I think everyone has their own preference on working/development setup.If you are comfortable with Window OSS, I guess shifting to Linux might take you totally out of your goals. In my case I prefer playing around Gentoo Linux, so my development setup is built around Gentoo Linux.But I fully agree that it took me a while to be comfortable to work behind this OSS. But on Windows it should be possible to get those PHP, MYSQL, Apache.Install things like WAMP or so {Ive never used it,but I heard it works}, but it could be an option for a Window User. P:S **Learning Linux/Unix wont be such a bad idea though, as most of your Servers (production environment) will be Linux/Unix.So its worth learning how to work and be comfortable with them. GR Muhsin On 02/27/2010 06:09 AM, Austin Powers wrote: Three weeks ago I was working through the Lynda.com PHP with MySQL Training because I wanted to begin using PHP (surprise, surprise). Anyway, on this video course the teacher explains that because installing PHP and MySQL is so well understood on a Mac that we may as well just follow his steps and do it manually. Well, he is installing a different version of PHP and MySQL to the ones that I was able to download and while what he was saying way somewhat similar I am guessing that there is a difference somewhere, and (well) it's not working. I AM A COMPLETE NOVICE WITH LINUX/FREEBSD. It had not been my intention to learn the intricacies of Linux. However, I am now neck deep in a mire of confusion that even MAMP can't seem to sort out for me. It is purely a guess that I need to start again from a complete clean setup (reformatting my hard disk and reinstall OS X again) but that is pretty much out of the question. I guess my question is: How can I completely uninstall PHP so that I can start again? Thanks. -- Extra details: OSS:Gentoo Linux profile:x86 Hardware:msi geforce 8600GT asus p5k-se location:/home/muhsin language(s):C/C++,VB,VHDL,bash,PHP,SQL,HTML,CSS Typo:40WPM url:http://www.mzalendo.net url:http://www.zanbytes.com ---End Message--- ---BeginMessage--- On Sat, 2010-02-27 at 13:44 +0100, mrfroasty wrote
php-general Digest 26 Feb 2010 18:40:07 -0000 Issue 6611
php-general Digest 26 Feb 2010 18:40:07 - Issue 6611 Topics (messages 302398 through 302406): header function query 302398 by: Nick allan 302399 by: Richard Quadling 302402 by: Rene Veerman weird behavior: Apache mod rewrite 302400 by: Alberto Lepe 302401 by: Ashley Sheridan JPGraph error. 302403 by: João Cândido de Souza Neto Re: Database design 302404 by: Nathan Rixham 302405 by: Robert Cummings Re: ctype_print, the British Pound and other non-ASCII characters 302406 by: Nathan Rixham Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Hi all The situation is as follows I've read some data in from a couple of files into a string variable, made some changes to it and want to send the contents of the string out to the browser as a word document. My code currently looks like the following header('Content-Type: application/msword'); header('Content-Disposition: attachment; filename=preq.doc'); ob_clean(); echo $allText; The above code works fine, the client gets a file download dialogue and can save or open the file. How can I indicate end of file, then continue writing html to display a new page. I want to be able to ask the user some additional questions after they have downloaded the file. My problem is that if I add any html code after the above echo statement, it is included in the downloaded file. There's probably a simple answer to this, but I haven't been able to find anything using google. Thanks in advance for any suggestions. Regards Nick ---End Message--- ---BeginMessage--- On 26 February 2010 06:49, Nick allan nal...@wdev.net wrote: Hi all The situation is as follows I've read some data in from a couple of files into a string variable, made some changes to it and want to send the contents of the string out to the browser as a word document. My code currently looks like the following header('Content-Type: application/msword'); header('Content-Disposition: attachment; filename=preq.doc'); ob_clean(); echo $allText; The above code works fine, the client gets a file download dialogue and can save or open the file. How can I indicate end of file, then continue writing html to display a new page. I want to be able to ask the user some additional questions after they have downloaded the file. My problem is that if I add any html code after the above echo statement, it is included in the downloaded file. There's probably a simple answer to this, but I haven't been able to find anything using google. Thanks in advance for any suggestions. Regards Nick Under normal conditions, you can't. A request is for a single thing. While it is potentially possible to embed graphics, css, js into a single html file request, downloading files is not. Instead, you issue the html first, but include in the head tag, a meta redirect tag to the URL just for the download file. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling ---End Message--- ---BeginMessage--- output the html you want to send afterwards first, then either put a link to another script that outputs the word file, or have an auto-launch ajax routine (i recommend jquery.com for ajax) do it automatically. On Fri, Feb 26, 2010 at 7:49 AM, Nick allan nal...@wdev.net wrote: Hi all The situation is as follows I've read some data in from a couple of files into a string variable, made some changes to it and want to send the contents of the string out to the browser as a word document. My code currently looks like the following header('Content-Type: application/msword'); header('Content-Disposition: attachment; filename=preq.doc'); ob_clean(); echo $allText; The above code works fine, the client gets a file download dialogue and can save or open the file. How can I indicate end of file, then continue writing html to display a new page. I want to be able to ask the user some additional questions after they have downloaded the file. My problem is that if I add any html code after the above echo statement, it is included in the downloaded file. There's probably a simple answer to this, but I haven't been able to find anything using google. Thanks in advance for any suggestions. Regards Nick ---End Message--- ---BeginMessage--- Hello everyone, this is my first time
php-general Digest 27 Feb 2010 07:05:54 -0000 Issue 6612
php-general Digest 27 Feb 2010 07:05:54 - Issue 6612 Topics (messages 302407 through 302419): Post and Redirect 302407 by: Shawn McKenzie 302410 by: Ashley Sheridan Help preserving sentence structure 302408 by: John Tamm-Buckle 302411 by: Ashley Sheridan 302415 by: Ryan Sun Registry class question. 302409 by: Peter van der Does Re: Excel Spreadsheets and PHP 302412 by: Ian Robertson Re: ctype_print, the British Pound and other non-ASCII characters 302413 by: Bob 302414 by: Bob Re: inexplicable behaviour of pre- and post-increment operators 302416 by: clancy_1.cybec.com.au Header function 302417 by: Nick allan Uninstalling PHP? 302418 by: Austin Powers 302419 by: John Black Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- I remembered seeing this question on the list several times in the past, so I thought I would post something I just hacked up for someone. As we know, we can user header() to redirect the browser, but of course we can't redirect the browser and have it post data to the new page. If you need to do this it will require javascript. Here's a quick and dirty function: function http_post_redirect($url='', $data=array(), $doc=false) { $data = json_encode($data); if($doc) { echo htmlhead/headbody; } echo script type='text/javascript' var data = eval('(' + '$data' + ')'); var jsForm = document.createElement('form'); jsForm.method = 'post'; jsForm.action = '$url'; for (var name in data) { var jsInput = document.createElement('hidden'); jsInput.setAttribute('name', name); jsInput.setAttribute('value', data[name]); jsForm.appendChild(jsInput); } document.body.appendChild(jsForm); jsForm.submit(); /script; if($doc) { echo /body/html; } exit; } -- Thanks! -Shawn http://www.spidean.com ---End Message--- ---BeginMessage--- On Fri, 2010-02-26 at 13:26 -0600, Shawn McKenzie wrote: I remembered seeing this question on the list several times in the past, so I thought I would post something I just hacked up for someone. As we know, we can user header() to redirect the browser, but of course we can't redirect the browser and have it post data to the new page. If you need to do this it will require javascript. Here's a quick and dirty function: function http_post_redirect($url='', $data=array(), $doc=false) { $data = json_encode($data); if($doc) { echo htmlhead/headbody; } echo script type='text/javascript' var data = eval('(' + '$data' + ')'); var jsForm = document.createElement('form'); jsForm.method = 'post'; jsForm.action = '$url'; for (var name in data) { var jsInput = document.createElement('hidden'); jsInput.setAttribute('name', name); jsInput.setAttribute('value', data[name]); jsForm.appendChild(jsInput); } document.body.appendChild(jsForm); jsForm.submit(); /script; if($doc) { echo /body/html; } exit; } -- Thanks! -Shawn http://www.spidean.com Someone mentioned on the whatwg mailing list that most browsers are capable of understanding multipart content, so that you could send down two types of content a bit like you'd send a multipart email. Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- Hi, new to this list... I'm adapting some code that generates text and want to keep the syntax. In the original version the output was iterated from an array in pre tags. That was fine for what it was, but it's now a word press plugin and the pre tags get in the way. How do I keep the sentence structure without using pres? Also, I'm quite new to PHP in general... :) Any help would be much appreciated! Below is an extract of the code with some highlighting for emphasis: function wpm_display_generator() { if (isset($_POST['submit_button'])) { // the form was submitted to this script - generate // and display require_once 'lib/generator.php'; require_once lib/util.php; require_once lib
php-general Digest 24 Feb 2010 16:14:58 -0000 Issue 6607
php-general Digest 24 Feb 2010 16:14:58 - Issue 6607 Topics (messages 302330 through 302349): PHP or SQL to do this? 302330 by: Rob Gould 302332 by: Jim Lucas 302342 by: Ian Re: PHP / mySQL Project... Real men use 'cat' 302331 by: Jim Lucas 302336 by: shiplu 302337 by: Pete Ford 302338 by: Ashley Sheridan 302345 by: Andrew Ballard 302346 by: Ashley Sheridan 302347 by: Ashley Sheridan Re: How to get the 'return type' of a function? 302333 by: Dasn 302334 by: Jochem Maas Re: $_POST vs $_REQUEST 302335 by: Jochem Maas 302339 by: Ashley Sheridan 302340 by: Rene Veerman 302341 by: Ashley Sheridan obj in array? 302343 by: Kim Madsen 302344 by: Kim Madsen Re: Fun with Streams 302348 by: Matt Neimeyer HipHop and other PHP compiler performance evaluation 302349 by: Manuel Lemos Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- I'm not sure if I need to write a PHP for-loop to do this, or if it can all be done in one SQL statement? Basically, I want to copy all the barcodes from one table and put them into another table, but only if the barcode in the first table 0, and only if the wineid's match from table to table. Steps individually are something like this: 1) First, I get all the records from the wine table that have barcodes, like this: SELECT * FROM `wine` WHERE barcode2 0 The fields I need are barcode2, and wineid 2) Next, I need to match all the wineid's from this wine table with the wine id's from the usersdata table. Both fields in both tables are called wineid. 3) Then, if the wineid's match, I need to copy the barcode2 value from the wine table and put it into the field custombarcode in the usersdata table. I'm tempted to write a PHP script which does a while-loop through all the records returned from the wine table and do the matching with the usersdata table, but I wouldn't be surprised if there's some sort of table-join-type query that can do all this in one step. ---End Message--- ---BeginMessage--- Rob Gould wrote: I'm not sure if I need to write a PHP for-loop to do this, or if it can all be done in one SQL statement? Basically, I want to copy all the barcodes from one table and put them into another table, but only if the barcode in the first table 0, and only if the wineid's match from table to table. Steps individually are something like this: 1) First, I get all the records from the wine table that have barcodes, like this: SELECT * FROM `wine` WHERE barcode2 0 The fields I need are barcode2, and wineid 2) Next, I need to match all the wineid's from this wine table with the wine id's from the usersdata table. Both fields in both tables are called wineid. 3) Then, if the wineid's match, I need to copy the barcode2 value from the wine table and put it into the field custombarcode in the usersdata table. I'm tempted to write a PHP script which does a while-loop through all the records returned from the wine table and do the matching with the usersdata table, but I wouldn't be surprised if there's some sort of table-join-type query that can do all this in one step. Looks like you should be able to do this in the SQL. Creating a dummy DB and testing, the following seems to do the trick. UPDATE usersdata SET custombarcode = ( SELECT barcode2 FROMwine WHERE usersdata.wineid = wine.wineid AND wine.barcode2 0 ) Here is the DB schema and data that I used for the test CREATE TABLE IF NOT EXISTS `usersdata` ( `id` int(11) NOT NULL auto_increment, `wineid` int(11) NOT NULL, `custombarcode` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin AUTO_INCREMENT=7 ; INSERT INTO `usersdata` (`id`, `wineid`, `custombarcode`) VALUES (1, 1, 0), (2, 2, 0), (3, 3, 0), (4, 4, 0), (5, 1, 0), (6, 1, 0); CREATE TABLE IF NOT EXISTS `wine` ( `wineid` int(11) NOT NULL auto_increment, `barcode2` int(11) NOT NULL, PRIMARY KEY (`wineid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin AUTO_INCREMENT=4 ; INSERT INTO `wine` (`wineid`, `barcode2`) VALUES (1, 5), (2, -5), (3, 10); -- Jim Lucas A: Maybe because some people are too annoyed by top-posting. Q: Why do I not get an answer to my question(s)? A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? ---End Message--- ---BeginMessage--- On 24/02/2010 05:46, Rob Gould wrote: I'm not sure if I need
php-general Digest 23 Feb 2010 15:32:38 -0000 Issue 6605
php-general Digest 23 Feb 2010 15:32:38 - Issue 6605 Topics (messages 302289 through 302314): Re: PDOStatement::rowCount() bug? 302289 by: Paul M Foster 302290 by: Nathan Nobbe 302291 by: Paul M Foster unpacking an array of structs... 302292 by: php.list.juun.com 302293 by: Rene Veerman 302294 by: Nathan Nobbe 302295 by: php.list.juun.com 302296 by: php.list.juun.com Re: Sending e-mail via socket 302297 by: Per Jessen 302298 by: Per Jessen 302301 by: Andre Polykanine Re: $_POST vs $_REQUEST 302299 by: Richard 302302 by: Ashley Sheridan 302308 by: Bob McConnell 302313 by: tedd How to get the 'return type' of a function? 302300 by: Dasn 302306 by: shiplu 302309 by: Daniel Egeberg 302310 by: Bruno Fajardo 302311 by: tedd Re: PHP / mySQL Project... Real men use 'cat' 302303 by: Richard Quadling 302307 by: Phpster Re: help, please, understanding my problem 302304 by: Stan 302305 by: Ashley Sheridan 302314 by: Rene Veerman Re: PHP / mySQL Project... 302312 by: tedd Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Mon, Feb 22, 2010 at 08:18:25PM -0700, Nathan Nobbe wrote: On Mon, Feb 22, 2010 at 7:50 PM, Paul M Foster pa...@quillandmouse.com wrote: Using MySQL 5.075, PHP 5.25 on Debian unstable. Has anyone noticed, when issuing a PDOStatement::rowCount() call after a DELETE, UPDATE or INSERT, the return is uniformly zero, rather than the actual number of rows affected? quick test shows rowCount() working in all 3 cases: ?php /** * lets test a PDOStatement::rowCount() bug * using an sqlite3 memory resident database */ Nifty, but you'll notice that I'm using MySQL, not SQLite3. And you didn't mention which version PHP you're using. Paul -- Paul M. Foster ---End Message--- ---BeginMessage--- On Mon, Feb 22, 2010 at 8:39 PM, Paul M Foster pa...@quillandmouse.comwrote: On Mon, Feb 22, 2010 at 08:18:25PM -0700, Nathan Nobbe wrote: On Mon, Feb 22, 2010 at 7:50 PM, Paul M Foster pa...@quillandmouse.com wrote: Using MySQL 5.075, PHP 5.25 on Debian unstable. Has anyone noticed, when issuing a PDOStatement::rowCount() call after a DELETE, UPDATE or INSERT, the return is uniformly zero, rather than the actual number of rows affected? quick test shows rowCount() working in all 3 cases: ?php /** * lets test a PDOStatement::rowCount() bug * using an sqlite3 memory resident database */ Nifty, but you'll notice that I'm using MySQL, not SQLite3. And you didn't mention which version PHP you're using. it had occurred to me that you may be using a diff db and that could have something to do w/ it; however, ive just made a slight alteration to the script and its working np w/ mysql: --- sql --- mysql create database TESTING; Query OK, 1 row affected (0.00 sec) mysql use TESTING; Database changed mysql CREATE TABLE TESTING ( - id INT NOT NULL AUTO_INCREMENT, - name CHAR(30) NOT NULL, - PRIMARY KEY (id) - ); --- php --- ?php /** * lets test a PDOStatement::rowCount() bug * using an sqlite3 database */ try { $oPdo = new PDO('mysql:host=192.168.56.101;dbname=TESTING', 'root', ''); $oStmt = $oPdo-query(INSERT INTO TESTING (name) VALUES ('nate dogg')); echo 'Num rows inserted: ' . $oStmt-rowCount() . PHP_EOL; $oStmt = $oPdo-query(UPDATE TESTING SET name = 'snoop dog' WHERE id = 1); echo Num rows updated: . $oStmt-rowCount() . PHP_EOL; $oStmt = $oPdo-query(DELETE FROM TESTING WHERE id = 1); echo Num rows deleted: . $oStmt-rowCount() . PHP_EOL; } catch(Exception $oE) { die($oE-getMessage() . PHP_EOL); } ? version php version: PHP 5.2.6-3ubuntu4.5 with Suhosin-Patch 0.9.6.2 mysql version: Server version: 5.1.31-1ubuntu2 -nathan ---End Message--- ---BeginMessage--- On Mon, Feb 22, 2010 at 09:50:30PM -0500, Paul M Foster wrote: Using MySQL 5.075, PHP 5.25 on Debian unstable. Has anyone noticed, when issuing a PDOStatement::rowCount() call after a DELETE, UPDATE or INSERT, the return is uniformly zero, rather than the actual number of rows affected? If so, is there a simple workaround? Update: MySQL 5.1.44. rowCount() appears to return 0 only on deletes, not updates or inserts. Paul -- Paul M. Foster ---End Message--- ---BeginMessage--- I have a desktop app that has a data structure that looks like this: typedef struct MANGOpie { unsigned char mango; unsigned short pie
php-general Digest 24 Feb 2010 03:43:07 -0000 Issue 6606
php-general Digest 24 Feb 2010 03:43:07 - Issue 6606 Topics (messages 302315 through 302329): Re: How to get the 'return type' of a function? 302315 by: Nathan Rixham 302325 by: Ashley Sheridan 302327 by: Kevin Kinsey 302328 by: Ashley Sheridan Re: help, please, understanding my problem 302316 by: Stan PLEASE, PLEASE, PLEASE - HELP ME GET OFF THIS LIST 302317 by: William C. Schnute 302318 by: Ashley Sheridan 302319 by: Daniel Brown Re: Sending e-mail via socket 302320 by: John Black Re: PHP / mySQL Project... Real men use 'cat' 302321 by: Daevid Vincent 302322 by: Ashley Sheridan 302329 by: Paul M Foster Creating Days in a Year - Stored Procedure 302323 by: Pointmade_Noah1 302324 by: clancy_1.cybec.com.au Re: $_POST vs $_REQUEST 302326 by: Jochem Maas Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- tedd wrote: At 3:17 PM +0100 2/23/10, Daniel Egeberg wrote: 2010/2/23 Dasn d...@lavabit.com: Could you tell me how to retrieve the 'return type'? Thanks. -- Dasn That's not possible. Consider this function: function foo() { switch (rand(0, 1)) { case 0: return 42; case 1: return 'bar'; } } What should the return type be? -- Daniel Egeberg It can be anything you want to test for -- check out: is_int(); is_nan(); is_float(); is_long(); is_string(); IOW, is_whatever(); Cheers, tedd As PHP is loosely typed, the only real way around this is to specify a return type in a PHPDoc block, then parse that using reflection to get the @return parameter. another option is to use something like haXe which is an ECMA style typed language that compiles to multiple targets, one of which is PHP. Regards! Nathan ---End Message--- ---BeginMessage--- On Tue, 2010-02-23 at 09:31 -0500, tedd wrote: At 3:17 PM +0100 2/23/10, Daniel Egeberg wrote: 2010/2/23 Dasn d...@lavabit.com: Could you tell me how to retrieve the 'return type'? Thanks. -- Dasn That's not possible. Consider this function: function foo() { switch (rand(0, 1)) { case 0: return 42; case 1: return 'bar'; } } What should the return type be? -- Daniel Egeberg It can be anything you want to test for -- check out: is_int(); is_nan(); is_float(); is_long(); is_string(); IOW, is_whatever(); Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com is_quantum() is pretty useful as well, if you want to see if it's sort of there and not at the same time. Probably turns into a cat in a box at some point too, everything quantum has cats in... Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- Ashley Sheridan wrote: is_quantum() is pretty useful as well, if you want to see if it's sort of there and not at the same time. Probably turns into a cat in a box at some point too, everything quantum has cats in... Thanks, Ash So, should we add to the list: is_schrodingers_cat_alive() ?? KDK ---End Message--- ---BeginMessage--- On Tue, 2010-02-23 at 19:19 -0600, Kevin Kinsey wrote: Ashley Sheridan wrote: is_quantum() is pretty useful as well, if you want to see if it's sort of there and not at the same time. Probably turns into a cat in a box at some point too, everything quantum has cats in... Thanks, Ash So, should we add to the list: is_schrodingers_cat_alive() ?? KDK I think PHP would crash trying to return the boolean value from that one! Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- Thanks all. I rediscovered DIFF, compared the source for the first and second rendering. Besides the unique variable names there was also the message ... which contained imbedded single quote marks. When I changed them to imbedded double quote marks the problem went away. Stan stanleytbe...@gmail.com wrote in message news:11.66.00376.2ce92...@pb1.pair.com... I have a PHP page that has require_once(genMyOverlay.js.php); . . . echo body; echo script language=\JavaScript\doit(\mydiv\);/scriptbr; echo /body; genMyOverlay.js.php contains: createDiv() (see below) that creates a DIV ID=mydiv and sets it up to overlay a portion of the wbe page and doit()starts it off. invoke the web page once and it works like it should. invoke the web page a second time (and thereafter until a new session) and it gets error: doit is not defined view the source (at the client browser) and it is identical both (all) times can anyone please help
php-general Digest 22 Feb 2010 15:12:04 -0000 Issue 6603
php-general Digest 22 Feb 2010 15:12:04 - Issue 6603 Topics (messages 302249 through 302252): Re: Fun with Streams 302249 by: Rene Veerman 302250 by: Rene Veerman 302251 by: Ford, Mike help, please, understanding my problem 302252 by: Stan Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- http://www.bettina-attack.de/jonny/view.php/projects/php_writeexcel/ And, hey, when the hell will the PHP developers implement a foreach loop which assigns the array values by reference?? +100! (still reading the rest) ---End Message--- ---BeginMessage--- just curious, why did you choose to use it from behind a stream wrapper? and sry, i have no exp with these beasts.. On Sun, Feb 21, 2010 at 11:03 PM, Matt Neimeyer m...@neimeyer.org wrote: I created a stream wrapper around the php_writeexcel library found at http://www.bettina-attack.de/jonny/view.php/projects/php_writeexcel/ My code can be seen at http://www.pastebin.com/m7212eaa2 I'm trying to add an option that will allow us to lower or uppercase the column headers we create by calling ftell on the Excel stream but when I do something like... $xls = fopen(xlsfile://../data/measurables.xls,wb); echo ftell($xls); ...I get 0 returned even though I've hard coded a return of 123 in my stream_tell function (which I did to see if my stream_tell was even being called). Can anyone tell me what I'm doing wrong or suggest another way to communicate into the stream wrapper that will be compatible with PHP 4 and 5 on OSX, Linux and Windows? Thanks Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- -Original Message- From: Rene Veerman [mailto:rene7...@gmail.com] Sent: 22 February 2010 09:09 http://www.bettina- attack.de/jonny/view.php/projects/php_writeexcel/ And, hey, when the hell will the PHP developers implement a foreach loop which assigns the array values by reference?? Uh... s/when will/when did/ PHP 5 -- see www.php.net/foreach Cheers! Mike -- Mike Ford, Electronic Information Developer, Libraries and Learning Innovation, Leeds Metropolitan University, C507, Civic Quarter Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm ---End Message--- ---BeginMessage--- I have a PHP page that has require_once(genMyOverlay.js.php); . . . echo body; echo script language=\JavaScript\doit(\mydiv\);/scriptbr; echo /body; genMyOverlay.js.php contains: createDiv() (see below) that creates a DIV ID=mydiv and sets it up to overlay a portion of the wbe page and doit()starts it off. invoke the web page once and it works like it should. invoke the web page a second time (and thereafter until a new session) and it gets error: doit is not defined view the source (at the client browser) and it is identical both (all) times can anyone please help me understand what is happening? genMyOverlay.js.php contains script language=PHP echo script language=\JavaScript\; echo function createDiv(); echo {; . . . echo }; echo function doit(ElementID); echo {; echo creatDIV(); . . . echo }; echo /script; /script ---End Message---
php-general Digest 21 Feb 2010 14:12:08 -0000 Issue 6601
php-general Digest 21 Feb 2010 14:12:08 - Issue 6601 Topics (messages 302238 through 302245): Re: Excel Spreadsheets and PHP 302238 by: Nathan Rixham Re: Advice on maintaining public and private files 302239 by: Nathan Rixham 302242 by: Al 302245 by: Kim Madsen PHP, PHPMailer and SMTP Server 302240 by: gato chlr 302241 by: Per Jessen Re: Pre/Post inc (Was array conversion) 302243 by: Adam Richardson 302244 by: clancy_1.cybec.com.au Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Bastien Koert wrote: You can also create an htnl table and excel will happily handle that as well. The real trick is to get IE to accept the stream as a file download. I find that I need to save the file first and the push the file down. +1 this approach; Excel is HTTP aware and you can simply plumb in the URL of an HTML table and excel will do the rest; it works v well; saves tonnes of work and means you can do nice little things like importing SPARQL over HTTP queries straight in to excel - and then make nice pivot [1] views of the data, all in a couple of minutes. [1] http://www.getpivot.com/ ---End Message--- ---BeginMessage--- Kim Madsen wrote: Michael Stroh wrote on 19/02/2010 19:19: I have a site I'm working on with some data that I want to be readable by anyone, but some files that I want to keep hidden from outside users. Here is an example of my file structure. /products/data1/item_1/data.txt /products/data2/item_2/data.txt since no one has suggested it then... if you're on an Apache webserver use a .htaccess file in data2 which contains: Deny from all Allow from none That will do the trick and PHP can still fetch the files in data2 and serve it to the user. Glad you said this; I'd been waiting to see if anybody would - certainly there is no quicker or easier way to solve this particular problem. Also worth adding that you can easily password protect the directories too using HTTP authorisation [1] (and even hook it in to LDAP or suchlike very simply). It's the curse of the PHP developer to try and use PHP to solve every problem - we all fall fowl of it often (I've wasted years doing things in PHP that really should have been done with a different tech). [1] http://httpd.apache.org/docs/2.0/howto/auth.html Regards! Nathan ---End Message--- ---BeginMessage--- I use Kim's solution and take it one step forward. Htacces files can get lost or corrupted, so In my config file I have the text string. //region htaccess file text // Code writes to /db folder; Admin mode checks file existence and text; replaces with this if different. $htaccessText = hta # Prevent Direct Access to MiniRegDB DB Files Files * Order Deny,Allow Deny from all /Files hta; //endregion In my main control file I call this function /** * checkHTaccessFile() * * Checks and restores htaccess Prevent Direct Access to MiniRegDB Program Files * * @param mixed $htaccessText in config file * @return */ function checkHTaccessFile($htaccessText) { if(file_exists(MINIREG_DATA_DIR . '.htaccess') file_get_contents(MINIREG_DATA_DIR . '.htaccess') == $htaccessText) return true; file_put_contents(MINIREG_DATA_DIR . '.htaccess', $htaccessText); return true; } On 2/20/2010 4:05 AM, Kim Madsen wrote: Michael Stroh wrote on 19/02/2010 19:19: I have a site I'm working on with some data that I want to be readable by anyone, but some files that I want to keep hidden from outside users. Here is an example of my file structure. /products/data1/item_1/data.txt /products/data2/item_2/data.txt since no one has suggested it then... if you're on an Apache webserver use a .htaccess file in data2 which contains: Deny from all Allow from none That will do the trick and PHP can still fetch the files in data2 and serve it to the user. ---End Message--- ---BeginMessage--- Al wrote on 20/02/2010 19:30: I use Kim's solution and take it one step forward. Htacces files can get lost or corrupted, so No solution to that problem as I see it. In my config file I have the text string. I like the idea, but what if this file is never accessed? -- Kind regards Kim Emax - masterminds.dk ---End Message--- ---BeginMessage--- Hi,to every body i'm buildding a little application, for now i'm working in my localhost. I need to send a mail and i need to use phpmailer, but.. when i send a mail using phpMailer it tooks a lot of time, i suppose it is because the bandwidth (128kbps and 3 PCs connected in the LAN). any way i need to solve it. thinking a few i have found the next posible solutions: *install a SMTP server in my
php-general Digest 20 Feb 2010 16:10:43 -0000 Issue 6600
php-general Digest 20 Feb 2010 16:10:43 - Issue 6600 Topics (messages 302231 through 302237): Re: Excel Spreadsheets and PHP 302231 by: Daevid Vincent 302236 by: aschwin.wesseli.us Re: Advice on maintaining public and private files 302232 by: clancy_1.cybec.com.au 302233 by: Kim Madsen Re: array conversion 302234 by: clancy_1.cybec.com.au Pre/Post inc (Was array conversion) 302235 by: Richard Quadling 302237 by: Nathan Rixham Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- -Original Message- From: Ian Robertson [mailto:irobert...@americantextile.com] Sent: Friday, February 19, 2010 1:28 PM To: php-gene...@lists.php.net Subject: [PHP] Excel Spreadsheets and PHP Hello, everyone. Just a quick question. What are you using, if anything, to create Excel spreadsheets with PHP? Thank you in advance. Pear Spreadsheet Excel Writer. http://pear.php.net/package/Spreadsheet_Excel_Writer Related, here is a routine we use. Assuming you already have your data in a multi-array. /** * Outputs an Excel .xls file * Note: a row that starts with --- will be considered a separator row and output any text following the --- as such. * * @param string $title_text The name of the title in the Excel .xls document (gmdate('Y-m-d H:i') is auto appended) * @param array $header_array an array of headers for each column * @param array $data_array the data for each column and row * @param string $file_name the name of the .xls file to save as (gmdate('Y-m-d H:i') is auto appended), defaults to $title_text * @author Daevid Vincent * @date 10/29/2009 */ function download_table_to_excel($title_text, $header_array, $data_array, $file_name=null) { //require_once './includes/gui/gui_setup.inc.php'; if (!$file_name) $file_name = $title_text; $file_name = str_replace( array('[', ']'), array('(',')'), $file_name); add_user_log('Action', 'Download '.$file_name.' Excel file'); set_include_path(get_include_path().PATH_SEPARATOR.ROOTPATH.'/includes/pear '); require_once ROOTPATH.'/includes/pear/Spreadsheet/Excel/Writer.php'; $excel_control_characters = array('@', '='); $exceldoc = new Spreadsheet_Excel_Writer(); // Set version to 8 (BIFF8) so strings are not truncated to 255 chars //$exceldoc-setVersion(8); //http://pear.php.net/manual/en/package.fileformats.spreadsheet-excel-write r.spreadsheet-excel-writer-workbook.setversion.php //http://forum.openx.org/index.php?showtopic=503418353 //http://pear.php.net/bugs/bug.php?id=3384 $worksheet = $exceldoc-addWorksheet('Sheet 1'); //sheet name can only be 31 chars, but we only use one sheet, so hard-code it $format_data = $exceldoc-addFormat(); $format_data-setTextWrap(); // Create an array to track the value length per column, the default width is 8.11 $max_column = count($header_array) - 1; $max_len_by_column = array(); for ($col = 0; $col = $max_column; $col++) $max_len_by_column[$col] = 8.11; $row = -1; // Optionally write table title if ($title_text) { $format_title = $exceldoc-addFormat(); $format_title-setAlign('center'); $format_title-setAlign('vcenter'); $format_title-setBold(); $format_title-setTextWrap(); $title_text .= ' (created on '.gmdate('Y-m-d @ H:i').' UTC)'; // adjust the row height from the number of lines in the table title $lines = substr_count($title_text, 'br') + 1; $height = $lines * 14; $row++; $value = html_entity_decode(trim(strip_tags(str_replace('br', \n, $title_text; if (is_string($value) in_array(substr($value,0,1), $excel_control_characters)) $value = ' '.$value; // Add a space before Excel control characters $worksheet-write($row, 0, $value, $format_title); $worksheet-setRow($row, $height); $worksheet-mergeCells($row, 0, $row, $max_column); } // Write column headers $format_header = $exceldoc-addFormat(); $format_header-setBold(); $format_header-setTextWrap(); $row++; foreach ($header_array as $col = $header) { // remove html tags from values $value = html_entity_decode(trim(strip_tags(str_replace('br', \n, is_array($header) ? $header[0] : $header; if (is_string($value) and in_array(substr
php-general Digest 19 Feb 2010 10:37:57 -0000 Issue 6598
php-general Digest 19 Feb 2010 10:37:57 - Issue 6598 Topics (messages 302183 through 302195): Magnetic Stripe Reader or Barcode to PHP 302183 by: Daevid Vincent 302184 by: Matt Neimeyer 302185 by: Phpster 302186 by: Williams, Dewey 302188 by: Nathan Nobbe 302195 by: Richard Quadling Re: Export/Write rows from DBF to CSV 302187 by: Paul M Foster array conversion 302189 by: Dasn 302190 by: Paul M Foster 302191 by: Larry Garfield 302192 by: Adam Richardson Login Script: mysql_num_rows(): supplied argument is not a valid MySQL result resource 302193 by: David Hutto 302194 by: David Hutto Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- I'll confess that I've done almost zero research on this topic as of right now aside from pricing readers and blank cards. So we're opening a new super-club here in Seattle. One of the ideas we'd like to pursue is that people are assigned a card. This can be a magstripe card or something with a barcode. Not really sure at the moment which way to go. The idea being that when they enter, we swipe/scan their card and we can log stats (# of visits, # guests, favorite drink so the bar has it ready, enter into contest, etc.) I was thinking we setup a simple netbook with a USB reader at the front door when they pay. Then we have another back at the bar. Connect via WiFi. Have a notebook somewhere behind the scenes that runs LAMP (or a VM thereof). No internet needed. The backend database and even web/GUI stuff is of course trivial with any LAMP stack. What I don't know is how do I interface _to_ PHP from say a magstripe reader. They're dirt cheap ($50), but I assume come with zero software. http://www.kanecal.net/mag-stripe-reader-scanner.html . And there are hundreds of these gadgets out there all the same basically. I guess what I'm hoping for is some pointers, from someone who's done this sort of thing. My gut thought is something so simple, where there is some XP software (or Linux I suppose) that reads the card (and generally they only have a number encoded on them) and this is sent via a URL we define, such as http://192.168.10.100/door.php?id=123456 or http://192.168.10.100/bar.php?id=123456 etc. (ignore the security issues and all that. It's trivial to encode the parameters, plus it's a closed system with WEP/WPA/WTF). But does anyone know of such a key piece of code? Like I said, I'm not locked into magcards. It could be a barcode reader just as easily. Or fingerprint scanner, or facial recognition. In the end it's just a unique thing that maps to a unique number. I just need the FM (F*ckin' Magic -- it's a programmer term -- look it up!) that goes in between PHP and the hardware. http://daevid.com Some people, when confronted with a problem, think 'I know, I'll use XML.' Now they have two problems. ---End Message--- ---BeginMessage--- If the scanning device hooks into the keyboard somehow it should be easy. I believe that's called a keyboard wedge. Basically, you scan and it types. My only exposure to this is using one of the old CueCat scanners to index my personal library into a php app I cobbled together. The CueCat hooked in line with the keyboard. You'd bring up the scanning page and an onload Javascript would place the cursor into the Scan ISBN Here text box. Scan the book and the input went where it was needed. I believe it also sent an enter keystroke which submitted the form. It's been a couple years since I played with it so there might have been some additional software that kicked the enter. Then you process the data as you would for any other text field submission. It worked well enough to catalog a couple thousand books in a single evening. Hope this helps Matt On Thu, Feb 18, 2010 at 5:42 PM, Daevid Vincent dae...@daevid.com wrote: So we're opening a new super-club here in Seattle. One of the ideas we'd like to pursue is that people are assigned a card. This can be a magstripe card or something with a barcode. Not really sure at the moment which way to go. ---End Message--- ---BeginMessage--- The inputs are simple client side devices, lime th keyboard. I used as wasp brand barcode reader and it was configured to input the value and the tab to send it to te next field. They work well and easy to set up. Bastien Sent from my iPod On Feb 18, 2010, at 5:42 PM, Daevid Vincent dae...@daevid.com wrote: I'll confess that I've done almost zero research on this topic as of right now aside from pricing readers and blank cards. So we're opening a new super-club here in Seattle. One of the ideas we'd like to pursue
php-general Digest 18 Feb 2010 22:31:05 -0000 Issue 6597
php-general Digest 18 Feb 2010 22:31:05 - Issue 6597 Topics (messages 302169 through 302182): PHPDoc (not PhD) question. 302169 by: Richard Quadling 302179 by: Nathan Rixham 302180 by: Nathan Rixham Linux ERD software 302170 by: Ashley Sheridan 302171 by: O. Lavell 302172 by: Bastien Koert Dumb Question - Casting 302173 by: Chuck 302174 by: Ashley Sheridan 302175 by: Andrew Ballard 302176 by: Daniel Egeberg 302177 by: Joseph Thayne 302178 by: Nathan Rixham linux admin needed in israel 302181 by: Ashley Sheridan Re: Export/Write rows from DBF to CSV 302182 by: OBXer Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Hello. Does anyone have any other templates for PHPDoc? I've found zym's ExtJS PHPDoc template, but this doesn't seem to be maintained and there are a few bugs (source code not styled, source code rendered as external windows with broken links, ordered and unordered lists not rendered with appropriate styling, etc.). Any suggestsions, fixes, alternatives. Regards, Richard. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling ---End Message--- ---BeginMessage--- Richard Quadling wrote: Hello. Does anyone have any other templates for PHPDoc? I've found zym's ExtJS PHPDoc template, but this doesn't seem to be maintained and there are a few bugs (source code not styled, source code rendered as external windows with broken links, ordered and unordered lists not rendered with appropriate styling, etc.). Any suggestsions, fixes, alternatives. Regards, Richard. There's a half decent one included with phpUnderControl - never seen one I *really* like yet though, and never had the time nor inclination to go making / editing one of the templates. Regards! ---End Message--- ---BeginMessage--- Richard Quadling wrote: Hello. Does anyone have any other templates for PHPDoc? I've found zym's ExtJS PHPDoc template, but this doesn't seem to be maintained and there are a few bugs (source code not styled, source code rendered as external windows with broken links, ordered and unordered lists not rendered with appropriate styling, etc.). Any suggestsions, fixes, alternatives. Regards, Richard. There's a half decent one included with phpUnderControl - never seen one I *really* like yet though, and never had the time nor inclination to go making / editing one of the templates. Regards! ---End Message--- ---BeginMessage--- I don't normally need an ERD, but this latest project I'm on has some pretty complex database tables, and as I'm working with someone else on it, I need to plan out exactly how all the tables relate to each other properly. Do any of you have any suggestions for ERD software that will run on Linux. It can't be web-based (unless it's something I can run easily on my own local server) as I won't have access to the Internet all the time I'm working on this. Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- Ashley Sheridan wrote: I don't normally need an ERD, but this latest project I'm on has some pretty complex database tables, and as I'm working with someone else on it, I need to plan out exactly how all the tables relate to each other properly. Do any of you have any suggestions for ERD software that will run on Linux. It can't be web-based (unless it's something I can run easily on my own local server) as I won't have access to the Internet all the time I'm working on this. MySQL Workbench, Azzurri Clay. ---End Message--- ---BeginMessage--- On Thu, Feb 18, 2010 at 7:26 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: I don't normally need an ERD, but this latest project I'm on has some pretty complex database tables, and as I'm working with someone else on it, I need to plan out exactly how all the tables relate to each other properly. Do any of you have any suggestions for ERD software that will run on Linux. It can't be web-based (unless it's something I can run easily on my own local server) as I won't have access to the Internet all the time I'm working on this. Thanks, Ash http://www.ashleysheridan.co.uk Yep, Mysql Workbench is pretty darn good -- Bastien Cat, the other other white meat ---End Message--- ---BeginMessage--- Sorry, been doing heavy perl and haven't written any PHP in 3 years so a tad rusty
php-general Digest 16 Feb 2010 08:40:27 -0000 Issue 6593
php-general Digest 16 Feb 2010 08:40:27 - Issue 6593 Topics (messages 302099 through 302102): Re: Thread Safe? 302099 by: Robert Cummings loadXML() and namespace 302100 by: Michael A. Peters Re: UK Project Opportunity 302101 by: Manuel Lemos Retrieve http body 302102 by: à¶à·à¶½à·à¶±à· චබà·à·à·à¶à·|Thilani Abeysinghe Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Hi David, Install the non-thread safe version and run it in conjunction with FastCGI. You may also be interested in looking into WinCache for PHP. Non-thread safe works best with FastCGI, running PHP as an ISAPI module is NOT recommended. Cheers, Rob. David Stoltz wrote: Hi all, I'm installing 5.3.1 on my Windows Server with IIS6. Should I choose VC9 x86 Thread Safe or non-thread safe ? What is the difference? Thanks! -- http://www.interjinn.com Application and Templating Framework for PHP ---End Message--- ---BeginMessage--- It seems that if I use loadXML($string) and the $string has a namespace defined in it, domdocument is nuking the namespace and changing the nodenames from whatever to defaultwhatever. Example - math xmlns=http://www.w3.org/1998/Math/MathML; mrow mrow msup mix/mi mn2/mn /msup mo+/mo mrow mn4/mn mo/mo mix/mi /mrow mo+/mo mn4/mn /mrow mo=/mo mn0/mn /mrow /math would get changed to defaultmath defaultmrow defaultmrow defaultmsup defaultmix/defaultmi defaultmn2/defaultmn /defaultmsup defaultmo+/defaultmo defaultmrow defaultmn4/defaultmn defaultmo/defaultmo defaultmix/defaultmi /defaultmrow defaultmo+/defaultmo defaultmn4/defaultmn /defaultmrow defaultmo=/defaultmo defaultmn0/defaultmn /defaultmrow /defaultmath which of course breaks the page. So it seems I need to somehow tell loadXML() about the namespace so it doesn't do that, but I'm not having much luck with the php manual, DOMDocument documentation seems a little on the not written side. When I create the nodes and add them to the dom via domdocument it works fine, but the issue is I like to cache the content div as a string and load it when the page is requested (stuff outside the content div needs to be dynamic and not cached) but this namespace issue prevents that. Any tips would be appreciated, caching makes a huge difference. ---End Message--- ---BeginMessage--- Hello, on 02/15/2010 11:37 AM Nathan Rixham said the following: I need to find a skilled PHP dev, UK based, with long term availability, in the short term to join me on a project and ultimately be prepared to take over the project and own it. Remote contract work w/ occasional meetings on site. You may want to try searching PHP professionals with the specific skills you need here: http://www.phpclasses.org/professionals/country/uk/ Or you may want to try to post a job here: http://www.phpclasses.org/jobs/ -- Regards, Manuel Lemos Find and post PHP jobs http://www.phpclasses.org/jobs/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ ---End Message--- ---BeginMessage--- hi, Im getting a http post request from an application . It has content-type of multipart/form-data I want to retrieve the http header and body separately. For retriving body I used @file_get_contents('php://input'); but this will not capture any content . Is there any way to capture body content Request was: POST /test.php HTTP/1.1 Host: localhost Connection: keep-alive User-Agent: java Message-ID: o-qf5613.82.x545.69 LinkedID: y-f6-qf5609.93.x584...@mmsc From: 172.16.11...@unknown TransactionID: Mbuni-o-qf5613.82.x545.69 -To: 111 Message-Date: Mon, 15 Feb 2010 09:20:09 GMT Received-Date: Mon, 15 Feb 2010 09:20:13 GMT Content-Type: multipart/form-data; boundary=_boundary_214096443_1266225618_R_n_bd424521165 MIME-Version: 1.0 Content-Length: 420 --_boundary_214096443_1266225618_R_n_bd424521165 Content-Disposition: form-data; name=fx true --_boundary_214096443_1266225618_R_n_bd424521165 Content-Disposition: form-data; name=text[]; filename=Jmg.txt Content-Type: text/plain; charset=utf-8 Jmg --_boundary_214096443_1266225618_R_n_bd424521165 Content-Disposition: form-data; name=skip 1 --_boundary_214096443_1266225618_R_n_bd424521165-- Thanks ---End Message---
php-general Digest 15 Feb 2010 17:48:43 -0000 Issue 6592
php-general Digest 15 Feb 2010 17:48:43 - Issue 6592 Topics (messages 302094 through 302098): Re: Quick research 302094 by: Richard Quadling 302095 by: Nathan Rixham UK Project Opportunity 302096 by: Nathan Rixham Re: Report generators: experience, recommendations? 302097 by: Phpster Thread Safe? 302098 by: David Stoltz Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On 14 February 2010 20:14, Nathan Rixham nrix...@gmail.com wrote: Hi All, If you have 2 seconds could you answer the following 1 (one) question please http://poll.fm/1lr8t Many thanks in advance if you answer, yes it is PHP related (ultimately) need to get a good cross section of exposure. Nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php You need another option of I don't use Linked Data. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling ---End Message--- ---BeginMessage--- Richard Quadling wrote: On 14 February 2010 20:14, Nathan Rixham nrix...@gmail.com wrote: Hi All, If you have 2 seconds could you answer the following 1 (one) question please http://poll.fm/1lr8t Many thanks in advance if you answer, yes it is PHP related (ultimately) need to get a good cross section of exposure. Nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php You need another option of I don't use Linked Data. Cheers Richard (and good point) - updated accordingly! regards, nathan ---End Message--- ---BeginMessage--- Hi All, I need to find a skilled PHP dev, UK based, with long term availability, in the short term to join me on a project and ultimately be prepared to take over the project and own it. Remote contract work w/ occasional meetings on site. In all honesty, the client and the project is the best I've ever had, rates are fantastic, tech stack is great and you get the chance to work with every new technology you want + implement for a gracious client. You will need to be an experienced developer with numerous apps under your belt, be willing to learn (a lot) and, well here's the skills list: Must already have: PHP 5 OO knowledge of design patterns + software architecture Linux server management (apache/ubuntu/ldap) SVN, a good IDE, Unit Testing w/ PHPUnit, Coding Standards, PHPDoc (X)HTML / CSS / HTML5 Javascript + JQuery Will need but can teach: RDF / Linked Data SPARQL (+Extensions) Virtuoso 5/6 ARC2 OWL (/2) Nice to have: Familiarity with: Kohana and Zend Frameworks REST and WebDav, HTTP/1.1 Protocol Spatial / GEO data Continuous Integration and phpUnderControl Google Earth Plugin n-tier applications EAV/CR OpenID / OpenAuth etc As a bonus you also get to know that the work you do has positive impacts on real people in many of the worlds poorest nations :) Do email me; off-list; on the above address or nat...@webr3.org if you're interested. Many Regards, Nathan ---End Message--- ---BeginMessage--- On Feb 14, 2010, at 11:51 PM, Jonathan Sachs 081...@jhsachs.com wrote: On Sat, 13 Feb 2010 20:01:35 -0500, n...@ridersite.org (Al) wrote: I'm looking for a report generator which will be used to create management reports for my client from a MySQL database Has anyone had experience with report generators that meet these criteria? What would you recommend; what would you stay away from? Try Source Forge. Al: I appreciate your effort to be helpful, but if you review my original post, you'll find that the question you answered is not the one I asked. I hope that others who have used one or more report generators will share their thoughts. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I like BIRT, and pentaho is nice to. In our office we rolled our own. The chief issue with any report gen tool is that in most cases the user needs to understand the basics of SQL in order to be able to create meaningful reports. That is where most of our support time goes for the tool. It's hard to train clients to do anything beyond simple 1 table reports. Our tool uses mutli select boxes to choose tables and fields, which is ok if you know SQL and what the fields do. BIRT uses a java interface with drag and drop so from a user perspective it's somewhat easier to do
[PHP] Re: confirm subscribe to php-general@lists.php.net
php-general Digest 14 Feb 2010 00:45:05 -0000 Issue 6589
php-general Digest 14 Feb 2010 00:45:05 - Issue 6589 Topics (messages 302061 through 302076): Re: optional object arguments to a function 302061 by: Jochem Maas 302074 by: Richard Quadling Re: SQL insert () values (),(),(); how to get auto_increments properly? 302062 by: Lester Caine 302063 by: Jochem Maas 302064 by: Eric Lee 302065 by: Jochem Maas 302068 by: tedd 302069 by: Joseph Thayne 302070 by: Ashley Sheridan 302072 by: Lester Caine Re: How to secure this 302066 by: John Allsopp 302067 by: tedd 302071 by: Robert Cummings 302073 by: Michael A. Peters 302075 by: Michael A. Peters Report generators: experience, recommendations? 302076 by: Jonathan Sachs Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Op 2/13/10 8:05 AM, Michael A. Peters schreef: I've started working on a class using DOMDocument to assemble MathML in php. The class, assuming I actually succeed, will eventually be used for parsing LaTeX math equations to MathML without the need to have TeX installed. I probably won't be able to support all the possibilities for equations that LaTeX does w/o a TeX install (and definitely not user defined macros) but I suspect I can (hopefully) cover most of the common stuff. One thing I don't know how to do, though, is write a function where arguments are optional object. IE for a function to generate an integral, the limits are optional but if specified must be an object (since they may be an equation themselves). I want the default to be some kind of a null object so I know to do nothing with it if it is null. With string/integer you just do function foo($a='',$b='',$c=false) { } How do I specify a default null object, or otherwise make the argument argument optional? this first one doesn't work: ? class Foo { function dobar(stdObject $o = null) { /* ... */ } } $e = new Foo; $f = new Foo; $f-dobar();// works $f-dobar($e); // catchable fatal $f-dobar((object)array()); // catchable fatal - check the error msg!?!? ? ... but if you're able/willing to specify a user defined class then you have this option: ?php class Bar {} class Foo { function dobar(Bar $o = null) { /* ... */ } } $b = new Bar; $f = new Foo; $f-dobar($b); $f-dobar(); ? ---End Message--- ---BeginMessage--- On 13 February 2010 10:07, Jochem Maas joc...@iamjochem.com wrote: Op 2/13/10 8:05 AM, Michael A. Peters schreef: I've started working on a class using DOMDocument to assemble MathML in php. The class, assuming I actually succeed, will eventually be used for parsing LaTeX math equations to MathML without the need to have TeX installed. I probably won't be able to support all the possibilities for equations that LaTeX does w/o a TeX install (and definitely not user defined macros) but I suspect I can (hopefully) cover most of the common stuff. One thing I don't know how to do, though, is write a function where arguments are optional object. IE for a function to generate an integral, the limits are optional but if specified must be an object (since they may be an equation themselves). I want the default to be some kind of a null object so I know to do nothing with it if it is null. With string/integer you just do function foo($a='',$b='',$c=false) { } How do I specify a default null object, or otherwise make the argument argument optional? this first one doesn't work: ? class Foo { function dobar(stdObject $o = null) { /* ... */ } } $e = new Foo; $f = new Foo; $f-dobar(); // works $f-dobar($e); // catchable fatal $f-dobar((object)array()); // catchable fatal - check the error msg!?!? ? ... but if you're able/willing to specify a user defined class then you have this option: ?php class Bar {} class Foo { function dobar(Bar $o = null) { /* ... */ } } $b = new Bar; $f = new Foo; $f-dobar($b); $f-dobar(); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Try stdClass. If you know the class type, then that can be the type hint. You can also use func_get_args() to read all the parameters and type check them if there are MANY optional parameters. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http
php-general Digest 12 Feb 2010 09:17:55 -0000 Issue 6586
php-general Digest 12 Feb 2010 09:17:55 - Issue 6586 Topics (messages 302012 through 302035): Re: PHP will NOT display this on my dev machine: Warning: session_start()... 302012 by: Adam Richardson 302013 by: Ashley Sheridan 302015 by: John Black Re: Persistent flag in memory 302014 by: Jochem Maas Mysql statement works in phpmyadmin but not in php page 302016 by: james stojan 302017 by: Joseph Thayne 302018 by: Kim Madsen 302019 by: Mari Masuda 302020 by: james stojan 302021 by: Joseph Thayne 302022 by: James McLean 302023 by: Joseph Thayne 302024 by: Jochem Maas 302025 by: James McLean 302026 by: James McLean 302027 by: Joseph Thayne 302030 by: Paul M Foster 302032 by: Joseph Thayne 302034 by: Paul M Foster Re: PHP Manual problems 302028 by: clancy_1.cybec.com.au 302031 by: Paul M Foster the limitation of upload_max_filesize, post_max_size 302029 by: pinate Checking correct usage of fopen(), stream_set_timeout() and fread() [newbie] 302033 by: Mark White expression engine 302035 by: Sudhakar Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Do you have output buffering turned on? On Thu, Feb 11, 2010 at 1:19 PM, John Black s...@network-technologies.orgwrote: I am running into a strange problem and I hope someone might have an idea why this is happening. My installation of PHP will *NOT* display the warning message below on my development machine where it should display it (sample code at the bottom). Warning: session_start() [function.session-start]: Cannot send session cache limiter After receiving a bug report from a customer I tested my code on a XAMPP setup and, sure enough, it displayed the warning message. But on my machine, I can't find a message in my php log, it is as if this problem does not even exist (on my dev machine). My dev setup is: OS: ARCH 64bit (about a month out of date) PHP Dev stuff: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8k DAV/2 SVN/1.6.6 PHP/5.3.1 with Suhosin-Patch xdebug-2.0.5-2-x86_64 php.ini error_reporting = E_ALL | E_STRICT display_errors = On display_startup_errors = On log_errors = On html_errors = On phpinfo() confirms that these settings are in effect display_errors On On error_reporting 32767 32767 So does anybody have any clue as to what could be causing this problem of not getting a warning message? Here is sample code: pThe warning should be below this line/p ?PHP session_start(); ? pThe warning should be above this line/p Which should produce the message below between the lines: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent ( output started at file_name on line 2 ) but on my machine all I get is this in html source of the output: pThe warning should be below this line/p pThe warning should be above this line/p thx -- John Staat heißt das kälteste aller kalten Ungeheuer. Kalt lügt es auch; und diese Lüge kriecht aus seinem Munde: 'Ich, der Staat, bin das Volk.' [Friedrich Nietzsche] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com ---End Message--- ---BeginMessage--- On Thu, 2010-02-11 at 19:19 +0100, John Black wrote: I am running into a strange problem and I hope someone might have an idea why this is happening. My installation of PHP will *NOT* display the warning message below on my development machine where it should display it (sample code at the bottom). Warning: session_start() [function.session-start]: Cannot send session cache limiter After receiving a bug report from a customer I tested my code on a XAMPP setup and, sure enough, it displayed the warning message. But on my machine, I can't find a message in my php log, it is as if this problem does not even exist (on my dev machine). My dev setup is: OS: ARCH 64bit (about a month out of date) PHP Dev stuff: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8k DAV/2 SVN/1.6.6 PHP/5.3.1 with Suhosin-Patch xdebug-2.0.5-2-x86_64 php.ini error_reporting = E_ALL | E_STRICT display_errors = On display_startup_errors = On log_errors = On html_errors = On phpinfo() confirms that these settings are in effect display_errors On On error_reporting 32767 32767 So does anybody have any clue as to what could
php-general Digest 12 Feb 2010 21:19:30 -0000 Issue 6587
php-general Digest 12 Feb 2010 21:19:30 - Issue 6587 Topics (messages 302036 through 302047): Re: PHP Manual problems 302036 by: Ashley Sheridan 302043 by: Nathan Rixham 302045 by: Andrew Ballard 302047 by: Ashley Sheridan Re: SOAP connect error 302037 by: Richard Quadling JQuery issue 302038 by: Devendra Jadhav 302039 by: Ashley Sheridan 302040 by: Jay Blanchard 302041 by: Devendra Jadhav Re: expression engine 302042 by: Nathan Rixham How to secure this 302044 by: John Allsopp 302046 by: Robert Cummings Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Thu, 2010-02-11 at 22:38 -0500, Paul M Foster wrote: On Fri, Feb 12, 2010 at 12:13:11PM +1100, clanc...@cybec.com.au wrote: On Thu, 11 Feb 2010 10:18:18 +, a...@ashleysheridan.co.uk (Ashley Sheridan) wrote: On Thu, 2010-02-11 at 10:16 +1100, Ross McKay wrote: ... There's a good reason for OpenOffice having some difficulties with MS Office documents. Back when MS rushed through getting their document standard ratified by ISO (which itself is a whole other story) they didn't explain all the details quite as well as they might have. Later on, MS found they were having some difficulty following their own 'standard' and so altered it in various ways in Office2007. Needless to say, ISO weren't too happy when MS asked if they could just 'change the specs' for their file format, and quite rightly refused to do so. In short, this means that there is a MS ISO standard that MS is the only one not trying to follow, and software like OpenOffice is left to reverse engineering the format again. When the first Word Macro virus appeared in the early 90s, the AV industry approached Microsoft for the specifications of the internal structure of the Word documents. After some discussion Microsoft agreed to make these available to firms who signed an NDA. Several large firms did so, but when they got the specifications they immediately discovered that they bore very little relation to the actual documents. When Microsoft was approached about this their reply was Well, that's all we've got! The industry had to run a joint program to reverse engineer the specifications before they could work out how to remove the virus. The story that went around was that with each update Microsoft hired a new batch of young graduates asidethey don't have preconceived notions (a.k.a. experience), and they don't have extravagant ideas of their own worth/aside, told them vaguely what they wanted, and left them to it. Then, as soon as they had something that sort of worked, they let them go again. So there was no continuity, no documentation, no hope of bug fixes, and very little likelihood that the next update would be improved in any meaningful sense. I have seen nothing to suggest that anything has changed. I suspect any lack of continuity was more due to the shifting of personnel internally to differing projects, rather than the hiring of all new coders each time. But more importantly, I suspect MS coders just coded without writing any docs. Coders usually suck at documentation and will avoid it unless forced. And if forced to write docs, the docs were just a toss-off no one ever actually looked at. Microsoft's attitude, I'm sure was, Why should we care about other players in the market? Just buy our crap and you won't have to worry about our formats. (Except until the next upgrade.) I think ISO's policy should be that if you're a company forwarding a standard, your off-the-shelf software should verifiably duplicate that standard. Otherwise, go pound sand. Same if you're a community proposing a standard. Produce some software which adheres to that standard or shut up. Paul -- Paul M. Foster Microsofts XML format should never have been made an ISO standard anyway. There's a bit of a conspiracy behind how they managed it, including large amounts of money and trade agreements trading hands, as well as secret voting... Thanks, Ash http://www.ashleysheridan.co.uk ---End Message--- ---BeginMessage--- Ashley Sheridan wrote: On Thu, 2010-02-11 at 22:38 -0500, Paul M Foster wrote: On Fri, Feb 12, 2010 at 12:13:11PM +1100, clanc...@cybec.com.au wrote: On Thu, 11 Feb 2010 10:18:18 +, a...@ashleysheridan.co.uk (Ashley Sheridan) wrote: On Thu, 2010-02-11 at 10:16 +1100, Ross McKay wrote: ... There's a good reason for OpenOffice having some difficulties with MS Office documents. Back when MS rushed through getting
php-general Digest 10 Feb 2010 11:49:15 -0000 Issue 6583
php-general Digest 10 Feb 2010 11:49:15 - Issue 6583 Topics (messages 301913 through 301924): Re: SOAP connect error 301913 by: Shawn McKenzie 301914 by: Eric Lommatsch Re: howto do informative error handling without the fatalities 301915 by: clancy_1.cybec.com.au 301916 by: Rene Veerman 301917 by: Paul M Foster 301922 by: Rene Veerman Re: PHP Manual problems 301918 by: clancy_1.cybec.com.au 301920 by: James McLean 301923 by: Lester Caine Owner or other; permissions for webpage users 301919 by: clancy_1.cybec.com.au 301921 by: James McLean Re: create archive file in memory with zipArchive class 301924 by: Richard Quadling Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Eric Lommatsch wrote: Hello, I am working with the SOAP package of PHP and I am trying make a connection from a hosted website to a server in our office. I can get to the server perfectly fine from within our office, but I cannot connect from the eternal site. I have checked and I am certain that the firewall for the server is open. When I attempt to use the login page that I have created for the website I am getting the following error message: Connect Error to XX.XX.XX.XXX:8080 Where XX.XX.XX.XXX mask the actual ip address of the server. I have tried to interogate all the values that soap_fault documents that it can return and the only information I have been able to find beside the above message, which is the $errorstring, is that my $faultcode = HTTP. The information that I am getting is very cryptic. if I include our ip address when I search I get no results. If I put in connect error :8080 I get millions of meaningless results. Can someone please help to figure out how to get more meaningful information from soap_fault for this problem so that I can figure out how to fix it. Thank you Eric H. Lommatsch Programmer 360 Business 2087 South Grant Street Denver, CO 80210 Tel 303-777-8939 Ext 23 Fax 888-282-9927 er...@360b.com If you go home or to Starbucks can you get to http://XX.XX.XX.XXX:8080 ? If not, then the external server can't either. It could be a network firewall/proxy sever in your office, or any number of things. -- Thanks! -Shawn http://www.spidean.com ---End Message--- ---BeginMessage--- -Original Message- From: Shawn McKenzie [mailto:nos...@mckenzies.net] Sent: Tuesday, February 09, 2010 3:07 PM To: Eric Lommatsch Cc: php-gene...@lists.php.net Subject: Re: SOAP connect error Eric Lommatsch wrote: Hello, I am working with the SOAP package of PHP and I am trying make a connection from a hosted website to a server in our office. I can get to the server perfectly fine from within our office, but I cannot connect from the eternal site. I have checked and I am certain that the firewall for the server is open. When I attempt to use the login page that I have created for the website I am getting the following error message: Connect Error to XX.XX.XX.XXX:8080 Where XX.XX.XX.XXX mask the actual ip address of the server. I have tried to interogate all the values that soap_fault documents that it can return and the only information I have been able to find beside the above message, which is the $errorstring, is that my $faultcode = HTTP. The information that I am getting is very cryptic. if I include our ip address when I search I get no results. If I put in connect error :8080 I get millions of meaningless results. Can someone please help to figure out how to get more meaningful information from soap_fault for this problem so that I can figure out how to fix it. Thank you Eric H. Lommatsch Programmer 360 Business 2087 South Grant Street Denver, CO 80210 Tel 303-777-8939 Ext 23 Fax 888-282-9927 er...@360b.com If you go home or to Starbucks can you get to http://XX.XX.XX.XXX:8080 ? If not, then the external server can't either. It could be a network firewall/proxy sever in your office, or any number of things. -- Thanks! -Shawn http://www.spidean.com I have connected to a clients computer that is remote from our office and I am able to get to http://XX.XX.XX.XXX:8080. I probably should have mentioned that when I try to get the webservice outside of the PHP site I am developing I can get into that just fine. It is just when I try to use the PHP SOAP client to access the webservice that I am getting the issue. Thank you Eric H. Lommatsch Programmer 360 Business 2087 South Grant Street Denver, CO 80210 Tel 303-777-8939 Ext 23 Fax 888-282-9927 er...@360b.com ---End Message
php-general Digest 9 Feb 2010 21:05:38 -0000 Issue 6582
php-general Digest 9 Feb 2010 21:05:38 - Issue 6582 Topics (messages 301897 through 301912): Re: howto do informative error handling without the fatalities 301897 by: Rene Veerman 301898 by: Teus Benschop 301899 by: Nathan Rixham 301900 by: Richard Quadling 301901 by: Richard 301902 by: Richard Quadling 301903 by: Richard 301904 by: Robert Cummings 301905 by: Ashley Sheridan 301906 by: Robert Cummings 301908 by: Richard Quadling 301910 by: Richard create archive file in memory with zipArchive class 301907 by: Ryan Sun 301909 by: Richard Quadling 301911 by: Ryan Sun SOAP connect error 301912 by: Eric Lommatsch Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- I would also like to hear suggestions on how to fix this mess: $r = funcA ( funcB ( funcC ( $p ) ) ); if funcB() / funcC() fails, how would you fudge/abort the calling function in the chain? One may think that funcA and funcB just check their parameters list for being error arrays, but the problem i foresee is that depending on the context of the $r= call, desired behaviour may vary at any stage in the funcA - funcB - funcC chain. ---End Message--- ---BeginMessage--- On Tue, 2010-02-09 at 07:22 +0100, Rene Veerman wrote: I would also like to hear suggestions on how to fix this mess: $r = funcA ( funcB ( funcC ( $p ) ) ); if funcB() / funcC() fails, how would you fudge/abort the calling function in the chain? One may think that funcA and funcB just check their parameters list for being error arrays, but the problem i foresee is that depending on the context of the $r= call, desired behaviour may vary at any stage in the funcA - funcB - funcC chain. I would abort it by embedding the mess in a try.. catch statement, then throwing an exception. Teus. ---End Message--- ---BeginMessage--- Rene Veerman wrote: Hi, I'm looking for a strategy to do informative error handling at all levels of my code, yet keep these errors non-fatal as often as possible. error_log - for logging errors throw Exception - for show stoppers try/catch - for when you can handle a potential show stopper custom error logging / messaging can easily be achieved with something like this: ?php class Messenger { private static $_messages = array(); public static function addMessage( $string ) { self::$_messages[] = $string; if( $string instanceof Exception ) { echo self::report(); } } public static function report() { return implode( PHP_EOL , self::$_messages ); } } set_exception_handler( 'Messenger::addMessage' ); Messenger::addMessage( 'little error report 1' ); Messenger::addMessage( 'little error report 2' ); Messenger::addMessage( 'little error report 3' ); throw new Exception( 'this will stop the script' ); // exception will kill the script; if you comment it out // or wrap it in a try catch then you can keep going.. Messenger::addMessage( 'little error report 4' ); // try catch exceptions and report them like this.. try { throw new Exception( 'we could catch this' ); } catch ( Exception $e ) { Messenger::addMessage( $e ); } Messenger::addMessage( 'little error report 5' ); // and when your done just echo it out or save it or.. echo Messenger::report(); Regards! ---End Message--- ---BeginMessage--- On 9 February 2010 11:48, Nathan Rixham nrix...@gmail.com wrote: Rene Veerman wrote: Hi, I'm looking for a strategy to do informative error handling at all levels of my code, yet keep these errors non-fatal as often as possible. error_log - for logging errors throw Exception - for show stoppers try/catch - for when you can handle a potential show stopper custom error logging / messaging can easily be achieved with something like this: ?php class Messenger { private static $_messages = array(); public static function addMessage( $string ) { self::$_messages[] = $string; if( $string instanceof Exception ) { echo self::report(); } } public static function report() { return implode( PHP_EOL , self::$_messages ); } } set_exception_handler( 'Messenger::addMessage' ); Messenger::addMessage( 'little error report 1' ); Messenger::addMessage( 'little error report 2' ); Messenger::addMessage( 'little error report 3' ); throw new Exception( 'this will stop the script' ); // exception will kill the script; if you comment it out // or wrap it in a try catch then you can keep going.. Messenger::addMessage( 'little error report 4' ); // try catch exceptions and report them like this.. try { throw new Exception( 'we could catch
php-general Digest 8 Feb 2010 17:09:28 -0000 Issue 6580
php-general Digest 8 Feb 2010 17:09:28 - Issue 6580 Topics (messages 301870 through 301887): pecl install geoip doesnt work. Warning: opendir(/var/tmp/pear-build-root/install-geoip-1.0.7//var/www/pear): failed to open dir: No such file or directory in PEAR/Builder.php on line 188 301870 by: David Taveras 301872 by: Jochem Maas Re: php selecting multiple stylesheets 301871 by: Paul M Foster 301873 by: TG 301875 by: Ashley Sheridan 301879 by: Stephan Ebelt 301881 by: Ashley Sheridan 301882 by: Michael A. Peters 301883 by: Al 301885 by: tedd 301886 by: Ashley Sheridan 301887 by: Michael A. Peters Re: simplexml - can it do what I need? 301874 by: TerryA 301876 by: Ashley Sheridan 301878 by: TerryA 301884 by: TerryA Re: Issue with blocked socket stream 301877 by: Phani Raju Re: Help with regex (search/replace) please 301880 by: Gautam Bhatia Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Hello, Before writing to the general list I tried to search for a pecl users list but apparently it is closed only to developers. Iam running pecl install geoip, it confirms as per below that it was installed correctly but a find / -name geoip.so yields nothing, the paths mentioned at the end also do not exist. I assume this is because of the warning in the subject like of this message. Does anybody know what to do? Ive tried to uninstall pear and installed it again without luck. Iam using PEAR-1.9.0 , php5.2.8, and GeoIP-1.4.6. Thanks David T. # /root/bin/pecl install geoip downloading geoip-1.0.7.tgz ... Starting to download geoip-1.0.7.tgz (9,416 bytes) .done: 9,416 bytes 3 source files, building running: phpize Configuring for: PHP Api Version: 20041225 Zend Module Api No: 20060613 Zend Extension Api No: 220060519 configure.in:145: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached /usr/local/share/autoconf-2.62/autoconf/general.m4:1987: AC_CACHE_VAL is expanded from... /usr/local/share/autoconf-2.62/autoconf/general.m4:2000: AC_CACHE_CHECK is expanded from... aclocal.m4:3565: AC_LIBTOOL_LINKER_OPTION is expanded from... aclocal.m4:5577: _LT_AC_LANG_C_CONFIG is expanded from... aclocal.m4:5472: AC_LIBTOOL_LANG_C_CONFIG is expanded from... aclocal.m4:3089: AC_LIBTOOL_SETUP is expanded from... aclocal.m4:2947: _AC_PROG_LIBTOOL is expanded from... aclocal.m4:2927: AC_PROG_LIBTOOL is expanded from... configure.in:145: the top level configure.in:145: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached aclocal.m4:3528: AC_LIBTOOL_COMPILER_OPTION is expanded from... aclocal.m4:8099: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from... configure.in:145: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached aclocal.m4:6529: _LT_AC_LANG_CXX_CONFIG is expanded from... aclocal.m4:5585: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from... aclocal.m4:4717: _LT_AC_TAGCONFIG is expanded from... configure.in:145: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached /usr/local/share/autoconf-2.62/autoconf/general.m4:1987: AC_CACHE_VAL is expanded from... /usr/local/share/autoconf-2.62/autoconf/general.m4:2000: AC_CACHE_CHECK is expanded from... aclocal.m4:3565: AC_LIBTOOL_LINKER_OPTION is expanded from... aclocal.m4:5577: _LT_AC_LANG_C_CONFIG is expanded from... aclocal.m4:5472: AC_LIBTOOL_LANG_C_CONFIG is expanded from... aclocal.m4:3089: AC_LIBTOOL_SETUP is expanded from... aclocal.m4:2947: _AC_PROG_LIBTOOL is expanded from... aclocal.m4:2927: AC_PROG_LIBTOOL is expanded from... configure.in:145: the top level configure.in:145: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached aclocal.m4:3528: AC_LIBTOOL_COMPILER_OPTION is expanded from... aclocal.m4:8099: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from... configure.in:145: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached aclocal.m4:6529: _LT_AC_LANG_CXX_CONFIG is expanded from... aclocal.m4:5585: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from... aclocal.m4:4717: _LT_AC_TAGCONFIG is expanded from... building in /var/tmp/pear-build-root/geoip-1.0.7 running: /root/temp/geoip/configure checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for a sed that does not truncate output... /usr/bin/sed checking for gcc... gcc
php-general Digest 9 Feb 2010 05:42:27 -0000 Issue 6581
php-general Digest 9 Feb 2010 05:42:27 - Issue 6581 Topics (messages 301888 through 301896): simple WSDL client 301888 by: Robert R Simple code obfuscation 301889 by: Brian Dunning 301891 by: Richard Quadling 301892 by: Ashley Sheridan 301893 by: Phpster 301895 by: Manuel Lemos Re: php selecting multiple stylesheets 301890 by: Stephan Ebelt 301894 by: David Mehler Re: howto do informative error handling without the fatalities 301896 by: Rene Veerman Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Hi, I am writing a simple WSDL client in php as follow: ?php $wsdl = http://staff.um.edu.mt/cabe2/supervising/undergraduate/owlseditFYP/TemperatureService.wsdl ; $client = new SoapClient( http://staff.um.edu.mt/cabe2/supervising/undergraduate/owlseditFYP/TemperatureService.wsdl ); echo(\nReturning value of getTemp() call: . $client-getTemp(12345)); ? when running the script I am getting the following error: Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in /var/www/phpsoap/client5.php:4 Stack trace: #0 [internal function]: SoapClient-__doRequest('?xml version=...', 'http://services...', '', 1, 0) #1 [internal function]: SoapClient-__call('getTemp', Array) #2 /var/www/phpsoap/client5.php(4): SoapClient-getTemp('12345') #3 {main} thrown in /var/www/phpsoap/client5.php on line 4 Am I missing anything? Thanks, R ---End Message--- ---BeginMessage--- Hey all - I'm selling a custom PHP solution to FileMaker users. It uses FileMaker's PHP API, so everyone who has FileMaker Server is already set up to use it, but very few of them have any knowledge of how to set up a server or do anything PHP related. But I do want to add some level of code obfuscation to prevent them from making simple changes to my code that allow them to exceed the privileges they've purchased. I've looked at custom code encryption services like Ioncube and phpCipher, but in my estimation, deploying the needed server-side code for these is going to be beyond the capabilities of a large segment of my customers. I would rather have a few customers cheat me than offer a product that most customers are unable to figure out how to run. So I was thinking of doing something like base64_encoding the crucial chunk of my code (maybe 20 lines worth) and using eval(base64_decode($that_content)) to run it. I figure that will scare away most of the customers who might be able to edit my code. Can anyone suggest something that goes one better? - Brian---End Message--- ---BeginMessage--- On 8 February 2010 19:32, Brian Dunning br...@briandunning.com wrote: Hey all - I'm selling a custom PHP solution to FileMaker users. It uses FileMaker's PHP API, so everyone who has FileMaker Server is already set up to use it, but very few of them have any knowledge of how to set up a server or do anything PHP related. But I do want to add some level of code obfuscation to prevent them from making simple changes to my code that allow them to exceed the privileges they've purchased. I've looked at custom code encryption services like Ioncube and phpCipher, but in my estimation, deploying the needed server-side code for these is going to be beyond the capabilities of a large segment of my customers. I would rather have a few customers cheat me than offer a product that most customers are unable to figure out how to run. So I was thinking of doing something like base64_encoding the crucial chunk of my code (maybe 20 lines worth) and using eval(base64_decode($that_content)) to run it. I figure that will scare away most of the customers who might be able to edit my code. Can anyone suggest something that goes one better? - Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php For simple obfuscation, then maybe making a PHAR app may be of use here. http://docs.php.net/phar -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling ---End Message--- ---BeginMessage--- On Mon, 2010-02-08 at 23:13 +, Richard Quadling wrote: On 8 February 2010 19:32, Brian Dunning br...@briandunning.com wrote: Hey all - I'm selling a custom PHP solution to FileMaker users. It uses FileMaker's PHP API, so everyone who has FileMaker Server is already set up to use it, but very few of them have any knowledge of how
php-general Digest 7 Feb 2010 15:22:26 -0000 Issue 6578
php-general Digest 7 Feb 2010 15:22:26 - Issue 6578 Topics (messages 301856 through 301860): Problem with blocking streams in PHP 301856 by: Phani Raju Issue with blocked socket stream 301857 by: Phani Raju Re: simplexml - can it do what I need? 301858 by: TerryA 301859 by: Carlos Medina Hi list --- justa simple question 301860 by: ebhakt Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- I am trying to open a blocking stream using fsockopen. I want to write and read XML input/output from a server. After opening the steam I will send a XML request to server using the stream. Once this request is sent, I want to keep listening on the port indefinitely. I tried using blocking stream for this with a huge timeout. But had no success as it was not waiting for such a long period. Code: $parser = xml_parser_create(UTF-8); if($stream = @fsockopen($host, $port, $errorno, $errorstr, $timeout)) { stream_set_blocking($stream, 1); stream_set_timeout($stream, TIMEOUT); fwrite($stream, $xml.\n); sleep(2); while (!feof($stream)) { $data = fread($stream, 1024); xml_parse($parser, $data, feof($stream)); } } $xml has the xml to be sent. TIMEOUT is set to 3600*24 and $timeout is set to 300. As it is a blocking stream, till the data is not arrived, feof should not happen. But in this case, the stream is not waiting and returning eof. What is the problem with this code? I tried using even stream_select but faced same issue. ---End Message--- ---BeginMessage--- I am trying to open a blocking stream using fsockopen. I want to write and read XML input/output from a server. After opening the steam I will send a XML request to server using the stream. Once this request is sent, I want to keep listening on the port indefinitely. I tried using blocking stream for this with a huge timeout. But had no success as it was not waiting for such a long period. Code: $parser = xml_parser_create(UTF-8); if($stream = @fsockopen($host, $port, $errorno, $errorstr, $timeout)) { stream_set_blocking($stream, 1); stream_set_timeout($stream, TIMEOUT); fwrite($stream, $xml.n); sleep(2); while (!feof($stream)) { $data = fread($stream, 1024); xml_parse($parser, $data, feof($stream)); } } $xml has the xml to be sent. TIMEOUT is set to 3600*24 and $timeout is set to 300. As it is a blocking stream, till the data is not arrived, feof should not happen. But in this case, the stream is not waiting and returning eof. What is the problem with this code?---End Message--- ---BeginMessage--- Hi Shawn Thanks for answering my query. I have looked at the suggestions: $xml = simplexml_load_file('file.xml', 'SimpleXMLElement', LIBXML_NOCDATA); I am/was able to load the file OK and to access the data by iteration. However, I can't find a way to extract data by attributes. I need something like $string=element idtype=11 lang=fr label=Description - Etage. Obviously, that won't work but that's the result I need. How do I get the data out of one of these elements by specifying its idtype and lang? I've google for hours on this and for another hour on SimpleXMLElement. Terry -- View this message in context: http://old.nabble.com/simplexml---can-it-do-what-I-need--tp27481222p27486649.html Sent from the PHP - General mailing list archive at Nabble.com. ---End Message--- ---BeginMessage--- TerryA schrieb: Hi Shawn Thanks for answering my query. I have looked at the suggestions: $xml = simplexml_load_file('file.xml', 'SimpleXMLElement', LIBXML_NOCDATA); I am/was able to load the file OK and to access the data by iteration. However, I can't find a way to extract data by attributes. I need something like $string=element idtype=11 lang=fr label=Description - Etage. Obviously, that won't work but that's the result I need. How do I get the data out of one of these elements by specifying its idtype and lang? I've google for hours on this and for another hour on SimpleXMLElement. Terry Hi Terry, look at the PHP.NET documentation. There indicates the use of simpleXMLElement structures. If you want to extract elements from this object, please read there how this work. By the way, it would be interesting to see, how your XML is made. May be is usefull to use another class like DOM. regards carlos http://de2.php.net/manual/fr/book.simplexml.php http://de2.php.net/manual/fr/refs.xml.php ---End Message--- ---BeginMessage--- I am developing a website here wherein i need to post a lot of content. I am trying to develop a script to post data automatically to the site the site is designed in drupal any idea/comment or suggestion
php-general Digest 8 Feb 2010 04:20:23 -0000 Issue 6579
php-general Digest 8 Feb 2010 04:20:23 - Issue 6579 Topics (messages 301861 through 301869): Re: Warning? 301861 by: tedd 301863 by: Shawn McKenzie 301867 by: Jochem Maas 301868 by: tedd Re: Issue with blocked socket stream 301862 by: Nathan Rixham Re: Hi list --- justa simple question 301864 by: Al 301865 by: ebhakt 301866 by: shiplu php selecting multiple stylesheets 301869 by: David Mehler Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- At 7:02 PM + 2/6/10, Jochem Maas wrote: Op 2/6/10 4:29 PM, tedd schreef: Hi: Has anyone encountered this warning? Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively in Unknown on line 0 I seem to remember this happening before, but I don't remember the solution. As I remember, it wasn't really reporting an error, but something else. I just don't remember how I dealt with it before. I don't know how to set session.bug_compat_warn to off. doesn't this work?: ?php ini_set('session.bug_compat_warn', 0); ? otherwise you'll have to set it in php.ini (or a .htaccess file) IIRC it means your using session_register() .. which is depreciated and will be dropped in 5.3 ... AFAIK best practices is not to use this function but instead assing to the $_SESSION superglobal. Jochem: Two things: 1. Your solution worked. Setting -- ?php ini_set('session.bug_compat_warn', 0); ? -- worked!!! Thank you. 2. I don't use session_register(). So has to be something else, but I don't know what that might be. Anyone have any ideas? Daniel? Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com ---End Message--- ---BeginMessage--- tedd wrote: Hi: Has anyone encountered this warning? Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively in Unknown on line 0 I seem to remember this happening before, but I don't remember the solution. As I remember, it wasn't really reporting an error, but something else. I just don't remember how I dealt with it before. I don't know how to set session.bug_compat_warn to off. Any ideas? Cheers, tedd PS: I'm using php 5.2.10 and register_global is OFF. This will reproduce the error: session_start(); $_SESSION['test'] = null; $test = 1; It has something to do with using a global var that is the same name as a session var, but the session var has to be null it seems. -- Thanks! -Shawn http://www.spidean.com ---End Message--- ---BeginMessage--- Op 2/7/10 3:40 PM, tedd schreef: At 7:02 PM + 2/6/10, Jochem Maas wrote: Op 2/6/10 4:29 PM, tedd schreef: Hi: Has anyone encountered this warning? Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively in Unknown on line 0 I seem to remember this happening before, but I don't remember the solution. As I remember, it wasn't really reporting an error, but something else. I just don't remember how I dealt with it before. I don't know how to set session.bug_compat_warn to off. doesn't this work?: ?php ini_set('session.bug_compat_warn', 0); ? otherwise you'll have to set it in php.ini (or a .htaccess file) IIRC it means your using session_register() .. which is depreciated and will be dropped in 5.3 ... AFAIK best practices is not to use this function but instead assing to the $_SESSION superglobal. Jochem: Two things: 1. Your solution worked. Setting -- ?php ini_set('session.bug_compat_warn', 0); ? -- worked!!! Thank you. np :) 2. I don't use session_register(). So has to be something else, but I don't know what that might be. Anyone have any ideas? pretty sure Shawn nailed it. Daniel? Cheers, tedd ---End
php-general Digest 6 Feb 2010 11:20:43 -0000 Issue 6576
php-general Digest 6 Feb 2010 11:20:43 - Issue 6576 Topics (messages 301838 through 301842): Re: Appalling Dreamweaver performance 301838 by: haliphax Re: OpenID 301839 by: haliphax 301840 by: Nate Benes Re: PHP generated HTML has submit button which picks up the wrong url. 301841 by: Robert Cummings 301842 by: Michael A. Peters Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Fri, Feb 5, 2010 at 3:59 PM, Lenin doctortomor...@gmail.com wrote: Try the NetBeans then Personally, I've found that Programmer's Notepad 2 is a pretty capable editor, and has some nice features such as auto-closing elements when working with markup languages (HTML, XML, XSL, XHTML, etc.). http://www.pnotepad.org // Todd ---End Message--- ---BeginMessage--- On Mon, Feb 1, 2010 at 9:54 PM, Michael A. Peters mpet...@mac.com wrote: Daevid Vincent wrote: -Original Message- From: Al [mailto:n...@ridersite.org] Sent: Monday, February 01, 2010 12:09 PM To: php-gene...@lists.php.net Subject: [PHP] OpenID This is a bit off subject, but What is your opinion on OpenID? Failed gimick. Tried to resurface again about a year ago. Still seems like failure. ++ Session ID hijacking is bad enough, it gives the malicious user access to one resource. OpenID hijacking gives the malicious user access to a ton of resources. And what does a user do when their OpenID provider disappears? I think Michael hit the nail on the head as far as my concerns are.. well.. concerned. :) Google's OpenID provider seems like it would be around forever and whatnot, but if you're going to rely on one of the big OpenID providers, then it would appear that OpenID itself is useless. Facebook's OpenID, etc., are on shaky ground at best. I use a few sites that leverage OpenID as their login process, and I've got to say--it's very convenient. However, I only use my Google account for OpenID logins, so to me, it's really just a Google connector. I commend everyone involved for their effort, but I think the underlying principles need to be re-examined. It feels like they rushed the whole concept into production before too many of the fundamental issues had been discussed and dealt with. My 2c. // Todd ---End Message--- ---BeginMessage--- There is a openID mailing list set up if anyone has any technical questions, gene...@openid.net -Nate On Fri, Feb 5, 2010 at 4:57 PM, haliphax halip...@gmail.com wrote: On Mon, Feb 1, 2010 at 9:54 PM, Michael A. Peters mpet...@mac.com wrote: Daevid Vincent wrote: -Original Message- From: Al [mailto:n...@ridersite.org] Sent: Monday, February 01, 2010 12:09 PM To: php-gene...@lists.php.net Subject: [PHP] OpenID This is a bit off subject, but What is your opinion on OpenID? Failed gimick. Tried to resurface again about a year ago. Still seems like failure. ++ Session ID hijacking is bad enough, it gives the malicious user access to one resource. OpenID hijacking gives the malicious user access to a ton of resources. And what does a user do when their OpenID provider disappears? I think Michael hit the nail on the head as far as my concerns are.. well.. concerned. :) Google's OpenID provider seems like it would be around forever and whatnot, but if you're going to rely on one of the big OpenID providers, then it would appear that OpenID itself is useless. Facebook's OpenID, etc., are on shaky ground at best. I use a few sites that leverage OpenID as their login process, and I've got to say--it's very convenient. However, I only use my Google account for OpenID logins, so to me, it's really just a Google connector. I commend everyone involved for their effort, but I think the underlying principles need to be re-examined. It feels like they rushed the whole concept into production before too many of the fundamental issues had been discussed and dealt with. My 2c. // Todd ---End Message--- ---BeginMessage--- Joseph Thayne wrote: What you maybe ought to consider is using several submit buttons, and give each a name and a value. That way, your PHP script can check for a specifically named variable sent from the form. That way, you keep many people happy, and your site still works perfectly. The problem with doing it that way is that IE is not happy with multiple submit buttons in a single form. I've never seen IE have a problem with multiple submit buttons. I'm guessing you're doing something wrong. I often have multiple submit buttons. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP ---End Message
php-general Digest 7 Feb 2010 01:41:54 -0000 Issue 6577
php-general Digest 7 Feb 2010 01:41:54 - Issue 6577 Topics (messages 301843 through 301855): Help with regex (search/replace) please 301843 by: Ryan S 301844 by: Phpster 301845 by: Ashley Sheridan 301846 by: Ryan S 301847 by: Ryan S 301848 by: Ashley Sheridan 301852 by: Al 301854 by: Ryan S Warning? 301849 by: tedd 301853 by: Jochem Maas simplexml - can it do what I need? 301850 by: TerryA 301851 by: Shawn McKenzie Re: PHP User 301855 by: T L Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Hey guys, As many of you might know, i totally suck at regex..so would really appreciate some help here. Basically i have a html page with a lot of textboxes,radios,checkboxes etc i need your help in the form of a regex so that when i give it the name and value it gives me the entire code of that checkbox. for example here are 2 checkboxes: input type=checkbox name=something value=1 / input type=checkbox name=something2 value=2 id=something onClick=javascript_code_etc() onSomething=lots of js cod here() / so if i want the second checkbox code i was thinking of something like this: $the_name=something2; $the_value=2; $fetched=getCheckboxFromHTML($the_name,$the_value); and then if successful the variable $fetched would contain input type=checkbox name=something2 value=2 id=something onClick=javascript_code_etc() onSomething=lots of js cod here() / the idea is that i would use the contents of $fetch to add some code before the end just before the greater than symbol, and do a str_replace(). What do you think? Critique of my logic above too is welcome! Thanks! Ryan ---End Message--- ---BeginMessage--- Why not just pass the value in the onclick? Onclick=doSomething(this); Would give you simple access to all the properties of that element. This.value would pass just the value. Bastien Sent from my iPod On Feb 6, 2010, at 9:43 AM, Ryan S gen...@yahoo.com wrote: Hey guys, As many of you might know, i totally suck at regex..so would really appreciate some help here. Basically i have a html page with a lot of textboxes,radios,checkboxes etc i need your help in the form of a regex so that when i give it the name and value it gives me the entire code of that checkbox. for example here are 2 checkboxes: input type=checkbox name=something value=1 / input type=checkbox name=something2 value=2 id=something onClick=javascript_code_etc() onSomething=lots of js cod here() / so if i want the second checkbox code i was thinking of something like this: $the_name=something2; $the_value=2; $fetched=getCheckboxFromHTML($the_name,$the_value); and then if successful the variable $fetched would contain input type=checkbox name=something2 value=2 id=something onClick=javascript_code_etc() onSomething=lots of js cod here() / the idea is that i would use the contents of $fetch to add some code before the end just before the greater than symbol, and do a str_replace(). What do you think? Critique of my logic above too is welcome! Thanks! Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- On Sat, 2010-02-06 at 06:43 -0800, Ryan S wrote: Hey guys, As many of you might know, i totally suck at regex..so would really appreciate some help here. Basically i have a html page with a lot of textboxes,radios,checkboxes etc i need your help in the form of a regex so that when i give it the name and value it gives me the entire code of that checkbox. for example here are 2 checkboxes: input type=checkbox name=something value=1 / input type=checkbox name=something2 value=2 id=something onClick=javascript_code_etc() onSomething=lots of js cod here() / so if i want the second checkbox code i was thinking of something like this: $the_name=something2; $the_value=2; $fetched=getCheckboxFromHTML($the_name,$the_value); and then if successful the variable $fetched would contain input type=checkbox name=something2 value=2 id=something onClick=javascript_code_etc() onSomething=lots of js cod here() / the idea is that i would use the contents of $fetch to add some code before the end just before the greater than symbol, and do a str_replace(). What do you think? Critique of my logic above too is welcome! Thanks! Ryan Rather than a regex, you're probably better off using something like DomDocument, where you can iterate over all of the input elements in the document, and check the attributes of each one to check if they match
php-general Digest 5 Feb 2010 22:49:21 -0000 Issue 6575
php-general Digest 5 Feb 2010 22:49:21 - Issue 6575 Topics (messages 301827 through 301837): Re: Facebook PHP compiler 301827 by: German Geek 301831 by: ebhakt Re: HTML plain text in Outlook 2007 301828 by: Phpster 301829 by: Ashley Sheridan 301832 by: Robert Cummings Re: How to change a filename for download (e.g. jpeg, pdf etc.) 301830 by: SED PHP generated HTML has submit button which picks up the wrong url. 301833 by: Mary Anderson 301834 by: Joseph Thayne 301836 by: Ashley Sheridan 301837 by: Joseph Thayne Re: Appalling Dreamweaver performance 301835 by: Lenin Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Yes. Totally agree. Would like to try asap. ++Tim Hinnerk Heuer++ http://www.ihostnz.com On 3 February 2010 10:15, Adam Richardson simples...@gmail.com wrote: Looks very promising !!! On Tue, Feb 2, 2010 at 1:12 PM, Robert Cummings rob...@interjinn.com wrote: Cesar D. Rodas wrote: Hello, Have you guys checked this PHP to C++ converter from the Facebook People? http://developers.facebook.com/news.php?blog=1story=358 Very interesting... I heard about this a few days ago on Slashdot. Most people figured it would be a compiler of some sort, though it's interesting they chose C++ instead of C as Roadsend has done. I also wonder why they didn't just jump on board with Roadsend, but perhaps they wanted full control (which makes sense from the perspective of their needs). Either way, it's another tool that can only be good for PHP. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com ---End Message--- ---BeginMessage--- Thanks for th einfo man!! On Fri, Feb 5, 2010 at 3:35 AM, German Geek geek...@gmail.com wrote: Yes. Totally agree. Would like to try asap. ++Tim Hinnerk Heuer++ http://www.ihostnz.com On 3 February 2010 10:15, Adam Richardson simples...@gmail.com wrote: Looks very promising !!! On Tue, Feb 2, 2010 at 1:12 PM, Robert Cummings rob...@interjinn.com wrote: Cesar D. Rodas wrote: Hello, Have you guys checked this PHP to C++ converter from the Facebook People? http://developers.facebook.com/news.php?blog=1story=358 Very interesting... I heard about this a few days ago on Slashdot. Most people figured it would be a compiler of some sort, though it's interesting they chose C++ instead of C as Roadsend has done. I also wonder why they didn't just jump on board with Roadsend, but perhaps they wanted full control (which makes sense from the perspective of their needs). Either way, it's another tool that can only be good for PHP. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com -- Bhaskar Tiwari GTSE Generalist Directory Services Microsoft \ All we have to decide is what to do with the time that has been given to us bhaskartiw...@officeliveusers.com http://www.ebhakt.com/ http://fytclub.net/ http://bhaskartiwari.web.officelive.com/ http://ebhakt.spaces.live.com/ ---End Message--- ---BeginMessage--- Ire ently needed to do this for a client as well. I took their word doc and converted it to HTML with open office. This created a template that I just do some search and replace to fill in the criteria. This has worked very well with outlook and hotmail and gmail. Not sure if it will fit your needs, but it could be worth a try. Bastien Sent from my iPod On Feb 5, 2010, at 5:32 AM, Richard Quadling rquadl...@googlemail.com wrote: On 4 February 2010 16:44, Skip Evans s...@bigskypenguin.com wrote: Hey all, First, let me say thanks for all the advice on Magento, and especially to Ryan who has used the beast and gave some great advice on skinning, links to some good docs and a book just for my designer. We'll be using and I'm looking forward to learning it. But anyway... I'm doing some maintenance work on a system that sends an email message using the multi-part boundaries to include both a plain text version and an HTML version of an email. I've read up on this before, but never