php-general Digest 30 Sep 2007 11:31:01 -0000 Issue 5046
Topics (messages 262583 through 262593):
Re: Beginner Tutorials for using CLASSES in PHP4
262583 by: Jeff Cohan
262584 by: Nathan Nobbe
262586 by: Jeff Cohan
262588 by: Nathan Nobbe
Re: counting with leading zeros
262585 by: brian
Re: Classes and access to outside variables
262587 by: æ½å¿å½¬
262589 by: Nathan Nobbe
500 Internal Server Error
262590 by: Francisco Frost
262591 by: Per Jessen
262592 by: Francisco Frost
262593 by: Jürgen Wind
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Instruct ICC wrote:
> > From: [EMAIL PROTECTED]
> > Today's post was
> > prompted by my desire to prototype yet another suite of
> > browse-read-edit-add-delete functions for someone.
>
> I was just going to ask you what is BREAD. Cool, basically a
> Web-based CRUD? I can't find anything on it, can you point
> me to some sites?
Being a carbo-freak, I just prefer the BREAD acronym to CRUD. I
think I found the BREAD reference first in Wikipedia. (I know, I
know...)
--- End Message ---
--- Begin Message ---
although some people believe differently than i; i would argue
trying to learn how to design w/ the classes that php4 provides
is a waste of time. most books you will find regarding object oriented
design assume the language has the basic constructs. ppp mainly.
also, there are other important facilities php4 lacks like abstract classes
and interfaces, not to mention you have to explicitly assign objects by
reference in php4. (if you dont want a copy created).
unless you are bound to php4 by work or something
i suggest you start working w/ php5. also, if your looking for some design
techniques i recommend studying design patterns. the heads first book
is a great starting point.
actually if you want a solid reference thats free on the web look at
phpPatterns <http://www.phppatterns.com/docs/start>
the code is mostly php4 i believe.
-nathan
On 9/29/07, Jeff Cohan <[EMAIL PROTECTED]> wrote:
>
> Yes, I know how to Google, and I've been Googling...
>
> But I would appreciate advice about good beginner tutorials using
> classes in PHP4 based on your actual experiences. I.e., have some of
> you found tutorials that really unlocked the doors for you?
>
> Ideally, such tutorials would have somewhat realistic examples. (I
> already know how to output "Hello, World" using a class, and I tend
> to find examples like those unhelpful. Maybe it's just me.)
>
> My main challenge is modularizing yer basic BREAD/CRUD operations
> with MySQL databases.
>
> I've made some strides in creating increasingly modular functions to
> present browse lists, edit forms and add forms; to perform
> field-level and form-level validations; and to perform inserts,
> updates and deletes. My approach is to utilize multidimensional
> arrays which define the column names, column labels (for forms),
> form control types (input, select, checkbox, etc.) and other
> attributes of the form controls. I've got a "library" of validation
> routines with error messages that appear on the form under the
> culprit form control.
>
> But I think taking the next step to use classes is going to make my
> life much easier.
>
> TIA for any guidance you might be able to offer.
>
> Jeff
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Nathan Nobbe wrote:
>
> although some people believe differently than i; i would argue
> trying to learn how to design w/ the classes that php4 provides
> is a waste of time. most books you will find regarding object oriented
> design assume the language has the basic constructs. ppp mainly.
> also, there are other important facilities php4 lacks like abstract classes
> and interfaces, not to mention you have to explicitly assign objects by
> reference in php4. (if you dont want a copy created).
> unless you are bound to php4 by work or something
> i suggest you start working w/ php5. also, if your looking for some design
> techniques i recommend studying design patterns. the heads first book
> is a great starting point.
> actually if you want a solid reference thats free on the web look at
> phpPatterns <http://www.phppatterns.com/docs/start>
> the code is mostly php4 i believe.
>
> -nathan
Thanks, Nathan. I have been moving toward the conclusion you suggest
(i.e., don't bother with OOP in php4). Yes, I'm bound to php4
currently.
--- End Message ---
--- Begin Message ---
painfully i find myself bound to it at my current job. there ive been able
to
realize that proper oop can be used to an amazing extent in php4, however
altogether i wish we could just move on to 5 and i could stop writing in
// private
as a comment :)
-nathan
On 9/30/07, Jeff Cohan <[EMAIL PROTECTED]> wrote:
>
> Nathan Nobbe wrote:
> >
> > although some people believe differently than i; i would argue
> > trying to learn how to design w/ the classes that php4 provides
> > is a waste of time. most books you will find regarding object oriented
> > design assume the language has the basic constructs. ppp mainly.
> > also, there are other important facilities php4 lacks like abstract
> classes
> > and interfaces, not to mention you have to explicitly assign objects by
> > reference in php4. (if you dont want a copy created).
> > unless you are bound to php4 by work or something
> > i suggest you start working w/ php5. also, if your looking for some
> design
> > techniques i recommend studying design patterns. the heads first book
> > is a great starting point.
> > actually if you want a solid reference thats free on the web look at
> > phpPatterns <http://www.phppatterns.com/docs/start>
> > the code is mostly php4 i believe.
> >
> > -nathan
>
> Thanks, Nathan. I have been moving toward the conclusion you suggest
> (i.e., don't bother with OOP in php4). Yes, I'm bound to php4
> currently.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
tedd wrote:
At 8:30 PM -0400 9/27/07, brian wrote:
I wasn't bitching! And i *thought* that my numerous attempts at
explaining such would have been enough. Obviously not, but wtf can you
do with people who seem to want only to stir up shit?
It sure sounded like you were bitching.
Gee, thanks for pointing that out, Jeeves. I'd say it's pretty damned
obvious now that Rob thought i was bitching about his response to my
query. However, if you'd have bothered to note my replies since, you
might have twigged to the fact that i'd been trying to set that
straight. But you just *had* to send off your own dickish response.
And, your off-list "fuck you, too, asswipe" to me certainly seems to
support that -- don't you think?
How so? Had it crossed your little mind that maybe--just maybe--i was
becoming not a little frustrated with the fact that my reply had been
taken the wrong way? That, instead of accepting that and moving on, this
had become far too OT with bullshit comments such as yours? So, yeah,
you might say that i'm bitching *now*.
You and i have had our run-ins on this list on more than one occasion.
Until now, i've chosen to take your crap in stride. If you have nothing
constructive to add then STFU.
Look, there's nothing you can say to me that hasn't been said before
(some of it deserving), so my advice is for you to refrain from such
conduct and at least try to look professional. That way you'll hide your
ignorance a little longer -- it's always worked for me.
This is me laughing. I'm sure you have no bloody idea how funny that
statement looks from where i'm sitting. See the paragraph above.
Dan Parry wrote:
Can I please interject and say that I vastly respect Tedd(ddd) and Rob(bb?)
and their opinions
It's not so much that i disrespect Rob. It's just that i felt i had to
call him out for being a dickhead by taking my statement out of context.
Tedd ... not so very much at all.
Robert Cummings wrote:
> On Fri, 2007-09-28 at 12:05 -0400, tedd wrote:
>
>>>>At 10:39 PM -0400 9/26/07, brian wrote:
>>>>
>>>fuck you, too, asswipe
>
> Seems to be, an extra, comma, in the phrase. It reads, like Captain
> Kirk, saying, it.
>
Funny. Reminds of a Capt. Kirk quote:
"No more blah, blah, blah!"
brian
--- End Message ---
--- Begin Message ---
$dbh = 'test';
class search_helper extends AjaxACApplication
{
/**
* Database connection details
*/
// announce global variable before use it
global $dbh;
$db_hostname = $dbh;
...
Regards,
Ryu
2007/9/29, Merlin <[EMAIL PROTECTED]>:
>
> Hi there,
>
> I am new to PHP classes and I do want to access a variable outside the
> class, but somehow that does not work. global also does not have any
> effect.
>
> In the following example I would like to be able to access $dbh from
> inside the class like I did in that example. This does not work. Can
> somebody please give me a hint on the right syntax?
>
> $dbh = 'test';
>
> class search_helper extends AjaxACApplication
> {
> /**
> * Database connection details
> */
>
> var $db_hostname = $dbh;
>
> Thank you for any help,
>
> Merlin
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
On 9/30/07, 潘志彬 <[EMAIL PROTECTED]> wrote:
>
> $dbh = 'test';
>
> class search_helper extends AjaxACApplication
> {
> /**
> * Database connection details
> */
>
> // announce global variable before use it
> global $dbh;
>
> $db_hostname = $dbh;
global variables inside a class ??
as Martin said this is a bad practice.
if you were going to use a global variable inside a class, why bother w/
a class in the first place?
the point is to encapsulate, ie. hide implementation details from the user.
by relying on a global variable, the class is open to behavior modification
by
external code that does not have to go through its well-defined public
interface
to do so. thats why its a bad practice.
-nathan
--- End Message ---
--- Begin Message ---
I'm getting an error with my PHP, I'm running Apache 2.2.6 and every time I
try to access a PHP page on the Apache server, it says HTTP 500 Internal
Server Error, can anyone help?
--- End Message ---
--- Begin Message ---
Francisco Frost wrote:
> I'm getting an error with my PHP, I'm running Apache 2.2.6 and every
> time I try to access a PHP page on the Apache server, it says HTTP 500
> Internal Server Error, can anyone help?
Check your apache error logs. My guess is that PHP is making apache
segfault.
/Per Jessen, Zürich
--- End Message ---
--- Begin Message ---
No, it's not, but I found out by enabling the show errors in php.ini that
for about 80 items it's saying "PHP Startup: Unable to load dynamic library
'C:\Program Files\PHP\ext\" then the DLL's file name, then "The specified
module was not found" but all the files are there.
"Per Jessen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Francisco Frost wrote:
I'm getting an error with my PHP, I'm running Apache 2.2.6 and every
time I try to access a PHP page on the Apache server, it says HTTP 500
Internal Server Error, can anyone help?
Check your apache error logs. My guess is that PHP is making apache
segfault.
/Per Jessen, Zürich
--- End Message ---
--- Begin Message ---
somewhere I read that php on win doesn't like spaces in the path ... (IIRC)
Francisco Frost wrote:
>
> No, it's not, but I found out by enabling the show errors in php.ini that
> for about 80 items it's saying "PHP Startup: Unable to load dynamic
> library
> 'C:\Program Files\PHP\ext\" then the DLL's file name, then "The specified
> module was not found" but all the files are there.
>
> "Per Jessen" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Francisco Frost wrote:
>>
>>> I'm getting an error with my PHP, I'm running Apache 2.2.6 and every
>>> time I try to access a PHP page on the Apache server, it says HTTP 500
>>> Internal Server Error, can anyone help?
>>
>> Check your apache error logs. My guess is that PHP is making apache
>> segfault.
>>
>>
>> /Per Jessen, Zürich
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--
View this message in context:
http://www.nabble.com/500-Internal-Server-Error-tf4542753.html#a12964906
Sent from the PHP - General mailing list archive at Nabble.com.
--- End Message ---