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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:11:24+00:00 2026-06-13T20:11:24+00:00

I am using the following script to send a GET request to a site

  • 0

I am using the following script to send a GET request to a site however, I keep getting the error, No response from the Server.

  1. I have run wireshark to see any traffic being generated as a result of running this script, but there is no traffic.
  2. I can connect to the site from the Browser and I can also retrieve the contents by using the file_get_contents function, however using sockets, I am unable to do it.

Here is the code which makes use of sockets to send the request to the site and it returns the error: “No response from the Server” if the connection was not successful.

<?php

error_reporting(0);
set_time_limit(0);
ini_set("default_socket_timeout", 5);

function http_send($host, $packet)
{
    if (!($sock = fsockopen($host, 80)))
        die( "\n[-] No response from {$host}:80\n");

    fwrite($sock, $packet);
    return stream_get_contents($sock);
}

$host="http://example.com";
$path="/";
$packet  = "GET {$path} HTTP/1.0\r\n";
$packet .= "Host: {$host}\r\n";
$packet .= "Connection: close\r\n\r\n";

http_send($host, $packet);

?>

So, what is wrong in the code above that it is unable to send the GET request?

It appears ok to me, it will form the HTTP Request Headers for the GET request and store in the $packet variable.

$host is the destination site name.

Then it calls the function, http_send which will send the request.

Error Output: [-] No response from http://example.com:80

  • 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-13T20:11:25+00:00Added an answer on June 13, 2026 at 8:11 pm

    Look at the error being returned by fsockopen by passing in parameters for errno and errstr:

    if (!($sock = fsockopen($host,80,$err_no,$err_str)))
        die($err_no.': '.$err_str);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a page where i'm using a with id=emailfrnd, from the following script
I have following code in a python script try: # send the query request
I'm using the following script to request new content to a file called index.html:
I have Divs show and hide (with an animation) using the following script (I
Using the following script to send info to a flatfile and it works until
I am using the following script to post data to an external site. In
I have the following problem. I'm trying to send data using httppost in Android
I have the following script element in my web page: <script src=default.js type=text/javascript></script> Using
Ok, I have been using the following script for over a year now to
I'm using an ajax request to send comments to DB. Succesful response is marked

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.