Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $url = 'http://www.***.com/testing.php';
- $dataToSend = array(
- 'id' => 'value',
- 'other_id' => 'otherValue'
- );
- $url += '?'.http_build_query($dataToSend);
- // $url is now:
- // http://somewhere.com/page.php?key=value&otherKey=otherValue
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
- $response = curl_exec($ch);
- if (!$response) {
- echo curl_error($response);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement