Plxply Posted November 1, 2010 Share Posted November 1, 2010 Hello, This is a slightly strange question so bare with me. I've been dabbling in PHP for a while and to help further my PHP skills I created a basic URL shortening service with a login and registration system, this works fine however I'm not sure I organised it in the best manner. What I basically did was have an if statement at the top of the page which would check for example if the username field has been posted if not it would run: include_once("interface/login.php"); die(); interface/login.php will contain the HTML for the login interface along with parts of the code that was ready to accept errors e.g. <body><?php if(isset($pass_error)) { echo $pass_error; }?> Then within the login.php code I would compare the hashed password with the one in the database if it did not match I would then run code similar to this: $pass_error = "<div class='error'>You have entered an incorrect username/password</div>"; include_once("interface/login.php"); die(); However I'm not sure if this is the most "clean" way of handling it and I would appreciate if someone would tell me better ways in which I can structure my code and the interface for it. Thank you, Link to comment https://forums.phpfreaks.com/topic/217474-organisation/ Share on other sites More sharing options...
Pikachu2000 Posted November 1, 2010 Share Posted November 1, 2010 This is more of a design question than anything else, so moving to Application Design. Link to comment https://forums.phpfreaks.com/topic/217474-organisation/#findComment-1129080 Share on other sites More sharing options...
Plxply Posted November 1, 2010 Author Share Posted November 1, 2010 Sorry about that, I didn't notice there was a separate section for this. Link to comment https://forums.phpfreaks.com/topic/217474-organisation/#findComment-1129085 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.