jeudi 9 mars 2017

PHP Mail + Generate Random String [duplicate]

This question already has an answer here:

I have been trying to send a mail with the usage of randomstring function, but it does not work correctly, it just does not send the email and im getting a erorr

Warning: A non-numeric value encountered in /storage/h1/278/426278/public_html/index.php on line 11

<?php
function generateRandomString() {
    $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $charactersLength = strlen($characters);
    $randomString = '';
    for ($i = 0; $i < 50; $i++) {
        $randomString .= $characters[rand(0, $charactersLength - 1)];
    }
    return $randomString;
}
mail("censored@gmail.com", ""+generateRandomString(), ""+generateRandomString(), "censored@yahoo.com");
?>

The error is

Warning: A non-numeric value encountered in /storage/h1/278/426278/public_html/index.php on line 11

Aucun commentaire:

Enregistrer un commentaire