tags:

views:

59

answers:

5

Six years ago I wrote an large web application. It was my very first php program, and it grew, and grew. I used a lot of forms, and some very (atrocious) techniques to give an AJAX "look" to the site, and to handle multiple users with various permissions.

I am looking to expand this, and sell it to other companies in the field, but I need to seriously modernize it.

Currently, it loads index.php where you log in. The user can then select from various "students" or "participants" (We work with people with disabilities). From there, you can select different lesson plans or life skills that are being worked on. There are many other branches as well.

At each stage, a different page is served: Sel_Paricipant.php, Sel_Program.php, etc.

Are there any fundamental problems with doing it this way? If so, what are some good techniques for eliminating this, so that people only see the TLD in their address bar?

Thanks in advance. --Dave

+1  A: 

It's not really normal practice, because you generally want to allow users the opportunity to bookmark a page if they need to. If you're sure it's the approach you need, to always display the TLD in the address bar, have the index.php as the default served document in apache (I assume this is already the case, it's default) and have that page load an iframe. This means the user can navigate around the application without seeing the page they're on. I'd question whether this is really necessary though.

If you are looking to modernise the software, consider migrating the code to a framework and rewrite the application. This will probably only be necessary if you're looking to bring on other programmers, or to extend the application, and you require a maintainable codebase to work with - however if you are, this will be invaluable.

Andy
With Web Applications though, you generally don't bookmark anything but the first page. If you book a plane flight, you generally don't bookmark the search results. Any books marks you make generally redirect you to the front page.I'm at a point where it would take more time to learn a framework than just redo it from scratch. I already have a working copy that's been used for over five years.Other than bookmarks, and aesthetics though, I'm not seeing issues, security or otherwise, with various files showing in the address bar. Am I right?Thanks, Dave
the Hampster
I would argue it's better to allow the bookmarking functionality, but it's not really a significant point, but there's no need to obscure the URL. You'll want to refactor the code when you try and maintain it , find you have to rework it for optimisation or employ someone to work on it.
Andy
A: 

I would write the app from scratch, use a clean lightweight frame work, and develop my app like the lego prinzip, one peace after another. It would take you more time to extend your current application to the "standards" than writing it from scratch.

streetparade
+2  A: 

The way you describe your site, I understand that there is:

  • a mix of front-end and back-end code in each php file
  • some duplication of code in each file

The main fundamental problem with this approach as your web site grows is maintenance.

If you really plan something big, I would suggest a strong refactoring using a full-stack framework like Symfony.

Damien
+1  A: 

If it was your first app and is rather large, then consider re-writing the application and using some sort of framework to pull most of the grunt work for you (why re-invent the wheel?). You'll end up with less bloat, have a more concise program, and less headaches down the road. Not to mention you have probably learned a thing or to since you first wrote it and could probably write it better the second time around.

Bryan Denny
A: 

You should focus on refactoring what you can to make it more maintainable. Put code in manageable modules/classes etc.

You will need to complete feature requests from paying customers soon. This is 1000% more important that having a static location bar for ascetic reasons.

Byron Whitlock