Re: [PHP] Missing email
Hi Daniel, I think that the robot that manage the list is not sending you your own emails. Gerardo. On Sat, Oct 20, 2012 at 10:38 AM, Daniel Brown danbr...@php.net wrote: On Sat, Oct 20, 2012 at 5:00 AM, Karl DeSaulniers k...@designdrumm.com wrote: @Moderator Any reason why my emails do not post or at least dont post for hours later? There is no moderator on this list. I'm probably about as close as it comes. Can you explain more about the problems you're experiencing so that I can look into it further? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Gerardo Benitez - Programador Web Freelance
Re: [PHP] PHP Emacs
Hi Mihamina, I think that a few number of people use Emacs to write Php, in fact for proffesionals porpuse the people use a IDE for Php, like Netbeams, Eclipse PDT or Zend Studio. Regards, Gerardo On Wed, May 2, 2012 at 8:21 AM, Mihamina Rakotomandimby miham...@rktmb.orgwrote: Hi all, For curiosity, are there people here using Emacs to code in PHP? What modes do you add? cedet, ecb,... I see (just for the example) that Drupal has a short documentation page for Emacs http://drupal.org/node/59868 Have you got some in your bookmarks for general PHP coding? -- RMA. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Gerardo Benitez - Programador Web Freelance
Re: [PHP] Best PHP Template System
I have used smarty in project with pure php and the template system of Zend Framework in proyects done in Zend Framework, both are fine for me. Gerardo. On Thu, Apr 26, 2012 at 5:48 AM, Simon Schick simonsimc...@googlemail.comwrote: On Thu, Apr 26, 2012 at 12:07 AM, Yared Hufkens y4...@yahoo.de wrote: Why use an external engine which slows your scripts down to do something which can easily be done by PHP itself? PHP is imho the best template engine for PHP. With PHP 5.4, it became even easier because ?=$do-somestuff()? can be used without short_open_tag enabled. However, you always schould divide UI and backend. Hi, If you like to write an xml-template by having purely xml, you could also use OPT (Open Power Template). You can f.e. add a attribute to a tag by decision by writing this code: div opt:attribute name=class value=highlight opt:if=$highlightDiv/ Content /div Feels a bit cleaner to me than writing div ?php if ($highlightDiv) : ?class=highlight?php endif; ? Content /div -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Gerardo Benitez - Programador Web Freelance
Re: [PHP] PHP Mailto() - Google now displaying HTML as Plain Text
Do you know if the mailto script allow set headers? Probably you must set a html header, something like this $headers .= 'Content-type: text/html; charset=iso-8859-1' . \r\n; Regards, Gerardo. On Tue, May 1, 2012 at 5:14 PM, Marco Behnke ma...@behnke.biz wrote: Am 29.04.2012 22:31, schrieb Terry Ally (Gmail): Hi all, I have been using a mailto() script for the last three years and from April 25, 2012 incoming HTML email in Goggle mail is displaying as Plain Text. Something clearly changed with Google. Perhaps there is some change I need to make with my script?? $message .= pbMessage:/b**blockquote .$m./blockquote/p; As far as I can see your main html tags are missing? $message = 'htmlbody' . $message . '/body/html'; -- Marco Behnke Dipl. Informatiker (FH), SAE Audio Engineer Zend Certified Engineer PHP 5.3 Tel.: 0174 / 9722336 e-Mail: ma...@behnke.biz Softwaretechnik Behnke Heinrich-Heine-Str. 7D 21218 Seevetal http://www.behnke.biz -- Gerardo Benitez - Programador Web Freelance
Re: [PHP] How in PDOStatement-fetchAll use PDO::FETCH_GROUP for grouping more than one column simultaneously?
Hi Mikhail, I think FETCH_GROUP not work in these way, anyway, do you need work with arrays? you can do the same with a simple record, i think... Gerardo. On Tue, May 10, 2011 at 5:03 PM, Михаил Гаврилов mikhail.v.gavri...@gmail.com wrote: How in PDOStatement-fetchAll use PDO::FETCH_GROUP for grouping more than one column simultaneously? For example col1 col2 col3 col4 13 p1 1 boroda 13 p1 1 boroda 2 13 p1 2 boroda 3 13 p2 2 boroda 4 13 p2 2 boroda 5 14 p3 2 boroda 6 14 p4 2 boroda 7 14 p4 2 boroda 8 $data = $sth-fetchAll(PDO::FETCH_ASSOC | PDO::FETCH_GROUP, 2); Expected result for $data: Array ( [13] = Array ( [p1] = Array ( [0] = Array ( [col3] = 1 [col4] = boroda ) [1] = Array ( [col3] = 1 [col4] = boroda 2 ) [2] = Array ( [col3] = 2 [col4] = boroda 3 ) ) [p2] = Array ( [0] = Array ( [col3] = 2 [col4] = boroda 4 ) [1] = Array ( [col3] = 2 [col4] = boroda 5 ) ) ) [14] = Array ( [p3] = Array ( [0] = Array ( [col3] = 2 [col4] = boroda 6 ) ) [p4] = Array ( [0] = Array ( [col3] = 2 [col4] = boroda 7 ) [1] = Array ( [col3] = 2 [col4] = boroda 8 ) ) ) -- Best Regards, Mike Gavrilov. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Gerardo Benitez - www.webseficientes.com.ar Diseño web, programación, Seo
Re: [PHP] gd Graphics Library Question (EXIF)
Hi Mitch, you could try with http://www.php.net/manual/en/function.exif-read-data.php I did a test with image jpg and this was the result: FILE . FileName: bruce_lee_black_white.jpgbr/ FILE . FileDateTime: 1304086298br/ FILE . FileSize: 33464br/ FILE . FileType: 2br/ FILE . MimeType: image/jpegbr/ FILE . SectionsFound: COMMENTbr/ COMPUTED . html: width=353 height=450br/ COMPUTED . Height: 450br/ COMPUTED . Width: 353br/ COMPUTED . IsColor: 1br/ COMMENT . 0: LEAD Technologies Inc. V1.01br/ Anyway taking account *EXIF headers tend to be present in JPEG/TIFF images generated by digital cameras, but unfortunately each digital camera maker has a different idea of how to actually tag their images, so you can't always rely on a specific Exif header being present. * Regards. Gerardo. On Thu, Apr 28, 2011 at 11:33 PM, Mitch mit...@mme-ia.net wrote: I have written a lightweight, easy to use photo album system in HTML/PHP/MySQL.In addition to the Photo Album side I have written a series of Admin Utilities to manage it with. One of the administrative utilities uploads photos from my local drive, resizes them to be more efficient on disk space, creates thumbnails and populates the database with as much default data as can be deduced. After all of this was written, I decided to see if I could pull EXIF data to supply some of the technical data for the DB. To my surprise, the only EXIF data in the JPEG files was data in the File, Computed and Comments sections. Why don't the gd utilities retain the original EXIF data? Is there any way to do so? I use the following gd utilities to resize and create the new JPEG image files: imagecreatefromjpeg imagesx imagesy imagercreatetruecolor imagecopyresized imagejpeg Thanks in advance, Mitch -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Gerardo Benitez - www.webseficientes.com.ar Diseño web, programación, Seo
Re: [PHP] Wiki formatting class or something similar
Hi Andre, I did a intranet with TextWiki ( http://pear.php.net/package/Text_Wiki/redirected ) TextWiki is a reliable Class to create Wiki using Php. Regards. Gerardo. On Fri, Apr 29, 2011 at 6:04 PM, Andre Polykanine an...@oire.org wrote: Hi everyone, I allow my users to put some Html into their blogs. I filter it using a great tool called HtmLawed and written by Dr. Santosh Patnaik (if you're reading this, many thanks to you!). However, I would like to give them a possibility to mark-up their text in a more convenient way for beginners (such as Wiki or something similar). I searched through http://phpclasses.org/ but didn't find anything. Could you suggest me something? And one more question: maybe some of you already have a handy solution to process smilies? Say, a user writes :) and this is replaced by an image in my directory. Thanks in advance! -- With best regards from Ukraine, Andre Skype: Francophile Twitter: http://twitter.com/m_elensule Facebook: http://facebook.com/menelion -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Gerardo Benitez - www.webseficientes.com.ar Diseño web, programación, Seo
Re: [PHP] something about dates in mysql
Hi Webforlaget! $thisdate is today? $today = date('Y-m-d); else why, you dont use $thisdate as: $thisdate = $year-$mth-$day ? use quotes for $thisdate in sql query. Regards. Gerardo On Thu, Mar 3, 2011 at 7:09 AM, Webforlaget.dk i...@web-forlaget.dk wrote: I need help to know Why this dont work ? - $thisdate =date(Y-m-d,mktime(0,0,0,$mth, $day, $year)); $sql = SELECT id,case,startdate,enddate FROM table WHERE startdate=$thisdate AND enddate=$thisdate ORDER BY startdate; - The result should be an array whith open cases at $thisdate, but nothing appear. Is it something about dates in mysql ? Thanks for any advice. Best regards, Venlige hilsner Rolf Brejner -- Gerardo Benitez - www.webseficientes.com.ar Diseño web, programación, Seo
Re: [PHP] new keyword combined with other things...
Try with $result = Object::method(); this is a static method in a class. the operator - is access to a member in an object. Gerardo. On Tue, Dec 7, 2010 at 12:40 PM, Alexandru Patranescu dreal...@gmail.comwrote: In many other languages this will work: *$result = new Object() - method();* But in php, it fails at parsing. I've tried with parenthesis around new but nothing. Anyhow, as I saw later, *new* operator has precedence over others so this couldn't be a solution. I know a static function can be defined and the above statement can transform into *$result = Object::getNewInstance() - method()* but is there any way to write it directly? and if not, why isn't this implemented yet and when will it be? best regards, Patranescu Alexandru -- Gerardo Benitez - www.webseficientes.com.ar Diseño web, programación, Seo
Re: [PHP] combo box validation
Hi Dave, In general, you can validate this condition with javascript before to send the form, and if some errors exist, the form is not submitted. or validate the conditions in the server side with php. Gerardo. www.webseficientes.com.ar On Mon, Jun 7, 2010 at 2:49 PM, David Mehler dave.meh...@gmail.com wrote: Hello, I've got a form with two combo boxes, one for the month one for the day. Both are required. I've got code that checks the post submission to ensure neither is empty. My problem is that if a user does not select anything in the combo boxes January first is sent, this i don't want. If they haven't selected anything i'd like that to show as an error. Thanks. Dave. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session variables in tmp
Hi Stephen, you can try setting the session path using session_save_path http://www.php.net/manual/en/function.session-save-path.php. Gerardo www.webseficientes.com.ar On Sat, Jun 5, 2010 at 2:18 AM, Stephen Sunderlin stephen.sunder...@verizon.net wrote: trying out a CentOS release 5.2 (Final) V4_1_0 on AWS. Was working fine and now it seems that php has stopped writing any session variable to /tmp. I was cleaning up the user table in mysql and limiting permissions. Not sure that this would have anything to do with it. Restarted apache/mysql. tmp is set to drwxrwxrwt 4 root root 4096 Jun 5 00:46 tmp PHP 5.2.4 MySQL 5.0.45 any thought on where else to look. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Gerardo Benitez
Re: [PHP] combo box validation
your advice is welcome! Gerardo www.webseficientes.com.ar On Tue, Jun 8, 2010 at 1:01 PM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: On Tue, 2010-06-08 at 12:57 -0300, Gerardo Benitez wrote: Hi Dave, In general, you can validate this condition with javascript before to send the form, and if some errors exist, the form is not submitted. or validate the conditions in the server side with php. Gerardo.www.webseficientes.com.ar On Mon, Jun 7, 2010 at 2:49 PM, David Mehler dave.meh...@gmail.com wrote: Hello, I've got a form with two combo boxes, one for the month one for the day. Both are required. I've got code that checks the post submission to ensure neither is empty. My problem is that if a user does not select anything in the combo boxes January first is sent, this i don't want. If they haven't selected anything i'd like that to show as an error. Thanks. Dave. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php You should change that to 'and' instead of an 'or'. Javascript validation is nice, but you should always validate everything on the server too. Thanks, Ash http://www.ashleysheridan.co.uk -- Gerardo Benitez
Re: [PHP] session variables in tmp
Ok, that usually happens. Gerardo www.webseficientes.com.ar On Tue, Jun 8, 2010 at 1:48 PM, Stephen Sunderlin stephen.sunder...@verizon.net wrote: Thanks Gerardo. I send a large dump.sql file to my /tmp dir and filled up the remaining space so PHP was not able to write any more session variable. Took me a little while to figure that one out. Thanks for your response. On Tue, 08 Jun 2010 12:00:23 -0400, Gerardo Benitez gerardobeni...@gmail.com wrote: Hi Stephen, you can try setting the session path using session_save_path http://www.php.net/manual/en/function.session-save-path.php. Gerardo www.webseficientes.com.ar On Sat, Jun 5, 2010 at 2:18 AM, Stephen Sunderlin stephen.sunder...@verizon.net wrote: trying out a CentOS release 5.2 (Final) V4_1_0 on AWS. Was working fine and now it seems that php has stopped writing any session variable to /tmp. I was cleaning up the user table in mysql and limiting permissions. Not sure that this would have anything to do with it. Restarted apache/mysql. tmp is set to drwxrwxrwt 4 root root 4096 Jun 5 00:46 tmp PHP 5.2.4 MySQL 5.0.45 any thought on where else to look. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ -- Gerardo Benitez
Re: [PHP] Finding out the first possible booking date with php
Hi Merlin, I think that you could do a table with the periods such as ID Star End is_free 1 1.12 14.12 1 2 4.12 18.12 0 3 5.12 19.12 0 then you can search the first period free with a query Mysql $sql = SELECT id FROM periods where is_free = '1' order by id asd i hope that i have helped you Gerardo Benitez. On Thu, Dec 3, 2009 at 5:26 AM, Merlin Morgenstern merli...@fastmail.fmwrote: Hello everybody, I am pretty much stuck with a problem and I was hoping to find some help here with you guys. A PHP Script with MySQL as DB has to find out the first possible booking period available. I can't figure out the logic behind and if there is a trick with PHP to do it. Following facts: - There can only be 3 bookings in the same time period - I want to find out the first period available - There should be a less as possible periods that are unbooked Example: Start End 1.1214.12 4.1218.12 5.1219.12 In this example the first possible booking would be 14.12 - 28.12 as this is a time period where I can offer a place that holds a max of 3 bookings. My Problem now is how to pull this info and process it? Should I get all dates out of the DB and process them via PHP, or do a magical MYSQL Query (which by the way seems not to be possible in that case in my knowledge) ? Let's asume we go with PHP. Has somebody an idea how to form that kind of logic? Thank you for ANY help, merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Gerardo Benitez
Re: [PHP] Trapping failure of file_get_contents()
Hi Marshall, the function file_get_contents may have problem with large files. You could try get the file using fread and feof. Here i put a example $contents = ''; while(!feof($stream)){ $contents .= fread($stream, 8192); } Gerardo Benitez. On Thu, Oct 22, 2009 at 12:38 PM, Marshall Burns listma...@mburns.comwrote: I have a script that downloads a sequence of files online. Every hundred files or so, it fails with: == Warning: file_get_contents(URL) []: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in script.php on line number Fatal error: Maximum execution time of 30 seconds exceeded in script.php on line number == I have tried to trap this so that I could loop back and let the script try the access again. Failing that, I've also tried to get a shutdown function to give me a restart link. The code for this is: == $bWorking = true; . $bDone = false; while(! $bDone) {$sFil = file_get_contents($sURL); if($sFil) {$sFileSize = file_put_contents('image/' . $sID . '.jpg', $sFil); $bDone = true;} else {echo('brDL error on ' . $sURL); $sFileSize = 'DL error'; set_time_limit(30);} echo(', got ' . $sFileSize); } . $bWorking = false; register_shutdown_function('ReadFileTimeout'); function ReadFileTimeout() // Provide a link to restart processing after a timeout in file_get_contents(). {global $bWorking, $sParameters; if($bWorking) echo('pa HRef=script.php?parameters=' . $sParameters . ' target=_blankRestart/a'); } == None of that is working. I guess the loop doesn't work because the warning is emitted after the script has already been aborted by the timeout. But in that case, the shutdown function should kick in, but the link is not being output. So two questions: (a) Is there a way to get file_get_contents() to stop trying before the script time limit is reached, so that my loop could work? (b) Why is the shutdown function not working? Thanks for your help. Marshall -- Gerardo Benitez
[PHP] avoid Denial of Service
Hi everybody! I want to get some tips about how avoid a attack of Denial of service. May be somebody can about your experience with Php o some configuration of apache, o other software that help in these case. Thanks in advance. -- Gerardo Benitez
Re: [PHP] Parse Question Using list()
Use the tool that PHP provides for such problems. http://php.net/fgetcsv fgetcsv is very useful, here a example: ?php $row = 1; /* load file*/ $handle = fopen(log.csv, r); /* read line by line */ while (($data = fgetcsv($handle, 1000, ,)) !== FALSE) { $num = count($data); echo p $num fields in line $row: br //p\n; $row++; for ($c=0; $c $num; $c++) { echo $data[$c] . br /\n; } } fclose($handle); ? -- Gerardo Benitez