Jump to content

Which do you think is better?


Liquid Fire

Recommended Posts

Right now I am building a site and was think about the processing of databsae stuff.  For instance anything dealinging with the login/logout is done in the login.php.  I also right now have a form to do a info request and register for the site.  both of these insert function are located inside the file itself as of right now.  I was thinking is seems it would be better to remove them and insert both of them into a file call process.php.  Why I think this is better is becuase it created a single place where all this information processing is done so if I added anything like and support ticker for one fo out products, I just add a else if statement to that file and check the text in the $_POST['process_type'].  The only possible downside I can see is if a  process can be done more more than 1 spot(which it should not be) and you need to redirect.  That can be easily handles by passing the redirect to the process script tho

 

Which do you think is better to do from a programming stand point, the process in the file itself of all processes in 1 file?

Link to comment
Share on other sites

It is all releveant.

 

What I, and I know alot of people usually do is create different function files that house the "processing functions".

 

So for user information I would create a func.user.php file which houses all user functions such as createUser and loginUser etc. Which in return has all the queries etc for the user page.

 

That way it is nice and neat and anytime you want to modify strictly something to do with a user you know exactly where to go.

 

That is just my 2 cents.

Link to comment
Share on other sites

personally... with my programming style... i put all my similar tasks into the same page... thats just me tho... it fits my programs nicely... lets me coordinate all my tasks so it runs faster...

 

although... i do keep my personalized functions seperated in seperate folder, with an index that require_once()s them automatically... speeds up debuging ALOT!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.