Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5994869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:52:44+00:00 2026-05-22T23:52:44+00:00

I am building a rather larger web application with javascript and PHP. The app

  • 0

I am building a rather larger web application with javascript and PHP. The app has several different types of XMLHttpRequests, and my question is about best practice: is it better to send each of those requests to a different PHP script or to one master script which then goes through and delegates tasks?

Currently I have a requestManager script, but it’s getting a bit out of hand. I feel like it’s nice to have all of my requests hit that same script first because It’s easy for me to debug and remember where my requests are going. The problem is that I’m looking at around 10 if-then statements, and I can imagine that might start to slow things down as it gets bigger and bigger.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:52:45+00:00Added an answer on May 22, 2026 at 11:52 pm

    The single point of entry to your application should be some kind of router, which directs requests to the correct controller (script in your case). It sounds like you’re reinventing the wheel, and poorly. Your router should not be a big series of if/else statements; you should store a mapping of URI patterns to controllers and do a single lookup.

    You should also be a lot less worried about performance, which doesn’t matter at all, and more worried about producing a completely unmaintainable piece of code.

    If you’re truly concerened with best practices, stop what you’re doing and build your “rather large” web application with a PHP framework where routing is done for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im building a web application which is a process management app. Several different employee
I'm building a Zend-based Web app that will permit third-party extensions. Essentially, this application's
A business partner has suggested building a web services library with JSON-RPC rather that
I am building a rather large web application and have built a handful of
Building on what has been written in SO question Best Singleton Implementation In Java
I'm building an application that needs to use a web server like a file
I'm building an ASP.Net MVC website. Rather than have everything in one project, I've
Building a client-side swing application what should be notified on a bus (application-wide message
Building the same project (without any changes) produces binary different exe-files: some small regions
When building some of my PHP apps, a lot of the functionality could be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.