php-general Digest 11 Jan 2009 13:24:52 -0000 Issue 5895

2009-01-11 Thread php-general-digest-help
php-general Digest 11 Jan 2009 13:24:52 - Issue 5895 Topics (messages 285999 through 286012): Re: Unique Object Instance ID..? 285999 by: Nathan Nobbe 286006 by: Ross McKay 286008 by: Micah Gersten 286010 by: Robert Cummings Re: Editing in a text area field

Re: [PHP] Re: hello

2009-01-11 Thread Robert Cummings
On Sat, 2009-01-10 at 23:58 +0100, Björn Bartels wrote: *rofl* damn... i love this list... so much for on- ehmmm off-list posts :p ... It's not just a list... it's a community :) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing

Re: [PHP] Re: Unique Object Instance ID..?

2009-01-11 Thread Robert Cummings
On Sun, 2009-01-11 at 00:07 +, Nathan Rixham wrote: Colin Guthrie wrote: 'Twas brillig, and Nathan Rixham at 10/01/09 23:31 did gyre and gimble: all I need is a completely unique id for each object instance that can never be repeated at any time, even in a multiserver environment (and

Re: [PHP] Couple of beginner questions

2009-01-11 Thread tedd
At 4:16 PM -0500 1/10/09, Paul M Foster wrote: And let me present an alternative perspective. Never do something like: ?php echo 'Hellow world'; ? Let Apache (or whatever) interpret HTML as HTML, and don't make it interpret PHP code as HTML. Instead, do: h1Hello world/h1 If you're going to

Re: [PHP] Editing in a text area field

2009-01-11 Thread tedd
At 7:02 PM -0500 1/10/09, Phpster wrote: That can and should be done with a simple str_replace() on the display portion of the code. Bastien Really? Then how do you handle these examples of client input? This is bwhat/b I have to say. This is ibwhat/i/b I have to say. This is bwhatb I

Re: [PHP] Couple of beginner questions

2009-01-11 Thread Ashley Sheridan
On Sun, 2009-01-11 at 08:08 -0500, tedd wrote: At 4:16 PM -0500 1/10/09, Paul M Foster wrote: And let me present an alternative perspective. Never do something like: ?php echo 'Hellow world'; ? Let Apache (or whatever) interpret HTML as HTML, and don't make it interpret PHP code as HTML.

Re: [PHP] Editing in a text area field

2009-01-11 Thread tedd
At 11:12 AM +1100 1/11/09, Ross McKay wrote: With a little cooperation from the client, and a properly configured TinyMCE, you can fairly easily limit what HTML tags they use. Yes, when you have intelligent and cooperative clients -- have any to spare? You can then provide a set of CSS

Re: [PHP] Editing in a text area field

2009-01-11 Thread tedd
At 11:19 AM +1100 1/11/09, Ross McKay wrote: tedd wrote: The argument over what HTML is, will never be resolved. I say it's a delivery mechanism and tags such as b and i are unwanted elements. They simply confuse/blur the purpose of the language. I should have said strong and em, I guess.

Re: [PHP] Editing in a text area field

2009-01-11 Thread Eric Butera
On Sun, Jan 11, 2009 at 8:50 AM, tedd tedd.sperl...@gmail.com wrote: At 11:12 AM +1100 1/11/09, Ross McKay wrote: With a little cooperation from the client, and a properly configured TinyMCE, you can fairly easily limit what HTML tags they use. Yes, when you have intelligent and cooperative

Re: [PHP] String variable

2009-01-11 Thread Eric Butera
On Sun, Jan 11, 2009 at 8:59 AM, MikeP mpel...@princeton.edu wrote: Hello, I am trying yo get THIS: where ref_id = '1234' from this. $where=where ref_id=.'$Reference[$x][ref_id]'; but i certainly have a quote problem. Any help? Thanks Mike -- PHP General Mailing List

Re: [PHP] String variable

2009-01-11 Thread Ashley Sheridan
On Sun, 2009-01-11 at 08:59 -0500, MikeP wrote: Hello, I am trying yo get THIS: where ref_id = '1234' from this. $where=where ref_id=.'$Reference[$x][ref_id]'; but i certainly have a quote problem. Any help? Thanks Mike It should look like this: $where=where

Re: [PHP] String variable

2009-01-11 Thread Ashley Sheridan
On Sun, 2009-01-11 at 14:36 +, Ashley Sheridan wrote: On Sun, 2009-01-11 at 08:59 -0500, MikeP wrote: Hello, I am trying yo get THIS: where ref_id = '1234' from this. $where=where ref_id=.'$Reference[$x][ref_id]'; but i certainly have a quote problem. Any help? Thanks

Re: [PHP] Editing in a text area field

2009-01-11 Thread tedd
At 11:24 AM +1100 1/11/09, Ross McKay wrote: Nathan Rixham wrote: HTML is a markup language used to describe the structure of a document; presentation of HTML is controlled by either a client, with optional instructions via attributes (bad) or css (good) I almost agree, except that there are

Re: [PHP] Couple of beginner questions

2009-01-11 Thread tedd
At 1:49 PM + 1/11/09, Ashley Sheridan wrote: Unless it's something like this: ?php echo h1 class=\$headerClass\$whatever/h1; ? Which is unlikely for a header tag, but I know this sort of format gets used a lot by me and others, especially for setting alternate row styles on tables (damn

Re: [PHP] Couple of beginner questions

2009-01-11 Thread Ashley Sheridan
On Sun, 2009-01-11 at 09:46 -0500, tedd wrote: At 1:49 PM + 1/11/09, Ashley Sheridan wrote: Unless it's something like this: ?php echo h1 class=\$headerClass\$whatever/h1; ? Which is unlikely for a header tag, but I know this sort of format gets used a lot by me and others,

Re: [PHP] Editing in a text area field

2009-01-11 Thread tedd
At 9:02 AM -0500 1/11/09, Eric Butera wrote: I tried using tidy to clean up some of that stuff but it was giving me even more problems. I enjoyed having valid docs with all the crap ripped out, but I use my editor blocks on lots of different parts of the site, so having it remove/combine style

Re: [PHP] Couple of beginner questions

2009-01-11 Thread tedd
At 3:02 PM + 1/11/09, Ashley Sheridan wrote: On Sun, 2009-01-11 at 09:46 -0500, tedd wrote: At 1:49 PM + 1/11/09, Ashley Sheridan wrote: Unless it's something like this: ?php echo h1 class=\$headerClass\$whatever/h1; ? Here's the alterative I would use: h1

Re: [PHP] Couple of beginner questions

2009-01-11 Thread Ashley Sheridan
On Sun, 2009-01-11 at 10:16 -0500, tedd wrote: At 3:02 PM + 1/11/09, Ashley Sheridan wrote: On Sun, 2009-01-11 at 09:46 -0500, tedd wrote: At 1:49 PM + 1/11/09, Ashley Sheridan wrote: Unless it's something like this: ?php echo h1 class=\$headerClass\$whatever/h1;

Re: [PHP] Couple of beginner questions

2009-01-11 Thread Eric Butera
On Sun, Jan 11, 2009 at 10:36 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: echo img src=\$url\ alt=\$alt\ title=\$alt\ class=\$imgclass Gross! If that is what you're doing use a printf or change attr quotes to '. I've seen entire html pages escaped out like that. -- PHP General

Re: [PHP] Couple of beginner questions

2009-01-11 Thread Ashley Sheridan
On Sun, 2009-01-11 at 10:44 -0500, Eric Butera wrote: On Sun, Jan 11, 2009 at 10:36 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: echo img src=\$url\ alt=\$alt\ title=\$alt\ class=\$imgclass Gross! If that is what you're doing use a printf or change attr quotes to '. I've seen

Re: [PHP] Editing in a text area field

2009-01-11 Thread Al
c...@l-i-e.com wrote: Rule #1. Never, ever, ever, alter the user's input, EXCEPT for sanitizing/filtering. Specifically, do NOT add br / tags in place of newlines. Store the newlines. Upon OUTPUT, you can use nl2br() to get br / tags. Or str_replace if you want /p instead. This is crucial as

[PHP] FirePHP -- pretty cool

2009-01-11 Thread Skip Evans
Hey all, I'm sure many of you use Firebug in Firefox for help debugging, and some of you also no doubt know about FirePHP, the PHP class that let's you write logs to the Firebug console. In case you don't know about it, Joe Bob Briggs says, Check it out. I just installed and it's pretty

Re: [PHP] Couple of beginner questions

2009-01-11 Thread Nathan Rixham
Ashley Sheridan wrote: On Sun, 2009-01-11 at 10:16 -0500, tedd wrote: At 3:02 PM + 1/11/09, Ashley Sheridan wrote: On Sun, 2009-01-11 at 09:46 -0500, tedd wrote: At 1:49 PM + 1/11/09, Ashley Sheridan wrote: Unless it's something like this: ?php echo h1

Re: [PHP] String variable

2009-01-11 Thread Nathan Rixham
Ashley Sheridan wrote: On Sun, 2009-01-11 at 14:36 +, Ashley Sheridan wrote: On Sun, 2009-01-11 at 08:59 -0500, MikeP wrote: Hello, I am trying yo get THIS: where ref_id = '1234' from this. $where=where ref_id=.'$Reference[$x][ref_id]'; but i certainly have a quote problem. Any help?

Re: [PHP] Couple of beginner questions

2009-01-11 Thread Robert Cummings
On Sun, 2009-01-11 at 17:01 +, Nathan Rixham wrote: i love these discussions on pedantics and semantics! personally (when I need to) I always go for a bit of concatenation so in the example above: // somewhere in the business logic / functional layer $imgHTML = 'img src=' . $url .

[PHP] RSS feeder in PHP5?

2009-01-11 Thread Michelle Konzack
Hello, on my website I have a NEWS section on http://www.tamay-dogan.net/?what=news and the news are stored in a SQL table with date, summary, fulltext Now I like to add an RSS feed with something like http://www.tamay-dogan.net/?what=newsaction=rss which require only an additional

Re: [PHP] is_readable(http://.... text file) says not, but I can in browser

2009-01-11 Thread John Allsopp
Daniel Brown wrote: On Sun, Dec 28, 2008 at 13:02, John Allsopp j...@johnallsopp.co.uk wrote: $myFileLast = http://www.myDomain.com/text.txt;; if (is_readable($myFileLast)) { $fh = fopen($myFileLast, 'r'); $theDataLast = fread($fh, 200);

Re: [PHP] is_readable(http://.... text file) says not, but I can in browser

2009-01-11 Thread John Allsopp
Nathan Nobbe wrote: On Sun, Dec 28, 2008 at 11:02 AM, John Allsopp j...@johnallsopp.co.ukwrote: Hi I'm sure this is simple for yous all but I'm not sure I know the answer. $myFileLast = http://www.myDomain.com/text.txt;; if (is_readable($myFileLast)) { $fh =

Re: [PHP] Couple of beginner questions

2009-01-11 Thread Nathan Rixham
Robert Cummings wrote: On Sun, 2009-01-11 at 17:01 +, Nathan Rixham wrote: i love these discussions on pedantics and semantics! personally (when I need to) I always go for a bit of concatenation so in the example above: // somewhere in the business logic / functional layer $imgHTML =

Re: [PHP] is_readable(http://.... text file) says not, but I canin browser

2009-01-11 Thread Nathan Rixham
John Allsopp wrote: Nathan Nobbe wrote: On Sun, Dec 28, 2008 at 11:02 AM, John Allsopp j...@johnallsopp.co.ukwrote: Hi I'm sure this is simple for yous all but I'm not sure I know the answer. $myFileLast = http://www.myDomain.com/text.txt;; if (is_readable($myFileLast))

Re: [PHP] is_readable(http://.... text file) says not, but I canin browser

2009-01-11 Thread Nathan Rixham
John Allsopp wrote: Daniel Brown wrote: On Sun, Dec 28, 2008 at 13:02, John Allsopp j...@johnallsopp.co.uk wrote: $myFileLast = http://www.myDomain.com/text.txt;; if (is_readable($myFileLast)) { $fh = fopen($myFileLast, 'r'); $theDataLast = fread($fh,

Re: [PHP] is_readable(http://.... text file) says not, but I can in browser

2009-01-11 Thread Daniel Brown
On Sun, Jan 11, 2009 at 13:07, John Allsopp j...@johnallsopp.co.uk wrote: Thanks, that worked a treat except I was getting warnings on 404. I looked around for solutions to that and it appears curl might handle that better, so I'm currently working on that. Many thanks tho .. let me know if

Re: [PHP] is_readable(http://.... text file) says not, but I can in browser

2009-01-11 Thread Daniel Brown
On Sun, Jan 11, 2009 at 13:10, John Allsopp j...@johnallsopp.co.uk wrote: So far I'm getting a lot of *Warning*: curl_setopt(): supplied argument is not a valid cURL handle resource in */home/myAcc/public_html/test.php* on line *58 * I searched phpinfo for 'curl' and it came up nothing, so

Re: [PHP] is_readable(http://.... text file) says not, but I can in browser

2009-01-11 Thread Nathan Rixham
Daniel Brown wrote: On Sun, Jan 11, 2009 at 13:07, John Allsopp j...@johnallsopp.co.uk wrote: Thanks, that worked a treat except I was getting warnings on 404. I looked around for solutions to that and it appears curl might handle that better, so I'm currently working on that. Many thanks tho

Re: [PHP] FirePHP -- pretty cool

2009-01-11 Thread Nitsan Bin-Nun
I'm using FireBug 24/7/365 and I also knew FirePHP before but I never tried it or had any experience with it that I can share. There are any other options and functions that FirePHP gives which not require you to involve changing your code? Nitsan On Sun, Jan 11, 2009 at 6:46 PM, Skip Evans

Re: [PHP] is_readable(http://.... text file) says not, but I can in browser

2009-01-11 Thread Daniel Brown
On Sun, Jan 11, 2009 at 13:42, Nathan Rixham nrix...@gmail.com wrote: pedantic: really you'd want to check the http status header returned and take the appropriate action depending on what header was returned. I'm sure there's a way to get the headers from a file_get_contents using one of

Re: [PHP] FirePHP -- pretty cool

2009-01-11 Thread Skip Evans
Hey Nitsan all, I haven't been through it all, I just installed the plug in and download the file to include and started using it. I would imagine you have to use their log function to get any output, but it seems like the kind of thing that could be left in the code without any

Re: [PHP] is_readable(http://.... text file) says not, but I canin browser

2009-01-11 Thread John Allsopp
Nathan Rixham wrote: John Allsopp wrote: Nathan Nobbe wrote: On Sun, Dec 28, 2008 at 11:02 AM, John Allsopp j...@johnallsopp.co.ukwrote: Hi I'm sure this is simple for yous all but I'm not sure I know the answer. $myFileLast = http://www.myDomain.com/text.txt;; if

Re: [PHP] Couple of beginner questions

2009-01-11 Thread Robert Cummings
On Sun, 2009-01-11 at 18:14 +, Nathan Rixham wrote: Robert Cummings wrote: the above means that moving back to the original h1 example(s) I'd simply h1whatever/h1 I'd probably do: project:titleWhatever/project:title Which would expand to: h1

Re: [PHP] Couple of beginner questions

2009-01-11 Thread Nathan Rixham
Robert Cummings wrote: On Sun, 2009-01-11 at 18:14 +, Nathan Rixham wrote: Robert Cummings wrote: the above means that moving back to the original h1 example(s) I'd simply h1whatever/h1 I'd probably do: project:titleWhatever/project:title Which would expand to: h1

Re: [PHP] Couple of beginner questions

2009-01-11 Thread Robert Cummings
On Sun, 2009-01-11 at 21:01 +, Nathan Rixham wrote: Robert Cummings wrote: example: http://www.w3.org/TR/xhtml1/ from the source: h1a name=title id=title/a XHTML#8482; 1.0 The Extensible HyperText Markup Language (Second Edition)/h1 because the document is the XHTML™ 1.0

Re: [PHP] Re: redoing website after 7 years

2009-01-11 Thread Chris
Robert Cummings wrote: On Fri, 2009-01-09 at 08:56 -0500, Andrew Ballard wrote: On Fri, Jan 9, 2009 at 2:09 AM, Robert Cummings rob...@interjinn.com wrote: On Fri, 2009-01-09 at 15:17 +1100, Chris wrote: I know many people will grin at me for this solution but may be faster way to overcome

Re: [PHP] Re: redoing website after 7 years

2009-01-11 Thread Robert Cummings
On Mon, 2009-01-12 at 09:00 +1100, Chris wrote: Robert Cummings wrote: On Fri, 2009-01-09 at 08:56 -0500, Andrew Ballard wrote: On Fri, Jan 9, 2009 at 2:09 AM, Robert Cummings rob...@interjinn.com wrote: On Fri, 2009-01-09 at 15:17 +1100, Chris wrote: I know many people will grin at me

Re: [PHP] Re: redoing website after 7 years

2009-01-11 Thread Chris
Robert Cummings wrote: On Mon, 2009-01-12 at 09:00 +1100, Chris wrote: Robert Cummings wrote: On Fri, 2009-01-09 at 08:56 -0500, Andrew Ballard wrote: On Fri, Jan 9, 2009 at 2:09 AM, Robert Cummings rob...@interjinn.com wrote: On Fri, 2009-01-09 at 15:17 +1100, Chris wrote: I know many

Re: [PHP] pecl4win - any updates?

2009-01-11 Thread Chris
pan wrote: Has there been any progress reinstating pecl packages for windows? per the comment on php.net, join the Windows Internals list (or perhaps the Windows PHP users list might have some info). -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List

Re: [PHP] pecl4win - any updates?

2009-01-11 Thread pan
Chris dmag...@gmail.com wrote in message news:496a6f34.1080...@gmail.com... pan wrote: Has there been any progress reinstating pecl packages for windows? per the comment on php.net, join the Windows Internals list (or perhaps the Windows PHP users list might have some info). Thanks for

[PHP] Re: FirePHP -- pretty cool

2009-01-11 Thread Colin Guthrie
'Twas brillig, and Skip Evans at 11/01/09 19:19 did gyre and gimble: Hey Nitsan all, I haven't been through it all, I just installed the plug in and download the file to include and started using it. I would imagine you have to use their log function to get any output, but it seems like

Re: [PHP] Editing in a text area field

2009-01-11 Thread Ross McKay
G'day Tedd, Yes, when you have intelligent and cooperative clients -- have any to spare? Hey, you keep your grubby mitts off my intelligent and cooperative clients, it took a while to get them that way :) Let's face it: people who pay other people to do a job for them usually don't understand

Re: [PHP] Editing in a text area field

2009-01-11 Thread Ross McKay
On Sun, 11 Jan 2009 09:59:22 -0500, tedd.sperling wrote: I've tried stripping out all Gremlins, like so: That looks like a great (slow) way to rip out characters that probably ought to be there, like left and right single and double quotes, em and en dashes, ellipses, copyright and trademark

Re: [PHP] Referencing variable in calling class?

2009-01-11 Thread Murray
Hi Paul, To be honest, I'm still finding my way around as to how I want to approach this application, but my question is valid in some sense no matter which direction I pursue. I finally opted to make the relevant variables in my front controller class static, so I could directly reference them

Re: [PHP] String variable

2009-01-11 Thread Lars Torben Wilson
2009/1/11 Ashley Sheridan a...@ashleysheridan.co.uk: On Sun, 2009-01-11 at 14:36 +, Ashley Sheridan wrote: On Sun, 2009-01-11 at 08:59 -0500, MikeP wrote: Hello, I am trying yo get THIS: where ref_id = '1234' from this. $where=where ref_id=.'$Reference[$x][ref_id]'; but i

Re: [PHP] Couple of beginner questions

2009-01-11 Thread Chris
tedd wrote: At 11:35 AM -0800 1/9/09, VamVan wrote: -- Remember as you re still a beginner try to avoid using ? at the end of complete PHP code page. or else if you have empty lines at the end of the file then you wont see blank page of death in PHP. I'm not a beginner, but this is a

Re: [PHP] Couple of beginner questions

2009-01-11 Thread John Corry
One of the best things that ever happened to me (with regards to writing PHP) was deciding not to embed it in HTML anymore. I either: a) generate the HTML from classes I've built (HTML, Forms, Tables, Images, etc) or use an equivalent PEAR class - or - b) Use Smarty templates...in which I still

Re: [PHP] Couple of beginner questions

2009-01-11 Thread Paul M Foster
On Mon, Jan 12, 2009 at 12:04:15AM -0500, John Corry wrote: One of the best things that ever happened to me (with regards to writing PHP) was deciding not to embed it in HTML anymore. I either: a) generate the HTML from classes I've built (HTML, Forms, Tables, Images, etc) or use an