473,387 Members | 1,388 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

PHP and classes

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
6 1986
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
9
by: Jack | last post by:
Hello I have a library of calculationally intensive classes that is used both by a GUI based authoring application and by a simpler non-interactive rendering application. Both of these...
9
by: Aguilar, James | last post by:
I know that one can define an essentially unlimited number of classes in a file. And one can declare just as many in a header file. However, the question I have is, should I? Suppose that, to...
12
by: Langy | last post by:
Hello I'm fairly new to C++ but have programmed several other languages and found most of c++ fairly easy (so far!). I've come to a tutorial on classes, could someone please tell me why you...
4
by: john townsley | last post by:
do people prefer to design classes for the particular job or for a rangle of tasks they might encounter now and in the future. i am doing some simple win32 apps and picking classes is simple, but...
2
by: joye | last post by:
Hello, My question is how to use C# to call the existing libraries containing unmanaged C++ classes directly, but not use C# or managed C++ wrappers unmanaged C++ classes? Does anyone know how...
18
by: Edward Diener | last post by:
Is the packing alignment of __nogc classes stored as part of the assembly ? I think it must as the compiler, when referencing the assembly, could not know how the original data is packed otherwise....
6
by: ivan.leben | last post by:
I want to write a Mesh class using half-edges. This class uses three other classes: Vertex, HalfEdge and Face. These classes should be linked properly in the process of building up the mesh by...
0
by: ivan.leben | last post by:
I am writing this in a new thread to alert that I found a solution to the problem mentioned here: http://groups.google.com/group/comp.lang.c++/browse_thread/thread/7970afaa089fd5b8 and to avoid...
2
by: Amu | last post by:
i have a dll ( template class) ready which is written in VC++6. But presently i need to inherit its classes into my new C#.net project.so if there is some better solution with u then please give me...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.