Skip to content

Instantly share code, notes, and snippets.

View hackerrahul's full-sized avatar
💻

HackerRahul hackerrahul

💻
View GitHub Profile
{
"status": 200,
"status_message": "sms_success",
"data": {
"balance": "Updated Balance",
"number": "Mobile number",
"txn_id": "Transaction Id",
"message_body": "Message Body"
}
}
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
include_once "PHPMailer/PHPMailer.php";
include_once "PHPMailer/Exception.php";
include_once "PHPMailer/SMTP.php";
function send_mail($to,$subject,$body){
<?php
//Server settings
$mail->SMTPDebug = 0; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'YOUR_HOST_HERE'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'YOUR_SMTP_USERNAME'; // SMTP username
$mail->Password = 'YOUR_SMTP_PASSWORD'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
<?php
include 'sendemail.php';
$to = 'recipientemail@gmail.com';
$subject = 'Subject for PHPMailer';
$body = 'here is the demo body for email';
$send = send_mail($to,$subject,$body);
if($send == 1){
echo 'Mail Sent!';
<?php
include 'upload.php';
?>
<!DOCTYPE html>
<html>
<title>Imgur Image upload in php</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.13.0/build/styles/atom-one-dark-reasonable.min.css">
<?php
error_reporting(0);
function upload_to_imgur($image){
$image = file_get_contents($image);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.imgur.com/3/image",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
<?php
$amount = $_POST['amount']; // this is dynamic
$name = $_POST['name']; // this is dynamic
$number = $_POST['number']; // this is dynamic
$email = $_POST['email']; // this is dynamic
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://'.$mode.'.instamojo.com/api/1.1/payment-requests/');
<script src="https://js.instamojo.com/v1/checkout.js"></script>
<script>
Instamojo.open("YOUR_INSTAMOJO_LINK_HERE");
</script>
<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
<script type="text/javascript">
$(document).ready(function(){
var start = 0;
$.ajax({
type : "GET",
url : "get_data.php",
data : {
'offset' : 0,
'limit' : 5
},