-3

I need to send some form data (POST) to a URL.

But I do not wish my script go to her.

I have a list of users in the database, I need to spend http://www.somesite.com/receive

Except that my script can not go there.

It would be possible to make a POST request without leaving the page? (without using the Ajax).

Something like CURL?

1 Answers1

3

Your question is a little hard to understand. If I had enough rep, I would ask clarification in a comment, but I can't.

Do you simply want to use curl to send an HTTP POST request? If so, you can use PHP's curl functions, making sure to set CURLOPT_POST to true. This code is from another question:

$ch = curl_init();
$curlConfig = array(
    CURLOPT_URL            => "http://www.example.com/yourscript.php",
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS     => array(
        'field1' => 'some date',
        'field2' => 'some other data',
    )
);
curl_setopt_array($ch, $curlConfig);
$result = curl_exec($ch);
curl_close($ch);

// result sent by the remote server is in $result

Here are some more references.

Community
  • 1
  • 1
0not
  • 190
  • 6