Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Start form compiller */
- $name = $_POST['user_name'];
- $phone = $_POST['user_phone'];
- $email = $_POST['user_email'];
- $type = $_POST['user_type'];
- $token = "501269257:AAGHR_3Hoh4LmwUSMNH50TtlPz1xgw-dBtM";
- $chat_id = "263700664";
- /* Create file.vcf in home directories */
- $fp = fopen("file.vcf", "w");
- /* Create array for vCard */
- $arr = array(
- 'BEGIN:VCARD' => n,
- 'VERSION:3.0' => n,
- 'FN:' => $name,
- 'TEL;TYPE=work, voice, pref, msg:+' => $phone,
- 'EMAIL;TYPE=INTERNET:' => $email,
- 'NICKNAME:' => $type,
- 'END:VCARD' => n
- );
- /* Record array in $txt */
- foreach($arr as $key => $value) {
- $txt .= "n".$key."n".$value."%0A";
- };
- fwrite($fp,$txt);
- fclose ($fp);
- $sendToTelegram = fopen("https://api.telegram.org/bot{$token}/SendDocument?chat_id={$chat_id}&document={$fp}");
- /* Start redirect */
- if ($sendToTelegram) {
- header('Location: thank-you.html');
- } else {
- echo "Error";
- }
- /* End redirect */
- ?>
Add Comment
Please, Sign In to add comment