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

The Archive Base Latest Questions

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

I have a test script to receive an xml file via http post and

  • 0

I have a test script to receive an xml file via http post and it appears to work ok when I use it internally. When I move the script to a web server which can be accessed externally nothing appears to be happening. Anyone any ideas?

<?php   
    if ( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
    $inp = fopen("php://input"); 
    $outp = fopen("xmlfile" . date("YmdHis") . ".xml", "w"); 
    while (!feof($inp)) { 
        $buffer = fread($inp, 8192); 
        fwrite($outp, $buffer); 
    }        
    fclose($inp); 
    fclose($outp);
    echo "<html><head>test response</head><body>OK</body></html>";
}
?>

To post the xml I’m using curl, not sure if this is the problem? and I’m NOT sending to a secure connection(HTTPS):

function httpsPost($Url, $xml_data)
{    
   //Initialisation
   $ch=curl_init();

   //Set parameters
   curl_setopt($ch, CURLOPT_FORBID_REUSE, 1); 
   curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);

   curl_setopt($ch, CURLOPT_URL, $Url);

   //Return a variable instead of posting it directly
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

   //Activate the POST method
   curl_setopt($ch, CURLOPT_POST, 1);

   //Request   
   curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data);
   curl_setopt($ch, CURLOPT_TIMEOUT, 4);
   curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
   curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

   //execute the connexion
   $result = curl_exec($ch);

   //Close it
   curl_close($ch); 
   return $result;
 }
  • 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:56:11+00:00Added an answer on May 16, 2026 at 5:56 am

    Make sure that on your server allow_url_fopen settings is turned on from php.ini.

    Having said that, be aware of security concerns about that setting.

    Update:

    Try to see if there is any error, turn on error reporting, put these two lines on top of your script:

    ini_set('display_errors', true);
    error_reporting(E_ALL);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML document being sent to me by HTTP POST: <?xml version=1.0
I have a script test.R that takes arguments arg1 , arg2 and outputs a
I have created a script to run a test script on a batch of
I have the following simple python test script that uses Suds to call a
I have a test suite to perform smoke tests. I have all my script
I have a test suite to perform smoke tests. I have all my script
We have a ubuntu test server that this simple script works fine on where
I have a unix shell script which test ftp ports of multiple hosts listed
I have a jquery function in my script function test(){ $.ajax({ url: '/Customer/test' +
This is a simple script I have written to test command line argument handling:

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.