-1

I have a landing page, I want to get the registered information straight to my email or get it in some excel file

// send data to some get post API , if so uncomment next code and customize for your needs 


$myvars = 'publicid=' . $publicid . '&firstname=' . $firstname . '&lastname=' . $lastname . '&email=' . $email . '&phone=' . $phone . '&country=' . $selected_country . '&leadsource=' . $leadsource[0] . '&ip=' . $ip;


$url = "#";
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars);
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $ch, CURLOPT_HEADER, 0);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);

$response = curl_exec( $ch );
 var_dump($response);

echo '{"success":true,"message":{"message":"lead insert"}}';
?>
Kampai
  • 22,848
  • 21
  • 95
  • 95
Waseem Ha
  • 127
  • 3
  • 13

1 Answers1

0

So you want do 2 things, which was already asked in stackoverflow, please read this 2 pages :

Generate an excel with your data : PHP create Excel spreadsheet and then email it as an attachment

Send an email with attachment: send email with attachment using php

devseo
  • 1,182
  • 1
  • 13
  • 26