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 740907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:34:14+00:00 2026-05-14T08:34:14+00:00

I was working on PHP in the past 1 year and nowadays I’m learning

  • 0

I was working on PHP in the past 1 year and nowadays I’m learning Rails.

In rails:–
Routing takes an incoming URL and decodes it into a set of parameters that are used by Rails to dispatch to the appropriate controller and action

For example

 rs.recognize_path "/blog/show/123"
 {:controller=>"blog", :action=>"show", :id=>"123"}

Am I right?

We mention this (written down) line of code in our routes.rb under config directory to tell rails how to handle the request like “/blog/show/123” using this line of code.

map.connect "blog/show/:id", :controller => "blog", :action => "show", :id => /\d+/

Now in PHP when we do something like this

www.example.com/profile.php?profile_id=2

How is the request sent to the requested page? Means I never wrote anything for routing in PHP, so how hss this request been handled?
How is the routing done in PHP (anything I missed during my learning/working in PHP)?

Hopefully you get what I am asking. Please let me know if there is any part unclear.

  • 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-14T08:34:15+00:00Added an answer on May 14, 2026 at 8:34 am

    With your PHP example, the page is found by looking at the given path profile.php. This file is searched for by your webserver and (if found) executed.

    In Rails the URLs are matched against routes to find the corresponding controller. In your Rails example blog is mapped against the BlogController. Now Rails knows that the file containing the controller can be found as apps/controllers/blog_controller.rb.
    Each controller has actions so the show part is matched against the show action of the BlogController, which is represented by a show method in the controller.
    For information about Rails routes, read the Routing Guide of Rails.

    So to be short

    • in PHP your URLs are matched against actual files: very simple no routes required.
    • in Rails your URLs can be more sophisticated (controller/action possibilities) but require routes.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got my php working to set a cookie storing the http_referer the visitor
These past few days I've been working toward converting my PHP code base from
Working with PHP Xpath trying to quickly pull certain links within a html page.
If you are working in PHP (or I guess any programming language) and using
I am working with php and want to have a page that has a
at my working place (php only) we have a base class for database abstraction.
I've been working with PHP lately, and I came across something I couldn't solve.
I'm working with PHP 5.3 on my local machine and needed to parse a
I'm used to working with PHP but lately I've been working with Java and
I am a web-developer working in PHP. I have some limited experience with using

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.