Problème d' HTML

Bonjour, je suis stagiaire et j'ai modifier un fichier .php pour , après avoir corrigé quelques petite erreur
je lance la commande php -f xxxxxx

et cela m'affiche " fatal: root(0): No recipient addresses found in message header"

mais je ne comprend pas ce message, besoin d'aide.

Merci à ceux qui me réponde

5 réponses

  1. si tu parle du $url et $from j'ai juste enlevé cela pour éviter des les montrer,
    mais sinon merci pour ta réponse .
    1. Modérateur
      Je parle des arguments qui sont à envoyer lorsque tu lances le script...
  2. voila dsl c'est un peut long, mais sisi je reçois bien le mais lorsque que j'ai une alerte
    1. Modérateur
      Tu n'as pas correctement utiliser les balises de code c'est dommage ça rend le code beaucoup moins lisible...

      Quoi qu'il en soit le souci concerne l'utilisation du script en ligne de commande que tu as essayé...
      Ce script attends plusieurs paramètres dont le destinataire du mail forcément si tu ne mets pas tous les paramètres lorsque tu lance la ligne de commande à la main tu as une erreur..
  3. #!/opt/rh/rh-php72/root/usr/bin/php -c /etc/opt/rh/rh-php72/php.ini

    <? php

    array_shift ( $ argv );
    $ f_notify_type = array_shift ( $ argv );
    $ f_host_name = array_shift ( $ argv );
    $ f_host_alias = array_shift ( $ argv );
    $ f_host_state = array_shift ( $ argv );
    $ f_host_address = array_shift ( $ argv );
    $ f_host_output = array_shift ( $ argv );
    $ f_long_date = array_shift ( $ argv );
    $ f_serv_desc = array_shift ( $ argv );
    $ f_serv_state = array_shift ( $ argv );
    $ f_to = array_shift ( $ argv );
    $ f_totalup = array_shift ( $ argv );
    $ f_totaldown = array_shift ( $ argv );
    $ f_ackauthor = array_shift ( $ argv );
    $ f_ackcomment = array_shift ( $ argv );

    if ( $ f_host_state == " RECOVERY " ) { $ f_color = "#f48400" ;}
    if ( $ f_host_state == "DOWN" ) { $ f_color = "#f40000" ;}
    if ( $ f_host_state == "UP" ) { $ f_color = "#00b71a" ;}

    $ subject = "[CENTREON] $ f_notify_type Host: $ f_host_name" ;
    $ url = " " ;

    $ from = " " ;
    $ body = "<html> <body> <table border = 0 width = '98% 'cellpadding = 0 cellspacing = 0> <tr> <td valign =' top '> \ r \ n" ;
    $ body . = "<table border = 0 cellpadding = 0 cellspacing = 0 width = '98% '>" ;
    $ body . = "<tr bgcolor = $ f_color> <td width = '140'> <b> <font color = # ffffff> Hôte: </font></b></td> <td> <police color = # ffffff> <b> $ f_notify_type [$ f_host_state] </b> </font> </td> </tr> \ r \ n " ;
    if ( $ f_ackauthor ! = "" && $ f_ackcomment ! = "" ) {
    $ body . = "<tr bgcolor = $ f_color> <td width = '140'> <b> <font color = # ffffff> $ f_ackauthor: </font> </b> </td> <td> <font color = # ffffff> <b> $ f_ackcomment </b> </font> </td> </tr> \ r \ n " ;
    }
    $ body . = "<tr bgcolor = # eeeeee> <td> <b> Nom d'hôte: </b></td><td> <b> <a href = '$ url / centreon / main.php? p = 20202 & o = hd & host_name = $ f_host_name '> $ f_host_alias </a> </b></td> </tr> \ r \ n " ;
    $ body . = "<tr bgcolor = # fefefe> <td> <b> Adresse: </b></td><td><b>$f_host_address</b></td> </tr> \ r \ n " ;
    $ body . = "<tr bgcolor = # eeeeee> <td> <b> Date / Heure: </b></td><td>$f_long_date</td> </tr> \ r \ n" ;
    $ body . = "<tr bgcolor = # fefefe> <td> <b> Infos: </b></td> <td> <font color = $ f_color> $ f_host_output </font> </td> </ tr> \ r \ n " ;
    $ body . = "<tr bgcolor = # eeeeee> <td> <b> Nombre total d'hôtes en activité: </b></td><td>$f_totalup</td> </tr> \ r \ n" ;
    $ body . = "<tr bgcolor = # fefefe> <td> <b> Nombre total d'hôtes en panne: </b></td><td>$f_totaldown</td> </tr> \ r \ n" ;
    $ body . = "<tr bgcolor = # eeeeee> <td> <b> Actions: </b></td> <td> <a href = '$ url / centreon / main.php? p = 20201 & o = hd & nom_hôte = $ f_host_name '> <b> Reconnaître </b> </a> </td> </tr> \ r \ n " ;
    $ body . = "</table> </table> </body> </html> \ r \ n" ;

    $ headers = "De: $ de \ r \ n" ;
    $ headers = $ headers . "Type de contenu: texte / html \ r \ n" ;

    / * Envoyer un e-mail maintenant ... * /
    mail ( $ f_to , $ subject , $ body , $ headers );

    ?>