Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function httpPost($url,$params)
- {
- $postData = '';
- //create name value pairs seperated by &
- foreach($params as $k => $v)
- {
- $postData .= $k . '='.$v.'&';
- }
- rtrim($postData, '&');
- $ch = curl_init();
- curl_setopt($ch,CURLOPT_URL,$url);
- curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
- curl_setopt($ch,CURLOPT_HEADER, false);
- curl_setopt($ch, CURLOPT_POST, count($postData));
- curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
- $output=curl_exec($ch);
- curl_close($ch);
- return $output;
- }
- $params = array(
- 'action' => 'UserCreate',
- 'cityCombo' => '1'
- );
- httpPost("http://www.site.com/reg.php",$params);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement