Re: [PHP] Load testing an app

2013-04-22 Thread Adam Richardson
On Mon, Apr 22, 2013 at 10:41 PM, Andrew Ballard wrote: > The other developer in our office spent some time profiling the site with > xdebug and found that an exec() call to netsh used on a couple pages seems > to take 2-4 seconds to complete. Unfortunately, those exec() calls are the > one funct

Re: [PHP] Close enough to Friday...

2013-02-28 Thread Adam Richardson
On Thu, Feb 28, 2013 at 10:19 PM, tamouse mailing lists wrote: > > Congratulations on ditching the Dreamweaver Templates! > > Now, as to preprocessing: how does this benchmark out? Have you > noticed a significant different in processing time, memory usage, disk > usage, etc? Well, it depends...

[PHP] Close enough to Friday...

2013-02-28 Thread Adam Richardson
Just wanted to toss this out as something I quick developed in case it could help others: https://github.com/AdamJonR/PreHP Essentially, I just wanted a quick pre-processor that would work with PHP so I could limit some of the processing done at runtime. As opposed to C macros, I wanted to design

Re: [PHP] Arrays

2013-02-25 Thread Adam Richardson
On Mon, Feb 25, 2013 at 8:40 PM, Karl DeSaulniers wrote: > Hi Guys/Gals, > If I have an multidimensional array and it has items that have the same name > in it, how do I get the values of each similar item? > > EG: > > specialservices => array( > specialservice => array( >

Re: [PHP] if (empty versus if (isset

2013-02-19 Thread Adam Richardson
On Tue, Feb 19, 2013 at 9:29 PM, John Taylor-Johnston wrote: > > What is the difference between? > > if (empty... http://www.php.net/manual/en/function.empty.php "Determine > whether a variable is empty" > and > if (isset... http://php.net/manual/en/function.isset.php "Determine if a > variable

Re: [PHP] Affordable low-fee e-commerce - DIY?

2013-02-18 Thread Adam Richardson
On Mon, Feb 18, 2013 at 1:26 PM, George Langley wrote: > Hi all. Am wanting to build a site where people can donate $1.00 but is > not for charity or other non-profit per se. So if I use PayPal, with their > 2.9% + .30 per transaction fee, that equals .33 cents for each dollar - > that's a full th

Re: [PHP] fopen and load balancing

2013-02-10 Thread Adam Richardson
On Sun, Feb 10, 2013 at 5:41 PM, Adam Tong wrote: > Hi, > > We had an issue with the code of a junior php developer that used > fopen to load images using the url of the companies website that is > load balanced. > > We could not the detect the problem in dev and test because the dev > and test s

Re: [PHP] newbie with imap_mail_move

2013-02-09 Thread Adam Richardson
On Sat, Feb 9, 2013 at 7:29 PM, dealTek wrote: > > Warning: reset() [function.reset]: Passed variable is not an array or > object in /home/bbeast/public_html/emtest/em-move.php on line 91 > > if ($mbox_name != $newmbox_name) { > reset($msg_no); > $messageset = implode (",",$msg_no); > ima

Re: [PHP] Integer

2013-02-01 Thread Adam Richardson
On Fri, Feb 1, 2013 at 11:40 PM, Ron Piggott wrote: > How can I get the 25 by itself? > - I want to drop the “2.” and remove all the zero’s > > Would it be best to turn this into a STRING? > I would recommend turning it into a string, splitting the string at the decimal, then scanning the second

Re: [PHP] seg fault with pecl ps extension

2012-11-28 Thread Adam Richardson
On Thu, Nov 29, 2012 at 12:18 AM, Ray wrote: > ...I first had to deal with a > change in the way call by reference worked in php. (I had to delete the '&' > from some function calls.) Did that correspond to the 5.3 -> 5.4 upgrade? > Yep, 5.4 removed call-time pass-by-reference: http://www.php.ne

Re: [PHP] seg fault with pecl ps extension

2012-11-28 Thread Adam Richardson
On Wed, Nov 28, 2012 at 10:50 PM, Ray wrote: > Hello, > I'm not positive if this is the right list, or if other info is required. > If this is the wrong list, please recomend a better one. If other info is > desired, just ask. > > I am having some problems with the PECL PS (postscript) extension.

Re: [PHP] globbed includes?

2012-11-18 Thread Adam Richardson
On Sun, Nov 18, 2012 at 3:29 PM, tamouse mailing lists < tamouse.li...@gmail.com> wrote: > There are certain times I'd like to include all files in a given > directory (such as configuration stuff that is split out by type, a la > apache conf.d). Anyone have something handy that implements that? >

Re: [PHP] serialize() casts numeric string keys to integers

2012-11-12 Thread Adam Richardson
On Mon, Nov 12, 2012 at 2:18 AM, eyal.t wrote: > Hi all, > > Was wondering whether the fact that serialize() casts numeric string keys > to integers, is a bug, intended behaviour, or just something that is minor > enough not to have bothered anyone yet? > This behavior is consistent with the sta

Re: [PHP] TURBOPY cloud framework + IDE beta available NOW

2012-10-31 Thread Adam Richardson
On Wed, Oct 31, 2012 at 4:46 PM, Marco Behnke wrote: > > 1. If you have code using static methods and members and use phpunit for > testing it, you have to either make sure, that everything is properly > resetted after use OR have to run phpunit in a mode where every test is run > in a single php

Re: Re: [PHP] TURBOPY cloud framework + IDE beta available NOW

2012-10-31 Thread Adam Richardson
On Tue, Oct 30, 2012 at 7:33 AM, ma...@behnke.biz wrote: > > In times of testability and several design patters, the use of static > calls is > really outdated. > I understand that you can read and write the invocations of the methods > much > faster, but you should think more to the future on th

Re: [PHP] PDO

2012-10-22 Thread Adam Richardson
On Mon, Oct 22, 2012 at 5:27 PM, Silvio Siefke wrote: > Hello, > > i have built php 5.4.7 on Ubuntu with the configure Arguments like on my > Gentoo System. But on Gentoo run the website without Problems, under Ubuntu > want not work. I become in error.log: > > [22-Oct-2012 21:15:00 UTC] PHP Fatal

Re: [PHP] PHP to decode AES

2012-10-18 Thread Adam Richardson
On Thu, Oct 18, 2012 at 12:06 PM, Rick Dwyer wrote: > Hello all. > > Has anyone ever tried to decode a JAVA AES/CBC encrypted string with PHP > before? > > I found a tutorial online with the following code to use as starting point, > but it fails to return anything readable: > > $code ='Hello Wo

Re: [PHP] Wrong time being displayed by PHP!

2012-10-16 Thread Adam Richardson
On Tue, Oct 16, 2012 at 2:02 PM, Richard S. Crawford wrote: > The value of date.timezone in php.ini is set to "America/Los_Angeles". > > The local time is 11:02 a.m. Yet the output of date("h:i a e") is: > > 02:02 pm America/Los_Angeles > > which is three hours ahead of the real time. > > Why is t

Re: [PHP] stream_read function for registered wrapper class.

2012-09-19 Thread Adam Richardson
On Wed, Sep 19, 2012 at 12:43 PM, Rob wrote: > I have a very large XML file that I have to process. It's about 7 GB. > Some of the individual elements that I need are larger than 8192 bytes. > I'm trying to write a Stream wrapper class to give me a specific element > at a time, but I keep running

Re: [PHP] PHP Threading on Windows

2012-09-14 Thread Adam Richardson
On Fri, Sep 14, 2012 at 9:40 PM, Joe Watkins wrote: > https://github.com/krakjoe/pthreads > > Windows Download on downloads page, it's a couple of days behind. Keep > watching ... enough to get you started ... That's pretty slick, Joe. Nice work! Adam -- Nephtali: A simple, flexible, fast, an

Re: [PHP] PHP array unions

2012-09-14 Thread Adam Richardson
On Fri, Sep 14, 2012 at 2:30 AM, Matijn Woudt wrote: > > It doesn't need to be clunky.. just use array_flip and you've got the old > array again.. > Well, array_flip has it's own potential issues (duplicate values are lost, so my example of using zeros would not work.) I suppose I could duplicate

Re: [PHP] PHP array unions

2012-09-13 Thread Adam Richardson
On Wed, Sep 12, 2012 at 2:37 PM, Sebastian Krebs wrote: > Hi, > > In PHP the array is in fact a hash map, but especially it is _used_ for > nearly everything map-, set-, ...-like thing. So in short: The is no > operator or built-in function, that merges two arrays _and_ treat them as > set (instea

Re: [PHP] The end of "mysql"

2012-09-07 Thread Adam Richardson
On Fri, Sep 7, 2012 at 9:58 PM, Jim Giner wrote: > So with the announced end of the mysql functions (and switching to a > different extension), one would think that my isp/hoster would be a bit more > interested in my dilemma. I tried today to create my first mysqli-based > test script and found

Re: [PHP] templeting

2012-09-04 Thread Adam Richardson
On Mon, Sep 3, 2012 at 9:14 PM, David McGlone wrote: > Does anyone use any templeting system for any projects? If so what would > anyone recommend? I looked at Code Ignitor, but it seems the templeting system > is optional and left out by default. > > -- > Regards > David M. Well, for a different

Re: [PHP] OT (maybe not): Drupal vs WordPress

2012-08-28 Thread Adam Richardson
On Tue, Aug 28, 2012 at 3:07 PM, Larry Garfield wrote: > Only semi-joking line that's been making the rounds lately: > > If you want to build a blog, use Wordpress. > If you want to build Wordpress, use Drupal. > If you want to build Drupal, use Symfony2. Here's another semi-joking line :) If bu

Re: [PHP] include selectively or globally?

2012-08-28 Thread Adam Richardson
On Tue, Aug 28, 2012 at 3:28 PM, Matijn Woudt wrote: > On Tue, Aug 28, 2012 at 7:18 PM, Adam Richardson wrote: > > Finally, you're the first one that actually has measured something. > You should redo your test with real world files, because in real world > functions aren

Re: [PHP] include selectively or globally?

2012-08-28 Thread Adam Richardson
On Tue, Aug 28, 2012 at 7:39 AM, Matijn Woudt wrote: > On Tue, Aug 28, 2012 at 3:49 AM, Adam Richardson wrote: >> On Mon, Aug 27, 2012 at 6:54 PM, Matijn Woudt wrote: >>> On Mon, Aug 27, 2012 at 10:56 PM, Haluk Karamete >>> wrote: > > First of all, I believe PH

Re: [PHP] include selectively or globally?

2012-08-27 Thread Adam Richardson
On Mon, Aug 27, 2012 at 6:54 PM, Matijn Woudt wrote: > On Mon, Aug 27, 2012 at 10:56 PM, Haluk Karamete > wrote: >> >> Now, the question is... should you use a global include that points to >> this library - across the board - so that ALL the pages ( including >> the 90% that do not need the libr

Re: [PHP] multiple forms one page

2012-08-26 Thread Adam Richardson
On Mon, Aug 27, 2012 at 12:08 AM, Rosie Williams wrote: > > Hi all, > I am a newbie to PHP. I have several php forms which were originally on > separate pages now included in the one page. Each form had the following code > in it: > function mysql_fix_string($string){ if (get_magic_quotes_gp

Re: [PHP] syntax error breaking in and out of php into html code

2012-08-25 Thread Adam Richardson
On Sat, Aug 25, 2012 at 6:54 PM, Ashley Sheridan wrote: > I've just inherited some (pretty awful code) that I have to make some > edits to, and came across a bit of a problem. A lot of the code breaks > in and out of PHP and into HTML code: > > while(condition) > { > ?> > some html here > } > ?

Re: [PHP] redefine a define ...

2012-08-25 Thread Adam Richardson
On Sat, Aug 25, 2012 at 2:27 PM, Lester Caine wrote: > What I was not expecting was a string of 'Notices:' complaining about the > redefines. So how does one get around this message? One can't 'if defined' > as the string needs to be replaced with the more appropriate one. I would > say, why is th

Re: [PHP] Is PHP unsuitable for HTML5 WebSockets?

2012-08-13 Thread Adam Richardson
> I have read in some places on the net that PHP is not suitable for WebSockets > due to it's nature. That WebSockets are designed for long running > threads/processes which each maintain multiple event-driven connections, > whereas PHP was designed around the short-lived single process procedur

Re: [PHP] Re: show info from mysql db

2012-06-10 Thread Adam Richardson
On Sun, Jun 10, 2012 at 8:25 AM, Tim Dunphy wrote: > $dbc = mysqli_connect('127.0.0.1','admin',secret','trek_db') >     or die ('Could not connect to database'); > > used to be... > > $dbc = mysqli_conect('127.0.0.1','admin','Duk30fZh0u','trek_db') >     or die ('Could not connect to database');

Re: [PHP] SQL Injection

2012-06-08 Thread Adam Richardson
On Fri, Jun 8, 2012 at 12:37 PM, Ethan Rosenberg wrote: > Is it possible to have a "meeting of the minds" to come up with (an) > appropriate method(s)? Minds, meet prepared statements :) Adam -- Nephtali:  A simple, flexible, fast, and security-focused PHP framework http://nephtaliproject.com

Re: [PHP] Too many arrays! My head is exploding!

2012-05-29 Thread Adam Richardson
On Tue, May 29, 2012 at 10:55 AM, Tedd Sperling wrote: > On 29 May 2012 18:15, Gary wrote: > >> Okay, let's assume I have three "things", A, B, and C. I need to produce >> an array with a list of all possible combinations of them, however many >> there might be in those combinations: e.g. A, B, C

Re: [PHP] Variables via url

2012-05-12 Thread Adam Richardson
On Sat, May 12, 2012 at 12:25 PM, Ashley Sheridan wrote: > As this method requires an Apache restart, I don't see what advantage > you have over using an .htaccess file? Performance: http://httpd.apache.org/docs/current/howto/htaccess.html "You should avoid using .htaccess files completely if y

Re: [PHP] session lost problem

2012-04-23 Thread Adam Richardson
On Tue, Apr 24, 2012 at 12:58 AM, bug zhu wrote: > there are tow php files a.php and b.php, > > content of a.php as follows: > session_start(); > if (!isset($_GET['flag'])) > { > header('Location: b.php'); > } > else > { > var_dump($_SESSION); > } > > content of  b.php as follows: > session_star

Re: [PHP] PHP: "superior code quality"

2012-03-28 Thread Adam Richardson
On Wed, Mar 28, 2012 at 11:21 AM, wrote: > A little note about our favorite language: > > " > Linux 2.6, PHP 5.3, and PostgreSQL 9.1 are recognized as open source > projects with superior code quality and can be used as industry > benchmarks, achieving defect densities of .62, .20, and .21 respec

Re: [PHP] Thinking out loud - a continuation...

2012-03-21 Thread Adam Richardson
On Wed, Mar 21, 2012 at 2:39 PM, Jay Blanchard wrote: > ... > I have a project where I have multiple queries and each query uses the > results from the previous query to get it's results. I need to do one of two > things, either out put a multidimensional array that I can use json_encode() > on

Re: [PHP] $POST and $_SESSION

2012-03-15 Thread Adam Richardson
On Thu, Mar 15, 2012 at 11:04 AM, Tedd Sperling wrote: > Hi gang: > > What's a better/shorter way to write this? > > $first_name = $_SESSION['first_name'] ? $_SESSION['first_name'] : null; > $first_name = isset($_POST['first_name']) ? $_POST['first_name'] : > $first_name; > $_SESSION['first_name'

Re: [PHP] How do I enable more useful PHP error logging?

2012-02-28 Thread Adam Richardson
On Tue, Feb 28, 2012 at 6:14 PM, Daevid Vincent wrote: > My question is, is there a way to enable some PHP configuration that would > output more verbose information, such as a backtrace or the URL attempted? > > In our PHP error log, we have the usual semi-useful information. However > this is o

Re: [PHP] Insert new array after specific key in multidimensional array

2012-02-28 Thread Adam Richardson
On Mon, Feb 27, 2012 at 9:12 PM, Micky Hulse wrote: > Howdy! > > Example code: > > > > What would be the best way to insert $o_insert array into $o array > after specified key? > > I hate to just ask for example code, but I can't seem to find the > perfect solutio

[PHP] Great video by Bret Victor: Inventing on Principle

2012-02-25 Thread Adam Richardson
Saw this on the Clojure list and thought it was worth sharing here, too: http://vimeo.com/36579366 Worth the hour of time to watch it, as it has some great ideas for improving the experience of developers. Adam -- Nephtali: A simple, flexible, fast, and security-focused PHP framework http://ne

Re: [PHP] Help! Having trouble getting one XML field from this feed reliably

2012-02-09 Thread Adam Richardson
On Thu, Feb 9, 2012 at 9:10 AM, Yared Hufkens wrote: > I wonder why you use cURL as SimpleXML itself can load URLs: > > $vastdata = new > SimpleXMLElement('http://afe.specificclick.net/?l=32259&t=x&rnd=123456 > ',0,true); > > See http://de.php.net/manual/en/simplexmlelement.construct.php It is

Re: [PHP] Help! Having trouble getting one XML field from this feed reliably

2012-02-08 Thread Adam Richardson
On Wed, Feb 8, 2012 at 10:44 PM, Rob Gould wrote: > Can anyone tell me what I'm doing wrong here? I'm trying to get the > VASTAdTagURI field from the XML data at this url: > > http://afe.specificclick.net/?l=32259&t=x&rnd=123456 > > > > > Here's my code. (below). It works maybe 30% of the time

Re: [PHP] What's Your Favorite Design Pattern?

2012-02-07 Thread Adam Richardson
On Tue, Feb 7, 2012 at 1:56 PM, Mike Mackintosh < mike.mackint...@angrystatic.com> wrote: > I was curious to see what everyones favorite design patterns were, if you > use any, and why/when have you used it? > > Choices include slots and signals (observer), singleton, mvc, hmvc, > factory, command

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Adam Richardson
On Mon, Feb 6, 2012 at 3:50 PM, Adam Richardson wrote: > On Mon, Feb 6, 2012 at 12:58 AM, Paul M Foster wrote: > >> This is sort of obliquely related to PHP. >> >> I don't have a smart phone, but I need to know a couple of things: >> >> 1) Do smart phones

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Adam Richardson
On Mon, Feb 6, 2012 at 3:44 PM, Marco Behnke wrote: > Am 06.02.12 17:23, schrieb Alain Williams: > > However: a few GOTOs can make things clearer. Think of a function that > > can fail in several different places (eg data validation, ...). But it > > is reading a file which needs to be closed bef

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Adam Richardson
On Mon, Feb 6, 2012 at 12:58 AM, Paul M Foster wrote: > This is sort of obliquely related to PHP. > > I don't have a smart phone, but I need to know a couple of things: > > 1) Do smart phones use the same browsers as the desktop, or do they have > their own stripped down versions of browsers? > B

Re: Re: [PHP] Long Live GOTO

2012-02-06 Thread Adam Richardson
On Mon, Feb 6, 2012 at 11:58 AM, Tim Streater wrote: > On 06 Feb 2012 at 09:48, Adam Richardson wrote: > > > On Mon, Feb 6, 2012 at 4:25 AM, Adam Richardson >wrote: > > > >> On Mon, Feb 6, 2012 at 4:07 AM, Tim Streater > wrote: > > >> I disagr

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Adam Richardson
On Mon, Feb 6, 2012 at 12:09 PM, Larry Martell wrote: > > The source is my own personal experience working for an avionics > company and working with the FAA to get our code certified under the > DO-178B standard. I never saw anything that said 'no GOTOs' but that's > what I was told. I was also t

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Adam Richardson
On Mon, Feb 6, 2012 at 11:28 AM, Larry Martell wrote: > On Mon, Feb 6, 2012 at 9:23 AM, Alain Williams wrote: > > On Mon, Feb 06, 2012 at 11:12:53AM -0500, Jim Giner wrote: > >> NO "GO"! > >> As one who started back in the 70's with old style coding that utilized > GoTo > >> in Cobol, Fortran, et

Re: [PHP] Long Live GOTO

2012-02-06 Thread Adam Richardson
On Mon, Feb 6, 2012 at 10:05 AM, Robert Cummings wrote: > On 12-02-06 04:07 AM, Tim Streater wrote: > >> On 06 Feb 2012 at 07:47, Adam >> Richardson> >> wrote: >> >> While not purely focused on PHP, I toss this out to the group because I >>>

Re: [PHP] Long Live GOTO

2012-02-06 Thread Adam Richardson
On Mon, Feb 6, 2012 at 4:25 AM, Adam Richardson wrote: > On Mon, Feb 6, 2012 at 4:07 AM, Tim Streater wrote: > >> On 06 Feb 2012 at 07:47, Adam Richardson wrote: >> >> > While not purely focused on PHP, I toss this out to the group because I >> > believe ther

Re: [PHP] Long Live GOTO

2012-02-06 Thread Adam Richardson
On Mon, Feb 6, 2012 at 4:07 AM, Tim Streater wrote: > On 06 Feb 2012 at 07:47, Adam Richardson wrote: > > > While not purely focused on PHP, I toss this out to the group because I > > believe there are some novel, interesting points regarding the potential > > be

[PHP] Long Live GOTO

2012-02-05 Thread Adam Richardson
Hi, While not purely focused on PHP, I toss this out to the group because I believe there are some novel, interesting points regarding the potential benefits of using the goto construct as implemented in PHP: http://adamjonrichardson.com/2012/02/06/long-live-the-goto-statement/ Adam -- Nephtal

Re: [PHP] differences in between these env. variables

2012-01-29 Thread Adam Richardson
On Sun, Jan 29, 2012 at 11:38 AM, Tedd Sperling wrote: > On Jan 27, 2012, at 12:45 PM, Adam Richardson wrote: > > > On Fri, Jan 27, 2012 at 12:09 PM, Tedd Sperling > wrote: > > On Jan 11, 2012, at 9:24 PM, tamouse mailing lists wrote: > > > > > Is there ev

Re: [PHP] differences in between these env. variables

2012-01-27 Thread Adam Richardson
On Fri, Jan 27, 2012 at 12:09 PM, Tedd Sperling wrote: > On Jan 11, 2012, at 9:24 PM, tamouse mailing lists wrote: > > > Is there ever a case where SCRIPT_NAME does not equal PHP_SELF? > > Was this every answered? I would like to know. > > Cheers, > > tedd > Yep, can be different: http://stackove

Re: [PHP] Date function kill lots time !

2012-01-04 Thread Adam Richardson
On Wed, Jan 4, 2012 at 11:07 PM, xucheng wrote: > hi all, > I have a webapp which track visitors, and use xhprof for profiling my > codes . > After reading some reports produced by xhprof, i found that function > Date() kills most time of my app ! > how can this happen ? Is this function ha

Re: [PHP] Re: Preferred Syntax

2011-12-16 Thread Adam Richardson
On Fri, Dec 16, 2011 at 11:53 PM, Eric Butera wrote: > To all the people who responded to this thread: > It is 2011 - please stop writing code like this. > > To the OP: > I'm glad you're asking questions and realizing you're not happy with > your current abilities and suspect there's a better way

Re: [PHP] Preferred Syntax

2011-12-14 Thread Adam Richardson
On Wed, Dec 14, 2011 at 7:59 AM, Rick Dwyer wrote: > Hello all. > > Can someone tell me which of the following is preferred and why? > > echo " href='/mypage.php/$page_id'>$**page_name"; > > echo " href='/mypage.php/".$page_id."**'>".$page_name.""; > > When I come across the above code in line

Re: [PHP] mcrypt_encrypt help needed

2011-11-30 Thread Adam Richardson
On Wed, Nov 30, 2011 at 4:25 PM, Matijn Woudt wrote: > On Wed, Nov 30, 2011 at 10:18 PM, Adam Richardson > wrote: > > On Wed, Nov 30, 2011 at 4:14 PM, Matijn Woudt wrote: > > > >> On Wed, Nov 30, 2011 at 9:57 PM, Rick Dwyer > wrote: > >> > Hello a

Re: [PHP] mcrypt_encrypt help needed

2011-11-30 Thread Adam Richardson
On Wed, Nov 30, 2011 at 4:14 PM, Matijn Woudt wrote: > On Wed, Nov 30, 2011 at 9:57 PM, Rick Dwyer wrote: > > Hello all. > > > > I am using the following function to encrypt a string: > > > > define('SALT', 'myvalueforsalthere'); > > > > function encrypt($text) > > { > >return trim(base64_en

Re: [PHP] mcrypt_encrypt help needed

2011-11-30 Thread Adam Richardson
On Wed, Nov 30, 2011 at 3:57 PM, Rick Dwyer wrote: > Hello all. > > I am using the following function to encrypt a string: > > define('SALT', 'myvalueforsalthere'); > > function encrypt($text) > { >return trim(base64_encode(mcrypt_**encrypt(MCRYPT_RIJNDAEL_256, SALT, > $text, MCRYPT_MODE_ECB,

Re: [PHP] delete and recreate

2011-11-09 Thread Adam Richardson
On Wed, Nov 9, 2011 at 10:35 AM, Kirk Bailey wrote: > So, I want to create a script to delete an old file and create a new one > which is empty. The script receives a password via query string. The > obvious methods give me back a very useless 500 error. Any suggestions on > how to accomplish what

Re: [PHP] Re: Writing out errors to a file

2011-11-03 Thread Adam Richardson
On Thu, Nov 3, 2011 at 9:04 PM, Jim Giner wrote: > Try reading the manual on "set_error_handler". I've never needed to do > this > kind of thing, but this sure looks like something that could do it. > Basically, I'm imagining that it would open a file handle on some text file > in some folder, th

Re: [PHP] Friday Distraction

2011-10-28 Thread Adam Richardson
On Thu, Oct 27, 2011 at 10:18 AM, Richard Quadling wrote: > On 21 October 2011 17:27, Daniel Brown wrote: > >I'll get this week's Friday distraction kicked off here with > > something shared with me by a Facebook friend. If you're on Facebook, > > try this. It's pretty sweet (and safe for w

Re: [PHP] Sequential access of XML nodes.

2011-09-26 Thread Adam Richardson
On Mon, Sep 26, 2011 at 12:24 PM, Richard Quadling wrote: > Hi. > > I've got a project which will be needing to iterate some very large > XML files (around 250 files ranging in size from around 50MB to > several hundred MB - 2 of them are in excess of 500MB). > > The XML files have a root node and

Re: [PHP] how catch a warning by file_put_contents() ?

2011-08-19 Thread Adam Richardson
On Sat, Aug 20, 2011 at 1:23 AM, Simon J Welsh wrote: > On 20/08/2011, at 4:51 PM, Andreas wrote: > > > Hi, > > I wrote stuff with file_put_contents() in a try{} catch{} and it worked. > > > > Then I'd like to check what happens when some error occurs so I > writeprotected the targetfile. > > Ins

Re: [PHP] How to sum monetary variables

2011-07-18 Thread Adam Richardson
2011/7/18 Richard Quadling > 2011/7/18 Martín Marqués : > > > > Any ideas? > > For financial values, I use the money type. > > I use MS SQL, but PostgreSQL has > http://www.postgresql.org/docs/9.0/interactive/datatype-money.html > The version of PostgreSQL plays a role, too, as at one point the

Re: [PHP] How to sum monetary variables

2011-07-18 Thread Adam Richardson
2011/7/18 Martín Marqués > I'm building a table (which is a report that has to be printed) with a > bunch of items (up to 300 in some cases) that have unitary price > (stored in a numeric(9,2) field), how many there are, and the total > price for each item. At the end of the table there is a tota

Re: [PHP] Linking A C Program Example to PHP

2011-07-10 Thread Adam Richardson
On Sun, Jul 10, 2011 at 5:56 PM, Thomas Dineen wrote: > > I am attempting to link a C Program example to PHP using the > tutorial shown at the link below: > http://voloreport.com/making-**a-c-extension-for-php-in-11-**easy-steps

Re: [PHP] ApiGen - a tool for generating source code documentation

2011-06-29 Thread Adam Richardson
I'll try it on my PHP 5.3 web framework later today. Thanks for working on this project! Adam 2011/6/29 Ondřej Nešpor > Hi everybody! > > We'd like to introduce you our documentation generator - ApiGen 2. We use > it as a replacement for PhpDocumentor (that is not being developed for more > tha

Re: [PHP] Re: about php comet

2011-06-03 Thread Adam Richardson
On Fri, Jun 3, 2011 at 3:43 AM, 李白|字一日 wrote: > > > 2011/6/3 Adam Richardson > >> On Fri, Jun 3, 2011 at 2:20 AM, 李白|字一日 wrote: >> >>> is there an efficient way to hold the requests while loop is an expensive >>> way in most cases. >> >> &g

Re: [PHP] Re: about php comet

2011-06-03 Thread Adam Richardson
On Fri, Jun 3, 2011 at 2:20 AM, 李白|字一日 wrote: > is there an efficient way to hold the requests while loop is an expensive > way in most cases. You can call sleep(number_of_seconds_to_sleep) within the while loop to lower the cost, so to speak. > and i don't know how to notify the holding conn

Re: [PHP] Re: about php comet

2011-06-02 Thread Adam Richardson
On Fri, Jun 3, 2011 at 1:50 AM, 李白|字一日 wrote: > any idea? > > 2011/5/25 李白|字一日 > > > hello, > > > > I am every interested in comet applications recently, and sadly found php > > is very weak in this area. > > > > i am just wondering if it is possible to write an extension to extend the > > abili

Re: [PHP] notices nightmare - looking for a regex solution

2011-06-01 Thread Adam Richardson
On Wed, Jun 1, 2011 at 6:26 PM, Merlin Morgenstern wrote: > Hi there, > > I am working on a pretty huge site with thousands of files with php code. > Unfortunatelly the app throws a ton of notices du to missing '' in arrays. > Of course I could simply disable the output on the dev server to surpre

Re: [PHP] Script ID?

2011-05-21 Thread Adam Richardson
On Sat, May 21, 2011 at 10:11 AM, tedd wrote: > Hi gang: > > Okay, so,what's the "best" (i.e., most secure) way for your script to > identify itself *IF* you plan on using that information later, such as the > value in an action attribute in a form? > > For example, I was using: > > $self = basen

Re: [PHP] a Debate here - How can you check a if a file is a UTF-8 without the BOM using PHP ?

2011-05-21 Thread Adam Richardson
On Sat, May 21, 2011 at 12:10 PM, Eli Orr (Office) wrote: > > Dear PHP Gurus, > > I have a debate on the following please let me know what is true / false. > > I'am using a PHP function *is_UTF_8_file ($file_name) *that I've found as > part of my PHP 5.3 installation. > This function checks if the

Re: [PHP] problem in onclick

2011-05-20 Thread Adam Richardson
On Fri, May 20, 2011 at 2:46 PM, tedd wrote: > At 9:30 PM +0300 5/20/11, Andre Polykanine wrote: > >> Hi Richard, Tedd, >> >> Hey guys, you did understand what I meant. I meant you >> can't just go and write a session variable by onclicking it in >> JavaScript. You need AJA

Re: [PHP] A Review Request

2011-05-19 Thread Adam Richardson
On Thu, May 19, 2011 at 8:51 PM, Alex Nikitin wrote: > Hey Adam :) > > I devoted entire 3 minutes to glimpsing over the code and showing simple > ways to fix them, you make excellent points, i simply didnt even look into > them. You are absolutely correct in saying that sha1 a weak way to do this

Re: [PHP] A Review Request

2011-05-19 Thread Adam Richardson
Hi Alex, Some nice conversation points, indeed. I do have a few follow-ups below: On Thu, May 19, 2011 at 3:16 PM, Alex Nikitin wrote: > PHP_SELF requires no processing (i.e. there is no need to do basename()) > Actually, the way Tedd is using the info, PHP_SELF would potentially be unsafe (un

Re: [PHP] Filtering data not with mysql...

2011-05-18 Thread Adam Richardson
On Wed, May 18, 2011 at 10:46 PM, Adam Richardson wrote: > > I'm a security expert by any means, as I've made mistakes in the past that > have provided education the hard way! > Just to be very clear, this is a mistake (as the rest of the sentence implies), and it should h

Re: [PHP] Filtering data not with mysql...

2011-05-18 Thread Adam Richardson
On Wed, May 18, 2011 at 9:18 PM, Jason Pruim wrote: > Hey Everyone, > > Probably a simple question but I wanted to make sure I was right before I > got to far ahead of my self > > I have a form that I am working on and this form will be emailed to the > recipient for processing (Not stored in

Re: [PHP] [SPAM] Re: Explode Question

2011-05-18 Thread Adam Richardson
On Wed, May 18, 2011 at 6:42 PM, Michelle Konzack < linux4miche...@tamay-dogan.net> wrote: > Hello ad...@buskirkgraphics.com, > > since YOU ARE an ADMIN, you should real know abut, > HOW TO WRITE A NEW MESSAGE and not to hijack a SPAM thread... > What? -- Nephtali: A simple, flexible, fast, an

Re: [PHP] Bold links

2011-05-15 Thread Adam Richardson
> > On Sun, May 15, 2011 at 7:48 PM, tedd wrote: At 1:46 PM -0400 5/10/11, Adam Richardson wrote: > >> The rest of the list does show you've read a fair amount in the past month >> (just as others on this list, including me), but what does it do to >> sp

Re: [PHP] Bold links

2011-05-10 Thread Adam Richardson
Hi Ash, I want to clarify a couple points. On Tue, May 10, 2011 at 2:27 PM, Ashley Sheridan wrote: > On Tue, 2011-05-10 at 13:46 -0400, Adam Richardson wrote: > > Hi Tedd, > > How's it going? I'm very pleased with the emphasis on accessibility you > bring to th

Re: [PHP] Bold links

2011-05-10 Thread Adam Richardson
Hi Tedd, How's it going? I'm very pleased with the emphasis on accessibility you bring to the PHP list, but I do believe you're overstating a few points below. > So, allow me to bring mine -- my information/position stems from my > understanding derived from both daily practice and constant read

Re: [PHP] Bold links

2011-05-09 Thread Adam Richardson
On Mon, May 9, 2011 at 5:56 PM, tedd wrote: > At 1:39 PM -0400 5/7/11, wrote: > >> > get_currentuserinfo(); >> >> echo 'Welcome  ' . $current_user->user_firstname . "\n"; >> echo '' . $current_user->user_lastname . "\n"; >> ?> >> >> Richard L. Buskirk >> > > Really? > > How doe

Re: [PHP] str_replace

2011-04-24 Thread Adam Richardson
On Sun, Apr 24, 2011 at 11:44 AM, Ron Piggott < ron.pigg...@actsministries.org> wrote: > > I am trying to figure out a syntax that will replace each instance of % > with a different letter chosen randomly from the string $puzzle_filler. > $puzzle_filler is populated with the letters of the alphabe

Re: [PHP] email w/attachments

2011-04-17 Thread Adam Richardson
On Sun, Apr 17, 2011 at 10:26 PM, tedd wrote: > Hi gang: > > Anyone have an email script that allows attachments they would share? > > I've been trying to figure this out and everything I've tried has failed. > I've looked at over a dozen scripts that don't work. I'm about to pull out > what hair

Re: [PHP] $_POST vars

2011-04-13 Thread Adam Richardson
On Wed, Apr 13, 2011 at 1:49 PM, Jim Giner wrote: > Can one create a set of $_POST vars within a script or is that not do-able? > My display portion of my script utilizes the POST array to supply values to > my input screen - this works well for the first display of an empty screen, > and any foll

Re: [PHP] Security Question

2011-04-08 Thread Adam Richardson
On Fri, Apr 8, 2011 at 3:24 PM, nighthawk1256 wrote: > hey guys/girls, > > whats the best way to learn about security in php? Here are some relevant topics to consider: - Validate input (only accept what you're expecting, via GET, POST, and COOKIE, and don't try to fix an invalid value,

Re: [PHP] the best 1 book for php

2011-04-06 Thread Adam Richardson
On Thu, Apr 7, 2011 at 12:15 AM, Kirk Bailey wrote: > If I only had 1 book on php, what would it be? > > -- > end > > Very Truly yours, > - Kirk Bailey, > Largo Florida > > kniht > +-+ > | BOX | >

Re: [PHP] Permission Denied - Help Requested

2011-03-29 Thread Adam Richardson
On Tue, Mar 29, 2011 at 8:21 PM, Ethan Rosenberg wrote: > At 05:33 PM 3/29/2011, Adam Richardson wrote: > >> > >> > Thanks. >> > >> > What do you see if you run this? "Can't open or create file!" >> > >> > Ethan >&g

Re: [PHP] Permission Denied - Help Requested

2011-03-29 Thread Adam Richardson
> > Thanks. > > What do you see if you run this? "Can't open or create file!" > > Ethan OK, If you're running PHP as an Apache module, by default it won't have permissions to write to the directory (this is by design to avoid security issues.) You can do something like the following: 1. C

Re: [PHP] Permission Denied - Help Requested

2011-03-29 Thread Adam Richardson
On Mon, Mar 28, 2011 at 11:43 PM, Ethan Rosenberg wrote: > At 11:14 PM 3/28/2011, Adam Richardson wrote: > >> On Mon, Mar 28, 2011 at 11:03 PM, Ethan Rosenberg <> eth...@earthlink.net>eth...@earthlink.net> wrote: >> At 01:32 AM 3/28/2011, Hans Ã…hlin wrote: &g

Re: [PHP] Permission Denied - Help Requested

2011-03-28 Thread Adam Richardson
On Mon, Mar 28, 2011 at 11:03 PM, Ethan Rosenberg wrote: > At 01:32 AM 3/28/2011, Hans Ã…hlin wrote: > >> Do you have SELinux installed? >> >> 2011/3/28 Ethan Rosenberg : >> > Dear List - >> > >> > Thanks for all your help in the past. Â Here is another one... >> > >> > I am getting a Permission D

Re: [PHP] Failure in bitwise operations moving from 5.2.x to 5.3.x

2011-03-15 Thread Adam Richardson
On Tue, Mar 15, 2011 at 12:21 PM, Daniel Brown wrote: > On Tue, Mar 15, 2011 at 12:18, Adam Richardson > wrote: > > > > My apologies: > > > > Nice detective work ANDY (sorry, Andy, see earlier note about my shabby > > memory.) I'd just replied

Re: [PHP] Failure in bitwise operations moving from 5.2.x to 5.3.x

2011-03-15 Thread Adam Richardson
On Tue, Mar 15, 2011 at 12:15 PM, Adam Richardson wrote: > On Tue, Mar 15, 2011 at 11:50 AM, Andy McKenzie wrote: > >> > Now: I did a little more looking around this morning, and it looks >> > like I may well run into problems here given that I'm moving from a >

  1   2   3   >