Jump to content

Structuring of code (Mod please move -> PHP Help)


Kemik

Recommended Posts

Edit: Wrong forum sorry.

 

Hello,

 

Does anyone have any good tutorials which goes over the best ways to layout thousands of lines of code?

 

I'm creating a league script. I've created the user system perfectly fine, but now that I'm moving on to create the team management part where people can create teams, edit their team, join teams, etc I want to ensure I'm not "over doing" the current structure I have. I want my script to be as efficient as possible. I got the base of the user system from a tutorial I read. After that I used my head, a php book I have and these forums to expand and add new features.

 

At the moment any forms that are submitted go in this manner:

 

1. nameofform.php

2. process.php - selects which function to use depending on which form was directed there using a class constructor. E.g. if(isset($_POST['subjoin'])){ $this->procRegister(); } Process.php then passes all the form POSTs to...

4. session.php - Starts the session, sets all the important bits of info required on most pages such as guest/member count, login, etc then validates the form fields and if successful sends the result to the database.php or sends the errors back to nameofform.php

5. database.php - Does what it says on the tin, queries the database with the successful info.

 

I've been downloading large, free, scripts and looking at the way any do it but any point in the right direction would be helpful.

 

Thanks in advance.

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.