473,387 Members | 1,516 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.

Should I use a one php program or multiple

I have taken over a php web site. Once you login you are given six menu
choices. Each option is or can be independant of the others. They each
modify the same database but in different ways.

On clicking the menu buttons the program calls php functions to do the
action. Thus the user stays inside a large program.

I was expecting the menu to provide links rather than function calls.
1) Is there a reason to stay inside a large program through function
calls rather than linking to separate pages?

2) Am I correct that providing a <a href=... link would isolate the
functionality and call a new program?

The current program is spagettii code and somewhat buggy. There are
side effects that depend on what function was called before. I am
hoping that passing the hidden input parameters is all the connectivity
I need.

Jan 17 '07 #1
1 1310
ch***************@yahoo.com wrote:
I have taken over a php web site. Once you login you are given six menu
choices. Each option is or can be independant of the others. They each
modify the same database but in different ways.

On clicking the menu buttons the program calls php functions to do the
action. Thus the user stays inside a large program.

I was expecting the menu to provide links rather than function calls.
1) Is there a reason to stay inside a large program through function
calls rather than linking to separate pages?
Hi,

Well, maybe the original programmer uses some framework?
Or (s)he just liked that approach.
Or maybe in that particular situation it made some sense?
Hard to say without diving into the project.

I can only say my personal taste is always to create seperate pages, simply
because that keeps one script focussed on the task at hand, and keeps the
script small, thus less errorphrone.
I often do use a common functions file, which is included in all the
seperate scripts.
>
2) Am I correct that providing a <a href=... link would isolate the
functionality and call a new program?
Well, it just calls whatever you put into the href.
This can be the same script all the time with different values in the
GET/URL, like:
<a href="bigscript.php?action=modifyTBLUSER">edit users</a>
<a href="bigscript.php?action=modifyTBLHISTORY">edit history</a>
<a href="bigscript.php?action=modifyTBLARTICLES">edit articles</a>

In that example all is handled by 'one program' (bigscript.php).

By the way: I think it is more common to just refer to scripts instead of
programs.
For example: A program is the PHP interpreter (or Firefox browser, or Gimp,
etc.), and bigscript.php is a script (just a file) that gets read and
interpreted/executed by the PHP-executable (program).

>
The current program is spagettii code and somewhat buggy. There are
side effects that depend on what function was called before. I am
hoping that passing the hidden input parameters is all the connectivity
I need.
Well, if the code is a mess, you better start eating through it and make it
more structured. That way you will probably be more able to find the bugs.

Just my 2 cent.

Regards,
Erwin Moller
Jan 18 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: blockhead | last post by:
We are looking for someone to either complete a php forum program or create one for us. There isn't really anything that is available that suits our needs and we have specific wants. If you are...
40
by: Steve Juranich | last post by:
I know that this topic has the potential for blowing up in my face, but I can't help asking. I've been using Python since 1.5.1, so I'm not what you'd call a "n00b". I dutifully evangelize on the...
58
by: Jeff_Relf | last post by:
Hi Tom, You showed: << private const string PHONE_LIST = "495.1000__424.1111___(206)564-5555_1.800.325.3333"; static void Main( string args ) { foreach (string phoneNumber in Regex.Split...
1
by: Arnold | last post by:
I need to modify my existing program into two separate executables. The first exe will be executed once to initiate a hardware card, the second program exe can be called multiple times to process...
8
by: Al Davis | last post by:
Note: I tried cross-posting this message to several newsgoups, including comp.lang.perl.misc, c.l.p.moderated, comp.infosystems.www.authoring.cgi, comp.lang.javascript and comp.lang.php. Nothing...
6
by: Abubakar | last post by:
Hi, I'm working on a project in unmanaged c++. I was writing all (most of) my code in header files, that is, no seperation of code in header and cpp files, as usually is done in c++. I feel pretty...
2
by: SharpCoderMP | last post by:
i'm trying to embed multiple program icons in my executable. the only way so far i managed to do that is to embed native win32 resource file with multiple icons. it works, but... when i create a...
6
by: r.z. | last post by:
They should be initialized before any instance is created. I have no idea in which file, in which place should I put their initialization code to be sure they are initialize only once, before any...
4
by: raiza | last post by:
hi! i'm presently creating a visual basic program which is suppose to be connected in multiple databases. i've already managed to connect my program to one database in access. however, when i...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.