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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:10:46+00:00 2026-05-25T21:10:46+00:00

How to validate the host name in PHP? That is if suppose am running

  • 0

How to validate the host name in PHP?

That is if suppose am running my application server on IP:192.168.1.77 and if the request contains the Host name other than 192.168.1.77 it should not allow the further processing.

Any help or suggestion would be appreciated.

  • 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-25T21:10:46+00:00Added an answer on May 25, 2026 at 9:10 pm

    I’ll throw a unauthorized page. With error stating that there is mismatch in host name

    What for? This is something the web server will already deal with if it’s set up properly:

    If you are using name-based virtual hosts, the ServerName inside a section specifies what hostname must appear in the request’s Host: header to match this virtual host.

    There’s no need to additionally check for this in the PHP script.

    It will be an additional security na? Thats what my clients requirement is

    It is entirely pointless and will not add any security whatsoever. However, I guess there’s no harm in doing it, either.

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

Sidebar

Related Questions

I want a regular expression for javascript to validate host address like http://192.168.10.10:8089/ and
Calling Validate() on an XmlDocument requires passing in a ValidationEventHandler delegate. That event function
How can I validate that my ASPNET AJAX installation is correct. I have Visual
I need to validate this simple pick list: <select name=<%= key %>> <option value=ETC
I use a PHP script to validate video requests before serving them. This script
I am developing the user management portion of a website that will host a
Controller: <?php class VideosController extends ForumAppController { /** * Controller Name * @access public
I'm trying to validate a user's windows credentials on a computer that's not joined
I am using a PHP code from several different files that validates a log-in
I would like to validate a hostname using only regualr expression. Host Names (or

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.