By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,725 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,725 IT Pros & Developers. It's quick & easy.

PHP and classes

P: n/a
Specefically, how do they work? php.net describes them as a collection
of variables and functions working with these variables. So far I'm
doing this with collections of function and include''; statements. For
any given operation, a link will include a $_GET['thing'] variable. The
index then have:

if ((isset($_GET['thing'])) && ($_GET['thing'] == "linkname")) {
include 'useful_pile_of_functions.php';
}

This method seems to me to be somewhat like using includes as classes,
as the called file contains everything needed to support the users
desired function. How is using classes better than this method?

--
Could you tell us lazy, ignorant, impolite newbies where to find out
more about SYSOP, please?
-- A. Lucien Meyers
Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Handover Phist wrote:

Specefically, how do they work? php.net describes them as a collection
of variables and functions working with these variables. So far I'm
doing this with collections of function and include''; statements. For
any given operation, a link will include a $_GET['thing'] variable. The
index then have:

if ((isset($_GET['thing'])) && ($_GET['thing'] == "linkname")) {
include 'useful_pile_of_functions.php';
}

This method seems to me to be somewhat like using includes as classes,
as the called file contains everything needed to support the users
desired function. How is using classes better than this method?


Every couple-few weeks someone asks this question. I suggest you search google
groups. You should find plenty of opinions there :o)

Regards,
Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com

I have a spam filter. Please include "PHP" in the
subject line to ensure I'll get your message.
Jul 17 '05 #2

P: n/a
Shawn Wilson blithely blithered
Handover Phist wrote:

Specefically, how do they work? php.net describes them as a collection
of variables and functions working with these variables. So far I'm
doing this with collections of function and include''; statements. For
any given operation, a link will include a $_GET['thing'] variable. The
index then have:

if ((isset($_GET['thing'])) && ($_GET['thing'] == "linkname")) {
include 'useful_pile_of_functions.php';
}

This method seems to me to be somewhat like using includes as classes,
as the called file contains everything needed to support the users
desired function. How is using classes better than this method?


Every couple-few weeks someone asks this question. I suggest you search google
groups. You should find plenty of opinions there :o)

Regards,
Shawn


Thanks Shawn, I'll do that.

--
Yow! Maybe I should have asked for my Neutron Bomb in PAISLEY --
Jul 17 '05 #3

P: n/a
Shawn Wilson wrote:

/snip
Every couple-few weeks someone asks this question. I suggest you search google
groups. You should find plenty of opinions there :o)

Regards,
Shawn


Which kinda brings up a good point... where the heck is the FAQ for this
list?

I've googled it, and can't find one. If there isn't one, I'd be
interested in helping compile one. =)

At the top, I'd imagine it would say "The PHP manual is your friend." ;)

Regards,

- Dan
http://www.dantripp.com/
Jul 17 '05 #4

P: n/a
Dan Tripp wrote:

Shawn Wilson wrote:

/snip
Every couple-few weeks someone asks this question. I suggest you search google
groups. You should find plenty of opinions there :o)

Regards,
Shawn


Which kinda brings up a good point... where the heck is the FAQ for this
list?

I've googled it, and can't find one. If there isn't one, I'd be
interested in helping compile one. =)

At the top, I'd imagine it would say "The PHP manual is your friend." ;)


I've googled too, with the same results. I'm not sure how those things get
started... But we could definitely use one.

Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com

I have a spam filter. Please include "PHP" in the
subject line to ensure I'll get your message.
Jul 17 '05 #5

P: n/a
On 2004-01-19, Shawn Wilson <sh***@glassgiant.com> wrote:
Dan Tripp wrote:

Shawn Wilson wrote:

/snip
> Every couple-few weeks someone asks this question. I suggest you search google
> groups. You should find plenty of opinions there :o)
>
> Regards,
> Shawn


Which kinda brings up a good point... where the heck is the FAQ for this
list?

I've googled it, and can't find one. If there isn't one, I'd be
interested in helping compile one. =)

At the top, I'd imagine it would say "The PHP manual is your friend." ;)


I've googled too, with the same results. I'm not sure how those things get
started... But we could definitely use one.


Most common things:

Why isn't my $var working? Because it is in $_REQUEST['var'] etc...
How to send e-mail with html in?
What's all that stuff about chmod?
Where can i find a win32 installer with apache+php+mysql?
Problems with slashes in win32
....
One question: As most of these people are to lazy to find these answers
via google groups, do you think that they will use the faq?

--
http://home.mysth.be/~timvw
Jul 17 '05 #6

P: n/a
Tim Van Wassenhove wrote:

On 2004-01-19, Shawn Wilson <sh***@glassgiant.com> wrote:
Dan Tripp wrote:

Shawn Wilson wrote:

/snip

> Every couple-few weeks someone asks this question. I suggest you search google
> groups. You should find plenty of opinions there :o)
>

Which kinda brings up a good point... where the heck is the FAQ for this
list?

I've googled it, and can't find one. If there isn't one, I'd be
interested in helping compile one. =)

At the top, I'd imagine it would say "The PHP manual is your friend." ;)


I've googled too, with the same results. I'm not sure how those things get
started... But we could definitely use one.


Most common things:

Why isn't my $var working? Because it is in $_REQUEST['var'] etc...
How to send e-mail with html in?
What's all that stuff about chmod?
Where can i find a win32 installer with apache+php+mysql?
Problems with slashes in win32
...

One question: As most of these people are to lazy to find these answers
via google groups, do you think that they will use the faq?


No. But every site that tries to teach it's readers about newsgroup etiquette
always says "lurk, then post" and "read the FAQ". If everyone obeyed those 2
rules, things would run a lot smoother. However, the nature of this particular
group precludes lurking in many cases (i.e. people first come here to solve a
pressing problem, like globals.) I am occasionally an idealist. If every group
took the time to make a FAQ, reading the FAQ would have a chance of becoming a
common thing to do. Also, a well-crafted FAQ could help those who do a quick
Google search before posting their problems.

Also:
RTFM.
Post small snippets of code.
Post error messages.
The best book for beginning PHP.
Check Google Groups.
The usual top/cross/multi-posting etiquette.

Regards,
Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com

I have a spam filter. Please include "PHP" in the
subject line to ensure I'll get your message.
Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.