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
| $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 |
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 | |
| ini_set( 'display_errors', 1 ); | |
| error_reporting( E_ALL ); | |
| $from = "testing@yourdomain.com"; | |
| $to = "recipient@emailaddress.com"; |
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
| add_filter('page_row_actions', 'rd_duplicate_post_link', 10, 2); |
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
| /* | |
| * 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!'); | |
| } | |
| /* |
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
| $sql = "INSERT INTO Students {name, lastname, email} VALUES ('Thom', 'Vial', 'thom.v@some.com')"; |
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 | |
| $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 { |
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
| // 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; |
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
| $the_Object->the_Method(); |
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
| else { | |
| echo "Error: " . $sql . "<br>" . mysqli_error($conn); | |
| } |
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
| if (mysqli_query($conn, $sql)) { | |
| echo "New record created successfully"; | |
| } |