Skip to content

Instantly share code, notes, and snippets.

$mail->Host = "HOSTINGER_SMTP_HOST_HERE";
//Set the SMTP port number - likely to be 25, 465 or 587
$mail->Port = HOSTINGER_SMTP_PORT_HERE;
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Username to use for SMTP authentication
$mail->Username = "YOUR_SMTP_USERNAME";
//Password to use for SMTP authentication
$mail->Password = "YOUR_SMTP_PASSWORD";
//Set who the message is to be sent from
<?php
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = "testing@yourdomain.com";
$to = "recipient@emailaddress.com";
add_filter('page_row_actions', 'rd_duplicate_post_link', 10, 2);
/*
* Function for post duplication. Dups appear as drafts. User is redirected to the edit screen
*/
function rd_duplicate_post_as_draft(){
global $wpdb;
if (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'rd_duplicate_post_as_draft' == $_REQUEST['action'] ) ) ) {
wp_die('No post to duplicate has been supplied!');
}
/*
$sql = "INSERT INTO Students {name, lastname, email} VALUES ('Thom', 'Vial', 'thom.v@some.com')";
<?php
$servername = "mysql.hostinger.com";
$database = "uXXXXXXXXXX_name";
$username = "uXXXXXXXXXX_user";
$password = "buystuffpwd";
$sql = "mysql:host=$servername;dbname=$database;";
$dsn_Options = [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION];
// Create a new connection to the MySQL database using PDO, $my_Db_Connection is an object
try {
// User writes this in the username field of a login form
john"; DROP DATABASE user_table;
// The final query becomes this
"SELECT * FROM user_table WHERE username = john"; DROP DATABASE user_table;
$the_Object->the_Method();
else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
if (mysqli_query($conn, $sql)) {
echo "New record created successfully";
}