Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Script and File Structure/Logic for Login System
Old 08-20-2010, 09:52 AM [Need Help] Script and File Structure/Logic for Login System
Phunk Rabbit's Avatar
Ultra Talker

Posts: 255
Name: John Nerush
Location: Milton Keynes, UK
Trades: 0
I am in the process of coding a moderatly simple login/user system for use in a planned personal project.

Tech avalible/used:

MySQLi/MySQL <- Not great with joins etc
PHP 5.3 <- Am fine with OOP programming
Apache web server, access to PHP.ini and .htaccess

Ive got the system working as a whole, including:
Login
Logout
Register
Account activation
Reset password
Profiles

While I plan to add alot more functionality, I dont think that will affect what I am trying to achive with this thread.

What I currently have is (im not here for critisism on my current file system, im looking for constructive ideas for a new, better, file system),

Each action either has a file.form.php file in a forms folder or a file.pro.php in a process folder, depending on whether they use a form or are just a process.

The core functionality, login, reigster etc are setup within a class in core.class.php.

Finally I have a content file delivering the correct variables/info to the correct function.

Example:

Address:
address.com?p=login

Process:
Form appears, when filled out it goes to the content file, the content file calls the class->function and passes the email and password into it.

The class->function does all the nesessary checks and sets the sessions. Once it is finished it either passes back errors to display (wrong pass etc) with the form or passes you to a dashboard style "welcome username" screen.

All the functions are similar in thought. content file passes the user input to the processor, the processor returns the processed info to the correct place.

The problem:

It is very messy! Ive got so many files that seem like irrelevant steps, process and routes that seem like they should either be organised into classes or into exisiting functions.

What I am after from you, if possible, is a sensible, robust system for building on, where should i be putting my files for maximum organisation without sacrificing extendibility etc.

Ive looked at MVC and am not conviced it is what I am after.

I hope ive not rambled too much and that you can atleast mostly understand what Im after.
__________________

Please login or register to view this content. Registration is FREE

Learn professional skills from professional people, from $6.50 a month.

Last edited by Phunk Rabbit; 08-20-2010 at 10:29 AM.. Reason: subject
Phunk Rabbit is offline
Reply With Quote
View Public Profile Visit Phunk Rabbit's homepage!
 
 
Register now for full access!
Old 08-20-2010, 11:20 PM Re: Script and File Structure/Logic for Login System
Skilled Talker

Posts: 76
Name: Nick Cousins
Location: Northern Ireland
Trades: 0
Hi Phunk Rabbit,

Interesting question - and I try to solve it myself everytime I start a new project, unfortunately I'm not convinced I have the answer, but what I use is:

/classes folder containing all classes named class.something.php
/applications folder containing processes/functions not in classes named app.someting.php
/styles folder containing all CSS
/images folder containig all images
index.php which is a universal handler for all URLs and contains all the code to include/display any form or page based on the URL (all nicely hidden in .htaccess) and
/pages containing all forms & pages which can be displayed by index.php

Just my 2p
__________________
Join
Please login or register to view this content. Registration is FREE


Knowledge is power. Never underestimate the power of stupid people in large numbers.

HandCoder is offline
Reply With Quote
View Public Profile Visit HandCoder's homepage!
 
Old 08-21-2010, 06:25 PM Re: Script and File Structure/Logic for Login System
Phunk Rabbit's Avatar
Ultra Talker

Posts: 255
Name: John Nerush
Location: Milton Keynes, UK
Trades: 0
Thanks for your reply.

Anyother perspectives on this?
__________________

Please login or register to view this content. Registration is FREE

Learn professional skills from professional people, from $6.50 a month.
Phunk Rabbit is offline
Reply With Quote
View Public Profile Visit Phunk Rabbit's homepage!
 
Reply     « Reply to Script and File Structure/Logic for Login System
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.73612 seconds with 12 queries