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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:51:12+00:00 2026-05-16T05:51:12+00:00

I basically need to create a anchor that will navigate to a different port

  • 0

I basically need to create a anchor that will navigate to a different port on the server. For instance, our server is hosted on domain.com:555, we need a link to navigate to domain.com:777. The catch is that it’s not always domain.com. We can expect the DNS to malfunction, in which case we will use ip address to navigate like xx.xx.xx.xx:555 and xx.xx.xx.xx:777.

I need get the hostname of the server where the PHP script is running. I tried using SERVER_ADDR, but that for reason gives me the private IP of the server.

So how do I get the domain / ip part of the url?

  • 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-16T05:51:13+00:00Added an answer on May 16, 2026 at 5:51 am

    You want:

    $_SERVER['HTTP_HOST']
    

    From the $_SERVER predefined variable, which, for 'HTTP_HOST' contains:

    Contents of the Host: header from the current request, if there is one.

    You might also find:

    $_SERVER['SERVER_NAME']
    

    useful, and this Stack Overflow discussion of their relative merits instructive.

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

Sidebar

Related Questions

Basically I need to create a textarea that is character limited, but will have
I (Basically) need to create a background timer on iOS 4 that will allow
So I need to create a graph that basically looks like an ascending line
Basically I need to create a quickfix buffer listing all lines that match a
Basically I need to create a client and server using only the local network,
I have a need to basically create a matrix of values in my Silverlight
Basically need to generate custom(some different then yes no) messeges(alert) in JS , how
basically need to change the value that - admin_url() returns any idea?
is it possible to create a per month identity ? basically what I need
I need to create a Chart which will grab data from external sources when

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.