Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Using $this when not in object context

    Ciao a tutti, premettendo che di php capisco ben poco se qualcuno gentilmente riesce a spiegarmi in cosa consiste questo errore e magari come aggirarlo gli sarei moooolto grato !!


    Fatal error: Using $this when not in object context

    Codice PHP:
    class SystemEmail {


      function 
    sendEmail($to$subject$message$fromemail$fromname$cc ''$bcc '') {
        
    $message str_replace('\n''
    '
    trim($message));
        
        
    $headr="Reply-to: " $fromemail "\r\n"."Return-Path: " $fromemail "\r\n" "From: "$fromname " <" $fromemail ">\r\n".'CC: ' $cc .'\r\nBCC: ' $bcc "\r\nMessage-Id: <" md5(time()) . '@' substr(substr(SITE_URL0, -1), 7) . ">\r\n" "MIME-Version: 1.0\r\n" "Content-Type: text/html; charset=utf-8\r\n" "Content-Transfer-Encoding: 8bit\r\n" "Date: " date('r'time()) . "\r\n";

        if(
    mail($to$subject$message$headr))
          
    $this->saveMailReportDb(array('IP: ' $_SERVER['REMOTE_ADDR'], 'FROM: ' $fromemail'TO: ' $to'SUBJECT: ' $subject'CC: ' $cc'BCC: ' $bcc'MESSAGE: ' $message'HEADERS: ' $headr'TIME: 'date('r')));
        
      }


      function 
    saveMailReportDb($data) {
        global 
    $table;
        return 
    db_query("INSERT into {$table['mailreports']}(maildata) values('" serialize($data) . "')");
      }
      


  2. #2
    Quel codice da solo non puo' generare quell'errore, dipende da come usi la classe.

  3. #3
    Capisco. purtroppo la classe l'ho cercata ovunque all'interno dei files che ho qui in locale ma non la trovo.

    Lo script che stò utilizzando è Phpweby 1.3 che è una directory gratuita. Sapresti indicarmi dove guardare?

    http://phpweby.com/software/dir

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.