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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:59:37+00:00 2026-05-19T01:59:37+00:00

my web hosting has blocked the outward traffic so i am using a free

  • 0

my web hosting has blocked the outward traffic so i am using a free web hosting to read data and post it to my server but the problem is that my php file receives data in the $_REQUEST variable but is not able to parse it.

post.php
    function postCon($pCon){
    //echo $pCon;
     $ch = curl_init('http://localhost/rss/recv.php');
     curl_setopt ($ch, CURLOPT_POST, 1);
     curl_setopt ($ch, CURLOPT_POSTFIELDS, "data=$pCon");
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
     $d=curl_exec ($ch);
     echo $d."<br />";
     curl_close ($ch);

    }

recv.php

<?php
if(!json_decode($_REQUEST['data']))
    echo "json error";

echo "<pre>";
print_r($data);
echo "</pre>";
?>

every time it gives json error.
but echo $_REQUEST[‘data’] gives the correct json data.
plz help.

  • 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-19T01:59:38+00:00Added an answer on May 19, 2026 at 1:59 am

    Should not this ?

    $posts = array('data'=>$pCon);
    curl_setopt ($ch, CURLOPT_POSTFIELDS, $posts);
    

    even the example in doc show that

    from doc

    The full data to post in a HTTP “POST” operation. To post a file, prepend a filename with @ and use the full path. This can either be passed as a urlencoded string like ‘para1=val1&para2=val2&…’ or as an array with the field name as key and field data as value. If value is an array, the Content-Type header will be set to multipart/form-data. As of PHP 5.2.0, files thats passed to this option with the @ prefix must be in array form to work.

    your existing way should work too,

    is it possible that $pCon contains some urlencoded values such as =, ? ?

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

Sidebar

Related Questions

I know that lots of web hosting providers are offering FreeBSD, but how good
My web hosting said ImageMagic has been pre-installed on the server. I did a
I have a web-site that has a hosting at some popular hosting company. The
I'm using Mono 2.4 on the Ubiquity web hosting service. I created a simple
Usually, I try to set my folders to have permission 775, but some web-hosting
We have a desktop application, which has been provided a web UI by hosting
I am hosting a Java web service on a AIX unix box using JBoss.
I am building a facebook platform web app using GWT and hosting it on
I have about four web projects that I am hosting in IIS Express. Whenever
I have a basic web hosting account through GoDaddy. It has plenty of space,

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.