Ücretli veya ücretsiz destek aramaktayım.
PHP 5.4 ile kodlanmış bir panelim mevcut, bu kodları 8.1'ê çevirdik ve Cpanel PHP sürümüm şu anda 8.1 hiç bir yerde hata yok şu anda.
Fakat iletişim formundan mesaj gönderirken şu hata kodunu almaktayım.
Parse error: syntax error, unexpected identifier "fwrite", expecting "function" or "const" in /home/domain/public_html/admin/smtp/class.smtp.php on line 587
İlgili satırdaki kod bloğum aşağıdaki gibidir. ChatGPT ile PHP 8.1 uyumlu olacak şekilde kodu düzeltmesini istedim verdiği kod çalışmadı.
Orjinal kodlarım; 587. satırdaki kod 1. sırada yer alan koddur.
fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
$this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
}
if($code != 250) {
$this->error =
array("error" => "DATA not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
}
return false;
}
return true;
}ChatGTP kodu
fwrite($this->smtp_conn, $this->CRLF . "." . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply, 0, 3);
if ($this->do_debug >= 2) {
$this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
}
if ($code != 250) {
$this->error = [
"error" => "DATA not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply, 4)
];
if ($this->do_debug >= 1) {
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
}
return false;
}
return true;Yardımcı olursanız çok sevinirim.