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

  • Home
  • SEARCH
  • 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 9078525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:38:41+00:00 2026-06-16T19:38:41+00:00

http://!@#$%^&*().com This seems to be an invalid URL and in fact browser says its

  • 0
http://!@#$%^&*().com

This seems to be an invalid URL and in fact browser says its an invalid URL.

But when I fetching this URL via file_get_contents (XAMPP), it gives an exception with “500 Internal Server Error”, since this URL does not exist why am I not getting 404 ?

To check the response I’m using

$http_response_header

Here is my code:

$url = "http://!@#$%^&*().com";
$contents = @file_get_contents($url);   
print_r($http_response_header);

When I run the same on another machine (WAMP), then it says $http_response_header is an undefined variable.

Anybody has got any idea what’s the problem here?

  • 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-06-16T19:38:42+00:00Added an answer on June 16, 2026 at 7:38 pm

    You are suppressing errors at the file_get_contents call, the domain you entered is actually invalid as you stated and the function call will return false and trigger the following warning

    file_get_contents(http://.@#$%^&*().com): failed to open stream: operation failed
    

    You won’t get a 404 because the domain is invalid and the http request is probably never sent, hence your $http_response_header is empty.

    Maybe a difference in OS or PHP version between XAMPP and WAMP explain why they act differently?

    My advice is first checking the return value of file_get_contents and only when it’s not false continue with inspecting the response headers.

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

Sidebar

Related Questions

I want this url http://www.youtube.com/watch?v=dgNgODPIO0w&feature=rec-HM-fresh+div to be transformed to: http://www.youtube.com/v/dgNgODPIO0w with php.
I need rewrite this url http://adresa.com/article.php?act=view&id=1113 to http://adresa.com/view/1113 I make it with mod_rewrite in
i have this youtube url http://www.youtube.com/watch?v=9N51Etoikfw&feature=youtube_gdata i need to remove the feature parameter and
Is this a valid http url http://www.example.com?x&y or we must always have = sign
When I run this code url = ('http://maps.google.com/maps/nav?'+ 'q=from%3A'+from_address+ '+to%3A'+to_address+ '&output=json&oe=utf8&key='+api_key) request = urllib2.Request(url)
I am trying to rewrite this url: http://www.sample.com/product_guide&product_name=waht&product_type=dog-clipper to: http://www.sample.com/waht/dog-clipper I am using this
I have a url string like this: http://www.google.com/cse?cx=017840637368510444960:ny1lmky7r-0&client=google-csbe&output=xml_no_dtd&q=simon+g I need to send this url
how come this isn't working: $url = http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20xpath%3D%22%2F%2Fmeta%22%20and%20url%3D%22http://www.cnn.com%22&format=xml&diagnostics=false; $xml = (simplexml_load_file($url)) I get multiple
I copied this code (in spanish) http://www.elrincondelc.com/nuevorincon/index.php?pag=codigos&id=4 and wrote a new one. This is
I see some URLs like this: http://www.example.com/?view=profile&id=098&hash=589e8bed895198495d987d055699d2b9 Why some sites add ID and hashed

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.