4

I want to do the following is that i am trying to post data automatically to another url

$postid = $_POST['new'];
$tt = file_get_contents("new1.php");
2
  • i cant see any question here. Commented Nov 19, 2013 at 6:56
  • I want to automatically post the new ID data to new1.php Commented Nov 19, 2013 at 6:57

1 Answer 1

3

Make use of cURL to do this

if(isset($_POST['new']))
{
$postid = $_POST['new'];

$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, 'new1.php');
curl_setopt($ch,CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS, "data=$postid");
$result = curl_exec($ch);
echo $result;
curl_close($ch);
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.