Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action("gform_post_submission", "set_post_content", 10, 2);
- function set_post_content($entry, $form){
- function post_to_url($url, $data) {
- $fields = '';
- foreach($data as $key => $value) {
- $fields .= $key . '=' . $value . '&';
- }
- rtrim($fields, '&');
- $post = curl_init();
- curl_setopt($post, CURLOPT_URL, $url);
- curl_setopt($post, CURLOPT_POST, count($data));
- curl_setopt($post, CURLOPT_POSTFIELDS, $fields);
- curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);
- $result = curl_exec($post);
- curl_close($post);
- }
- if($form["id"] == 3){//Full Registration
- $data = array(
- "firstname" => $entry["1.3"],
- "lastname" => $entry["1.6"],
- "email" => $entry["2"],
- "address1" => $entry["3.1"],
- "city" => $entry["3.3"],
- "state" => $entry["3.4"],
- "postcode" => $entry["3.5"],
- "country" => $entry["3.6"],
- "phonenumber" => $entry["4"],
- "password2" => $entry["3.2"]
- );
- post_to_url("http://microbop.com/", $data);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment