[PHP] Function size

2012-05-23 Thread Tedd Sperling
Hi gang: On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote: > A rule of thumb is no more than 50 lines per > function, most much less. Back in the day when we didn't have nifty > gui screens and an 24 line terminals (yay green on black!), if a > function exceeded one printed page, it was d

Re: [PHP] Function size

2012-05-23 Thread Tedd Sperling
On May 23, 2012, at 11:49 AM, shiplu wrote: > On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote: > When number of lines becomes the criteria of function size? Wouldn't it > depends on the task the function is doing? You missed the point. Of course, the difficulty of the task of a specif

Re: [PHP] Function size

2012-05-23 Thread Tedd Sperling
On May 23, 2012, at 12:21 PM, Robert Cummings wrote: > On 12-05-23 12:15 PM, Tedd Sperling wrote: >> What I was talking about was that what we can grasp in one view, we can >> understand better. If the code lies outside of our view, then we understand >> it less. I can su

Re: [PHP] Function size

2012-05-24 Thread Tedd Sperling
On May 23, 2012, at 3:49 PM, Ashley Sheridan wrote: > > I'm of the same mind. Generally I'll split a function if I'm reusing more > than a couple of lines of code. I only split a "large" function if it's > actually doing several things, if it happens to need 200 lines to perform one > 'step' t

Re: [PHP] Function size

2012-05-24 Thread Tedd Sperling
On May 24, 2012, at 8:37 AM, Steven Staples wrote: > Tedd, > > I think the length of code depends on a few different factors, what if you > have your docblocks, and comment lines, as well as your bracing style? > Where do you consider your function to start? It starts where it starts. It doesn't

[PHP] Re: Function size

2012-05-25 Thread Tedd Sperling
On May 24, 2012, at 4:48 PM, tamouse mailing lists wrote: > Yes, I think that is *exactly* the criterion-- not a mystery or an emergent > thing, really, was a pretty expicit reasoning--being able to see/scan the > entire function on one page (or now in one screenful) makes it much easier to > s

Re: [PHP] Function size

2012-05-25 Thread Tedd Sperling
On May 24, 2012, at 5:01 PM, Ashley Sheridan wrote: > On Thu, 2012-05-24 at 15:48 -0500, tamouse mailing lists wrote: >> On May 23, 2012 9:14 AM, "Tedd Sperling" > > wrote: >> > >> > H >> Yes, I think that is *exactly* the criterion-- not a myst

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

2012-05-29 Thread Tedd Sperling
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, D, AB, AC, AD, BC, > ABC (not sure if I've missed any!). Nor

Re: [PHP] Function size

2012-05-29 Thread Tedd Sperling
On May 29, 2012, at 10:20 AM, Stuart Dallas wrote: > -snip- > Besides, truth is subjective, but then so is everything, including that > assertion. > > -Stuart You reply was longer than my monitor was high so I can't give an immediate reply -- I have to scroll. :-) However, with that said, you

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

2012-05-29 Thread Tedd Sperling
On May 29, 2012, at 11:41 AM, Adam Richardson wrote: > 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

Re: [PHP] Function size

2012-05-29 Thread Tedd Sperling
On May 29, 2012, at 5:06 PM, Paul M Foster wrote: > > I think a lot of coders try to be kewler than the next 18 guys who are > gonna have to look at the code, so they use a lot of "compression" > techniques to reduce LOC. That's not kewl to me. > Plus, they're lazy. I'd rather see everything > w

Re: [PHP] [foreach] - is it proper to...

2012-05-31 Thread Tedd Sperling
On May 31, 2012, at 12:48 PM, Tristan wrote: > I'm using Zend Studio and it had a suggestion that I do a foreach as such > > foreach($entry as $entry){ > > } > > instead of > > foreach($entries as $entry){ > > } > > they both seem to work but, from a readability standpoint and just makes > m

[PHP] cyberweaponry

2012-05-31 Thread Tedd Sperling
Hi gang: This is a little early for Friday's "Open Comment" day, but my memory is increasingly more short term and by tomorrow I might forget -- so, here goes. I watched a interview today where an security expert claimed that the Flame Virus was written in a scripted language named lua (http://

Re: [PHP] cyberweaponry

2012-06-03 Thread Tedd Sperling
On May 31, 2012, at 7:45 PM, Ross McKay wrote: > On Thu, 31 May 2012 13:21:07 -0400, Tedd Sperling wrote: > >> [...] >> I watched a interview today where an security expert claimed that >> the Flame Virus was written in a scripted language named lua >> (htt

Re: [PHP] disabled cookies

2012-06-05 Thread Tedd Sperling
On Jun 3, 2012, at 5:21 PM, Ashley Sheridan wrote: > > There is a new law been passed in the UK that makes non-essential cookies > opt-in only, so you must get permission in order to use them. What's a non-essential cookie? Cheers, tedd _ tedd.sperl...@gmail.com http://spe

Re: [PHP] disabled cookies

2012-06-05 Thread Tedd Sperling
On Jun 4, 2012, at 6:13 PM, Ashley Sheridan wrote: > > Yeah, it's been such a pain, as nobody over here is quite sure how the > hell it'll be enforced either, or if it even will be. It's also pretty > vague as to just where the line gets drawn. The official government > sites on this are pretty bl

Re: [PHP] Happy Diamond Jubilee everyone!

2012-06-05 Thread Tedd Sperling
On Jun 1, 2012, at 1:44 PM, Ashley Sheridan wrote: > This is a bit of a shameless plug, but it is a Friday and a pretty > special weekend over here. > > I recently got to work on something a bit fun at work in my spare time > and they liked it so much that it got used internally to celebrate the

[PHP] A Question of SESSION

2012-06-07 Thread Tedd Sperling
Hi Daniel and gang: Considering I'm never afraid to show my ignorance, please review the following example. Because of the way I normally use sessions and considering this way works for me, I thought I knew what sessions were about -- but my faith is eroding. Cases in point 1. The following i

Re: [PHP] If PHP Were British

2012-06-22 Thread Tedd Sperling
On Jun 22, 2012, at 5:07 PM, Daevid Vincent wrote: > http://www.addedbytes.com/blog/if-php-were-british/ Oh, that is too funny! I'll counter with my Hill-Billy version: --- echo(); yell('revenewers commin'); --- var_dump(); take_a_dump(); preferred: leave_one(); --- if:

Re: [PHP] What's happened to our newsgroup?

2012-06-27 Thread Tedd Sperling
On Jun 26, 2012, at 3:21 PM, Al wrote: > No postings for days. > Maybe everyone learned it -- no new questions. Cheers, tedd _ t...@sperling.com http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Session Checking

2012-07-10 Thread Tedd Sperling
On Jul 9, 2012, at 2:40 PM, Floyd Resler wrote: > I want to have an alert pop up to let the user know their session is about to > expire. Would the best approach be to do a timer in Javascript or check it > in PHP. I'm storing session data in a MySQL database so I can know when a > session w

[PHP] Seeking a scheduling algorithm

2012-07-14 Thread Tedd Sperling
Hi gang: Does anyone have a resource, or better yet code, to solve the scheduling problem described below? Let's say you have a week calendar that has openings between 8:00am to 5:00pm for Monday through Friday (40 hours). Then you have an assortment of appointments that must be scheduled into

Re: [PHP] Seeking a scheduling algorithm

2012-07-15 Thread Tedd Sperling
_ t...@sperling.com http://sperling.com On Jul 14, 2012, at 6:32 PM, Bill Guion wrote: > On Jul 14, 2012, at 4:53 PM, php-general-digest-h...@lists.php.net wrote: > >> From: Tedd Sperling >> Does anyone have a resource, or better yet code, to so

Re: [PHP] Creating drop-down menus

2012-07-19 Thread Tedd Sperling
On Jul 16, 2012, at 4:16 PM, Ramiro Barrantes wrote: > Hello, > > I am making an application using PHP/Javascript/mysql and had a question. > > Sometimes I need to use javascript to fill a drop down box based on the value > of a previous drop down box. However, the information to fill the la

[PHP] What do you call the end-user?

2012-07-19 Thread Tedd Sperling
Hi gang: I can't wait for tomorrow -- so here's my off-topic post today. First question: What do you call the people who ultimately use your code? I call them the "end-user", but others have stated other terms, such as "customer" or "user". Second question: Are you concerned with their ("who

Re: [PHP] What do you call the end-user?

2012-07-19 Thread Tedd Sperling
On Jul 19, 2012, at 1:54 PM, "admin" wrote: > My goal in life has been to develop the ultimate portal that thinks for you > and less dependent on your interactions. I am close to finishing a learning > module that learns from your interactions and navigates according to your > past history. But th

Re: [PHP] Creating drop-down menus

2012-07-19 Thread Tedd Sperling
On Jul 19, 2012, at 1:50 PM, Daniel Brown wrote: > >As an aside on the subject of jQuery, our very own Jay Blanchard > has written a comprehensive book on the topic entitled "Applied > jQuery: Develop and Design": > >http://links.parasane.net/92xb > Just bought it -- thanks. I'll a

[PHP] PHP Stats

2012-07-31 Thread Tedd Sperling
Hi gang: Do we have anything a bit more up to date than this? http://php.net/usage.php That's five years out of date! Also, the links out don't really provide anything useful -- they are either dated, show vested interest (i.e., want money), or they provide information not relevant to php. Fo

Re: [PHP] PHP session variables

2012-08-09 Thread Tedd Sperling
On Aug 8, 2012, at 5:41 PM, Jim Giner wrote: > On 8/8/2012 11:24 AM, Ansry User 01 wrote: >> I am setting the _SESSION variables in one of my file, but whenever I leave >> the php page session variables are not accessible. Not sure what I need to >> do additionally other then defining _SESSION[

Re: [PHP] PHP session variables

2012-08-10 Thread Tedd Sperling
On Aug 9, 2012, at 5:16 PM, Jim Lucas wrote: > You are relying on PHP's loose typing. This is a poor check. > > session_id() returns a string, not boolean. > > You should do this instead. > > if ( session_id() === '' ) > > > > -- > Jim Lucas Thanks Jim -- you're right. What about? i

Re: [PHP] PHP session variables

2012-08-10 Thread Tedd Sperling
On Aug 10, 2012, at 11:45 AM, Tedd Sperling wrote: > On Aug 9, 2012, at 5:16 PM, Jim Lucas wrote: >> You are relying on PHP's loose typing. This is a poor check. >> >> session_id() returns a string, not boolean. >> >> You should d

Re: [PHP] PHP session variables

2012-08-12 Thread Tedd Sperling
On Aug 10, 2012, at 1:21 PM, Ege Sertçetin wrote: > Hi. My question will maybe out of topic, I'm sorry. > How can you know that one way will be much slower than other one? I mean, how > can I learn which function is faster before I test it? Ege: No your question is on topic. This question sho

Re: [PHP] PHP session variables

2012-08-14 Thread Tedd Sperling
On Aug 13, 2012, at 10:59 AM, Robert Cummings wrote: > On 12-08-10 04:42 PM, Tedd Sperling wrote: >> On Aug 10, 2012, at 1:21 PM, Ege Sertçetin wrote: >> >>> Hi. My question will maybe out of topic, I'm sorry. >>> How can you know that one way will

Re: [PHP] PHP session variables

2012-08-15 Thread Tedd Sperling
On Aug 14, 2012, at 11:01 AM, Robert Cummings wrote: > > I'm not sure if you're making a joke, but your changes have no effect. You've > merely explicitly stated the optional parameter's default value. What I had > meant was to change the following: > > > $starttime = microtime(); > $startar

Re: [PHP] PHP session variables

2012-08-15 Thread Tedd Sperling
Andrew: Your points are well taken -- thanks. However, my only concern is given this: > for($i=1; $i < 1000; $i++) >{ >if (!defined('SID')) > { > echo __LINE__, '::session_start()'; > session_start(); > } >} The php manual ( http:

Re: [PHP] PHP session variables

2012-08-16 Thread Tedd Sperling
On Aug 15, 2012, at 4:42 PM, Andrew Ballard wrote: > On Wed, Aug 15, 2012 at 3:24 PM, Tedd Sperling wrote: >> The php manual ( http://us3.php.net/manual/en/function.session-start.php ) >> >> First Note states that session_start() must be called *before* anything se

Re: [PHP] PHP session variables

2012-08-16 Thread Tedd Sperling
On Aug 15, 2012, at 4:13 PM, Robert Cummings wrote: > > I only pointed it out because I used to do exactly the same thing :) > > Cheers, > Rob. Thanks, I was starting to feel pretty dumb. Cheers, tedd _ t...@sperling.com http://sperling.com -- PHP General Mailing List

Re: [PHP] Need to have form protection techniques

2012-08-17 Thread Tedd Sperling
On Aug 17, 2012, at 10:09 AM, Daniel Brown wrote: > On Fri, Aug 17, 2012 at 12:05 AM, Ansry User 01 > wrote: >> I need to know the forms validity techniques for Php. > >This will probably take a while to absorb, so you may need to > revisit this page several times: > >http://oidk.

Re: [PHP] Need to have form protection techniques

2012-08-17 Thread Tedd Sperling
On Aug 17, 2012, at 10:42 AM, Robert Cummings wrote: >>> On Fri, Aug 17, 2012 at 12:05 AM, Ansry User 01 >>> wrote: I need to know the forms validity techniques for Php. >>> >>>This will probably take a while to absorb, so you may need to >>> revisit this page several times: >>> >>>

Re: [PHP] multiple forms one page

2012-08-27 Thread Tedd Sperling
On 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_gpc

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

2012-08-27 Thread Tedd Sperling
On Aug 26, 2012, at 1:36 PM, Ashley Sheridan wrote: > Well, it turns out that I'm just an idiot... > -- > Thanks, > Ash That was easy -- anyone of us could have told you that. :-) Cheers, tedd PS: We all have our time in the barrel. _ t...@sperling.com http://sperling.com

Re: [PHP] load rtf file

2012-09-03 Thread Tedd Sperling
On Sep 3, 2012, at 1:23 AM, John Taylor-Johnston wrote: > I have a big giant RTF file. I could convert it to plain text. BUT can PHP do > it for me? Hell, even M$ can't do it! I have tons of old Word RFT files that were orphaned by the installation of a newer of M$ Word. The upgrade actually

Re: [PHP] load rtf file

2012-09-03 Thread Tedd Sperling
On Sep 3, 2012, at 12:56 PM, Matijn Woudt wrote > > Just a side note tedd, couldn't you just open those RTF files with > wordpad? IIRC it supports RTF and plain text (even in Win7) > > - Matijn Maybe if I was on a Windoze machine, but I'm on a Mac. Cheers, tedd _ t...@

Re: [PHP] Programmers and developers needed

2012-09-13 Thread Tedd Sperling
On Sep 13, 2012, at 3:45 AM, agbo onyador wrote: > Hello there! We are looking for programmers and developers to create a > world wide system. Your comments are welcome. Wow! I'm looking for world wide money. tedd _ t...@sperling.com http://sperling.com -- PHP General M

[PHP] Day after Friday

2012-09-22 Thread Tedd Sperling
Hi gang: I know it's the Day after Friday, but I'm asking a off-topic question anyway -- sorry. Normally, I teach a PHP class at the local college, but it got canceled (don't ask why) -- now I'm teaching Java. So, can anyone recommend a Java list that is similar to this list? Cheers, tedd

Re: [PHP] Day after Friday

2012-09-23 Thread Tedd Sperling
On Sep 22, 2012, at 3:59 PM, Paul M Foster wrote: > On Sat, Sep 22, 2012 at 01:05:51PM -0400, Tedd Sperling wrote: > >> Hi gang: >> >> I know it's the Day after Friday, but I'm asking a off-topic question anyway >> -- sorry. >> >> Normally,

Re: RES: [PHP] Day after Friday

2012-09-24 Thread Tedd Sperling
On Sep 23, 2012, at 10:17 AM, Samuel Lopes Grigolato wrote: > Independent of programming language, good teaching skills will lead to > self-taught developers with a bunch of best practices under the hood. I hope > you are such a good teacher =). We need not PHP or Java developers, we need > g

Re: [PHP] Day after Friday

2012-09-24 Thread Tedd Sperling
On Sep 23, 2012, at 6:28 PM, Paul M Foster wrote: > On Sun, Sep 23, 2012 at 09:33:33AM -0400, Tedd Sperling wrote: >> >> It would be nice if administration decisions were made with respect to >> "what is best for the student" > > You know, I never had m

Re: [PHP] Here's my rounding

2012-09-29 Thread Tedd Sperling
On Sep 28, 2012, at 9:27 AM, Jim Giner wrote: > On 9/28/2012 2:11 AM, Simon J Welsh wrote: >> On 28/09/2012, at 6:08 PM, Chris Payne wrote: >> >> I would use something similar to $rounded_number = ceil($test2/1000)*1000; >> --- >> Simon Welsh >> Admin of http://simon.geek.nz/ >> > From my days

Re: [PHP] Friday - Return of Brain Teasers

2012-10-08 Thread Tedd Sperling
On Oct 7, 2012, at 5:05 PM, Matijn Woudt wrote: > On Fri, Oct 5, 2012 at 7:43 PM, Daniel Brown wrote: >>About five-and-a-half years ago, we had a brainteasers thread >> going on[1]. Last year it was briefly resurrected[2], and both times >> got some good content and dialogue going. So I'd

Re: [PHP] Is it possible to click download button,and run 2 tasks downloading a file and show number of downloads(ajax)simultaneously?

2012-10-14 Thread Tedd Sperling
On Oct 14, 2012, at 7:41 AM, Negin Nickparsa wrote: > I wanted to refresh the download count when clicking the button first is it > possible? Yes, it is possible. The following is an example of a server-side php script refreshing a Web page via a javascript client-side action: http://php1.net/

[PHP] Java guru?

2012-11-03 Thread Tedd Sperling
Hi gang: Anyone here a Java guru? If so, please contact me privately -- I have a question. Cheers, tedd _ t...@sperling.com http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Switch - Case Statement Questions

2012-11-21 Thread Tedd Sperling
On Nov 19, 2012, at 2:46 PM, Stuart Dallas wrote: > On 19 Nov 2012, at 19:35, Tim Streater wrote: > >> On 18 Nov 2012 at 14:44, Jim Giner wrote: >> Just so. Perhaps those who are not grasping the point could re-read their >> copy of "The Elements of Programming Style" by Kernighan and Plauge

Re: [PHP] Sorry bout that...

2012-12-21 Thread Tedd Sperling
On Dec 21, 2012, at 8:22 AM, Steven Staples wrote: > I would like to let everyone know that the world didn't end this morning > like it was supposed too. It didn't! You couldn't prove that by me -- I'll ask my wife. She knows everything. Cheers, tedd _ t...@sperling.com h

Re: [PHP] Sorry bout that...

2012-12-21 Thread Tedd Sperling
On Dec 21, 2012, at 11:39 AM, Steven Staples wrote: >> You couldn't prove that by me -- I'll ask my wife. She knows everything. >> >> Cheers, >> >> tedd > > And this will be the last we hear of Tedd... LOL Well... she did say "Don't worry about -- go shopping." So, I'll be leaving now. Chee

[PHP] Strange string stuff -- maybe everything is ending...

2012-12-21 Thread Tedd Sperling
Hi gang; I just ran into something I have never had a problem with before. Here's the code: --- start of code $topic = ''; while($row = mysql_fetch_array($result)) // pulling stuff from a database { $topic .= $row['category'] . '~'; // add

Re: [PHP] Strange string stuff -- maybe everything is ending...

2012-12-21 Thread Tedd Sperling
On Dec 21, 2012, at 5:05 PM, Ken Robinson wrote > A much easier way to do this would be to use a temporary array and then > explode: > > $tmp = array(); >while($row = mysql_fetch_array($result)) // pulling stuff from a > database >{ >$tmp[] = $row['catego

Re: [PHP] Strange string stuff -- maybe everything is ending...

2012-12-21 Thread Tedd Sperling
On Dec 21, 2012, at 4:58 PM, Jim Giner wrote: >> > Never realized that you could address a string as an array of chars, which > you are doing. Could that be the issue? Or did I learn something new? Or > should you have used substr to remove that last char? Jim: I guess you learned somethin

Re: [PHP] Strange string stuff -- maybe everything is ending...

2012-12-22 Thread Tedd Sperling
On Dec 21, 2012, at 5:20 PM, Volmar Machado wrote: > What is the result in FF? And on IE? (the echoed string) That's the problem, it's different. If the last char in a string is set to null, then it causes JavaScript routines running under IE to behave differently than the exact same JavaScrip

Re: [PHP] Strange string stuff -- maybe everything is ending...

2012-12-22 Thread Tedd Sperling
On Dec 21, 2012, at 5:27 PM, Jim Giner wrote: > From what I do know, there shouldn't be an a[4]. > In any case, let's assume that there is a bug in the string logic that you're > using. Why not just use substr? > > $topic = substr($topic,0,-1); and On Dec 21, 2012, at 6:10 PM, Nathan Nobbe w

Re: [PHP] Strange string stuff -- maybe everything is ending...

2012-12-22 Thread Tedd Sperling
On Dec 21, 2012, at 8:06 PM, Jim Giner wrote: >> That actually makes sense tho. Afterall, a string is truly only one memory >> allocation whereas array elements are basically multiple vars having the >> same name. So - how can you unset one char in a string? It depends upon the language -- wh

Re: [PHP] Strange string stuff -- maybe everything is ending...

2012-12-22 Thread Tedd Sperling
On Dec 22, 2012, at 7:58 AM, tamouse mailing lists wrote: > A bit of an example to shed a little light? > -snip- > Not knowing IE really at all, nor it's JS engine, it's entirely > possible that a null character in a string causes it to have problems. That's the explanation I was looking for --

Re: [PHP] Nested loopa

2012-12-27 Thread Tedd Sperling
On Dec 26, 2012, at 10:09 AM, Jim Giner wrote: > While I fully understand the purpose of the do...while construct, I just > never get used to seeing it used. (in other langs I had to deal with a > 'repeat...until construct and dis-liked that also). I pretty much know if > I'm going to have to

Re: [PHP] Boolean type forced on string assignment inside if statement

2013-01-03 Thread Tedd Sperling
On Jan 3, 2013, at 11:49 AM, Marc Guay wrote: > I just ran this: > > if (($a = "foo") || ($b = "bar")){ >echo $a."".$b; > } > > and it only spat out "foo" so I'm guessing things have changed. :) > > Marc Marc et al: I joined late into this conversation, so I may be missing the point, bu

Re: [PHP] Boolean type forced on string assignment inside if statement

2013-01-03 Thread Tedd Sperling
On Jan 3, 2013, at 12:09 PM, David OBrien wrote: > From what I understood about || is once it sees a true the whole statement > is regarded as true so nothing else following matters so PHP ignores > everything in the conditional after it evaluates as true... > and once it sees a false the whole st

Re: [PHP] Pear Page2

2013-01-05 Thread Tedd Sperling
On Jan 5, 2013, at 3:11 PM, Silvio Siefke wrote: > On Sat, 05 Jan 2013 17:21:05 + > Ashley Sheridan wrote: > >> If the pages are already written, why do you want to start changing >> the way they've been built? > > 1.) All websites are created manually. (nano + html/css Tags) > Not mine.

Re: [PHP] Pear Page2

2013-01-06 Thread Tedd Sperling
On Jan 5, 2013, at 4:24 PM, Silvio Siefke wrote: > > What should me say this two words? You not use nano, ok. Editors enough > on earth. Or you not write manually? Then share the way! Or use a CMS? Silvio: You said -- > 1.) All websites are created manually. (nano + html/css Tags) -- and I r

Re: [PHP] Pear Page2

2013-01-06 Thread Tedd Sperling
On Jan 6, 2013, at 12:52 PM, Silvio Siefke wrote: > On Sun, 6 Jan 2013 11:36:39 -0500 > Tedd Sperling wrote: >> So, where does that leave a "Web Developer?" It leaves them with the >> responsibility to learn and apply what they learned to their craft. >> Is

[PHP] Strip emails from a document

2013-01-26 Thread Tedd Sperling
Hi gang: I thought I had a function to strip emails from a document, but I can't find it. So, before I start writing a common script, do any of you have a simple script to do this? Here's an example of the problem: Before: "Will Alex" ;"Moita Zact" ;"Bob Arms" ;"Meia Terms" ; After: ale...

Re: [PHP] Strip emails from a document

2013-01-26 Thread Tedd Sperling
On Jan 26, 2013, at 12:20 PM, Daniel Brown wrote: > >It's imperfect, but will work for the majority of emails: > > function scrape_emails($input) { > > preg_match_all("/\b([a-z0-9%\._\+\-]+@[a-z0-9-\.]+\.[a-z]{2,6})\b/Ui",$input,$matches); >return $matches; > } > ?> It wor

Re: [PHP] Strip emails from a document

2013-01-26 Thread Tedd Sperling
On Jan 26, 2013, at 12:48 PM, shiplu wrote: > What is your input? > Check my first email in this thread. Cheers, tedd _ t...@sperling.com http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Is header() malfunction due to PHP5.3.3 -> 5.4.11 transition?

2013-02-09 Thread Tedd Sperling
On Feb 9, 2013, at 2:00 PM, Jonathan Eagle wrote: > I'm having a problem with a very straightforward routine; Jonathan: No offense to your routine, but you may want to review this: http://sperling.com/php/authorization/log-on.php If anyone finds an error, please post. Cheers, tedd __

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

2013-02-18 Thread Tedd Sperling
On 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] if (empty versus if (isset

2013-02-20 Thread Tedd Sperling
On Feb 20, 2013, at 9:10 AM, Jim Giner wrote: > Basically it tells a savvy programmer whether or not his logic has caused the > var in question to "exist". Many times it is important simply to know that, > not what the var contains, which can lead to an error in processing. > > The isset() wi

Re: [PHP] phpinfo()

2013-02-20 Thread Tedd Sperling
On Feb 19, 2013, at 7:57 PM, John Taylor-Johnston wrote: > I cannot find button2 in phpinfo() when I click it. I was hoping to find a > $_POST["button2"] value. > What am I doing wrong? > > onclick="formSubmit()"> > > I really wanted to use a button to pass a different condition than a type

Re: [PHP] parsing select multiple="multiple"

2013-02-20 Thread Tedd Sperling
On Feb 18, 2013, at 7:54 PM, John Taylor-Johnston wrote: > I am capable with . (I suppose I did it correctly? > :p ) > But I haven't the first clue how to parse a and multiply > select name="DPRtype". > Would anyone give me a couple of clues please? :) > Thanks, > John John: A clue? How abo

Re: [PHP] phpinfo()

2013-02-20 Thread Tedd Sperling
On Feb 20, 2013, at 2:31 PM, Stuart Dallas wrote: > You were given the answer, did you not try it? > > Starting with the code in your original post: > > 1) Change the type to submit. > 2) Remove the onclick. > 3) Job done! > > -Stuart Sometimes you just can't help. > Sent from my leaf blowe

Re: [PHP] Finding an Address

2013-03-01 Thread Tedd Sperling
On Feb 28, 2013, at 12:36 PM, Floyd Resler wrote: > I have a project where my client would like to find the nearest street > address from where he current is. Getting the longitude and latitude is easy > enough but I'm having a hard time finding out how to get the nearest house. > I have fou

Re: [PHP] Introduction ... !

2013-03-02 Thread Tedd Sperling
On Mar 2, 2013, at 11:25 AM, Jay Blanchard wrote: >> No - Tedd is old. The rest of us are just Spring chickens. Hey, let's watch that... a, what? What the hell was I saying??? Awww .. forget it. Did I tell you about when I programed with rocks? That was before someone invented the abse

Re: [PHP] Introduction ... !

2013-03-02 Thread Tedd Sperling
On Mar 2, 2013, at 11:26 AM, Stuart Dallas wrote: > On 2 Mar 2013, at 16:25, Jay Blanchard > wrote: > >> No - Tedd is old. The rest of us are just Spring chickens. > > Speak for yourself, I'm an autumn turkey! > > -Stuart What's this "autumn" nonsense? tedd _ t...@sper

Re: [PHP] Introduction ... !

2013-03-02 Thread Tedd Sperling
On Mar 2, 2013, at 2:20 PM, tamouse mailing lists wrote: > See, you can't really call yourself old until that's pooping and cramping... That reminds me -- a couple of my older friends and I were discussing getting old. One friend said "At 8:00 am I have a terrible time taking a poop." My othe

Re: [PHP] Open form in new window

2013-03-05 Thread Tedd Sperling
On Mar 4, 2013, at 3:17 PM, Paul M Foster wrote: > On Mon, Mar 04, 2013 at 05:39:00PM +, Tim Streater wrote: > >> On 04 Mar 2013 at 17:10, John Taylor-Johnston >> wrote: >> >>> Submit will not >>> submit the form contents. >> >> Nothing to stop your OpenWindow() function doing a submit

Re: [PHP] PHP Web Developer Opportunity

2013-03-05 Thread Tedd Sperling
On Mar 4, 2013, at 3:10 PM, Allison Garcia wrote: > *SMALL WORLD LABS is looking for a PHP WEB DEVELOPER * > > Small World Labs is looking for a PHP Web Developer to be a part of our > team. The position is focused on managing, supporting and expanding the > Small World Labs social collaboratio

Re: [PHP] Open form in new window

2013-03-05 Thread Tedd Sperling
On Mar 4, 2013, at 12:54 PM, John Taylor-Johnston wrote: > If you want to open a new page in response to a submit button press (using > PHP) you may be out of luck. I don't know of a way to do it without involving > another language. Opening a different page in the *same* window, yes. > Oth

Re: [PHP] PHP Web Developer Opportunity

2013-03-05 Thread Tedd Sperling
On Mar 5, 2013, at 7:18 PM, Matijn Woudt wrote: On Wed, Mar 6, 2013 at 1:16 AM, Tedd Sperling wrote: > On Mar 4, 2013, at 3:10 PM, Allison Garcia wrote: > -snip- > What are you offering? > > $2/hr. > > Oh, It's not Friday.. Is it more on Friday? Cheers, ted

Re: [PHP] Open form in new window

2013-03-06 Thread Tedd Sperling
On Mar 5, 2013, at 10:12 PM, Jim Giner wrote > On 3/5/2013 7:32 PM, Tedd Sperling wrote: >> On Mar 4, 2013, at 12:54 PM, John Taylor-Johnston >> wrote: >> >>> If you want to open a new page in response to a submit button press (using >>> PHP) you may b

Re: [PHP] Testing

2013-03-08 Thread Tedd Sperling
On Mar 8, 2013, at 1:20 PM, Dustin L wrote: > This is my first time using a list. Can anyone confirm I'm doing this > correctly? > > > Thanks, > > > Dustin L. Oh, now you did it! There will be dogs and cats in the streets. Cheers, tedd _ t...@sperling.com http://sper

Re: [PHP] webform spam prevention

2013-04-06 Thread Tedd Sperling
On Apr 4, 2013, at 5:02 AM, Ashley Sheridan wrote: > or you can't see at all) then you have to fall back to the audio > replacement offered by the captcha. I've tried listening to some, and > they are awful. > > > Thanks, > Ash Ash: How about the second one down? Can you hear this one clear e

Re: [PHP] mysql_connect noob question

2013-04-20 Thread Tedd Sperling
On Apr 19, 2013, at 4:43 PM, Glob Design Info wrote: > I know this has probably been answered already. > > When I pass a user name and password from a form to my PHP script and then > pass those to mysql_connect it doesn't connect. When I paste those exact same > values into mysql_connect as s

Re: [PHP] mysql_connect noob question

2013-04-20 Thread Tedd Sperling
On Apr 20, 2013, at 11:44 AM, Stuart Dallas wrote: > On 20 Apr 2013, at 16:25, Jim Giner wrote: > >>> Why are you allowing anyone to connect to your database from a form? >>> >> A little OT, but... >> What do you mean by this question? How do you check someone's credentials >> if not by conn

Re: [PHP] mysql_connect noob question

2013-04-21 Thread Tedd Sperling
On Apr 21, 2013, at 9:32 AM, Stuart Dallas wrote: > However, a more important question for me is why you are doing this. You say > you are aware of the security implications, and that you'll "deal with that > later," but I question how you're going to deal with it. What exactly are you > develo

Re: [PHP] mysql_connect noob question

2013-04-23 Thread Tedd Sperling
On Apr 21, 2013, at 3:33 PM, Glob Design Info wrote: > What question did I not answer? That proves that you're not listening -- you are total waste of time for anyone trying to help. Welcome to my ignore file. tedd _ tedd.sperl...@gmail.com http://sperling.com -- PHP G

Re: [PHP] generate onfly PDF

2013-05-04 Thread Tedd Sperling
On May 4, 2013, at 5:00 PM, Ashley Sheridan wrote: > Rafnews wrote: > Is there a solution to generate onfly PDF from HTML page, and from data >> >> user typed in form (let's say like a template) without using PECL ? >> i read that is hosting does not allow such extension, we can not >> generate

Re: [PHP]

2013-05-08 Thread Tedd Sperling
On May 8, 2013, at 12:50 PM, Daniel Brown wrote: >If you're going to send hack attempts, at least adjust your clock > so that it doesn't look like it took almost a month for your SPAM to > get here. We're not the Pony Express. (And, no, PHP doesn't stand > for Produced by Horses & Ponies.) >

Re: [PHP] A Good OOP Tutorial/Read?

2013-05-16 Thread Tedd Sperling
-Dan: I teach this stuff and still don't fully understand the why/when for interfaces. Even the guru's I talk with can't give me a good explanation as to what the advantages are in using them. I've done a lot of experimenting and can't see any advantage for them other than grouping different cl

Re: [PHP] A Good OOP Tutorial/Read?

2013-05-16 Thread Tedd Sperling
Thanks to both Bastien and Sebastian: While I understand that an interface is like an abstract Class, in that you don't have to flesh-out your methods, but rather where you define exactly how Classes who implement that interface will be required to flesh-out those methods. But so what? What's t

Re: [PHP] A Good OOP Tutorial/Read?

2013-05-17 Thread Tedd Sperling
effort to understand polymorphic concepts of OOP as > they are rudimentary. Without that one will never grasp OO Patterns > (Gang of Four). > > Ninus. > > On 5/16/13, Tedd Sperling wrote: >> Thanks to both Bastien and Sebastian: >> >> While I understand that an i

Re: [PHP] A Good OOP Tutorial/Read?

2013-05-17 Thread Tedd Sperling
Stuart: You said: > An interface does what it says on the tin: it describes an interface that a > class can then tell the world it implements. > > An abstract class provides functionality as well as an interface description. > An abstract class cannot be instantiated, it can only be extended.

Re: [PHP] A Good OOP Tutorial/Read?

2013-05-19 Thread Tedd Sperling
On May 19, 2013, at 5:19 AM, mrfroasty wrote: > On 05/16/2013 11:28 PM, Tedd Sperling wrote: >> So, if you find a good reference, please let me know. > > In my point of view, Interfaces and Abstracts are completely different stuffs > not related at all.Interface is a kind of

Re: [PHP] A Good OOP Tutorial/Read?

2013-05-19 Thread Tedd Sperling
To all: Thanks to Stuart, I finally got it. The concept of Interface is a bit difficult to explain, but his excellent console made the concept clear. Many thanks to all for their efforts to educate me. Cheers, tedd _ t...@sperling.com http://sperling.com -- PHP General

  1   2   3   >