This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fileName = $_FILES['afile']['name']; | |
$fileType = $_FILES['afile']['type']; | |
$fileContent = file_get_contents($_FILES['afile']['tmp_name']); | |
$dataUrl = 'data:' . $fileType . ';base64,' . base64_encode($fileContent); | |
$json = json_encode(array( | |
'name' => $fileName, | |
'type' => $fileType, | |
'dataUrl' => $dataUrl, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Marcin Krzyżanwski | |
// Code for https://github.com/krzyzanowskim/CryptoSwift/issues/20 | |
// PHP | |
function encrypt($plaintext, $key, $iv) { | |
$ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $plaintext, MCRYPT_MODE_CBC, $iv); | |
return base64_encode($ciphertext); | |
} | |
function decrypt($ciphertext_base64, $key, $iv) { |
Send mail php from html form without reload page and sending success and error alert with SweetAlert
- Add file needed by SweetAlert (js & css)
- don't forget to link JQuery and main.js
- Create your form according to your needs, don't forget the id
- Create PHP file according to your needs
- Enjoy!
See Sweet Alert in action! http://tristanedwards.me/sweetalert
Sweet Alert Github: https://github.com/t4t5/sweetalert