Liquid Fire Posted May 8, 2007 Share Posted May 8, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/50529-which-do-you-think-is-better/ Share on other sites More sharing options...
per1os Posted May 8, 2007 Share Posted May 8, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/50529-which-do-you-think-is-better/#findComment-248272 Share on other sites More sharing options...
taith Posted May 8, 2007 Share Posted May 8, 2007 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! Quote Link to comment https://forums.phpfreaks.com/topic/50529-which-do-you-think-is-better/#findComment-248278 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.