-3

PHPメールコマンドで少し問題が発生しました。処理しようとすると、エラーページが返されます。(SQLではありません)

これがこれまでの私のコードです

$getdisputes = mysql_query("SELECT * FROM `disputedetails` WHERE `invno` = '$invoiceno'") or die(mysql_error());
//send email
$to = "".$disputeemail."";
$subject = "Dispute submitted";
$from = "NO_REPLY@noreply.dassdf.com"
$headers = "From:" . $from;
$message1 = "Store ".$username. " has submitted a dispute on invoice number ".$invoiceno;
// foreach line in disputedetails file for that invoice number, add to $message item, desc and 
while ($info = mysql_fetch_array($getdisputes)) {
    $message = $message1 + "\n <b>Invoice Number: </b>".$info['invno']." <b>Item ID:</b> ".$info['itemid']." <b>Description: </b>".$info['description']." <b>Disputed Quantity:</b> ".$info['disputeqty']." Reason: ".$info['reason'].".";
}
mail($to,$subject,$message,$headers);

問題の原因について何か考えはありますか?

4

2 に答える 2

3
$from = "NO_REPLY@noreply.dassdf.com"

その行にエラーがあります。「;」で終了する必要があります セミコロン

このような:

$from = "NO_REPLY@noreply.dassdf.com";
于 2013-01-20T21:42:43.227 に答える
1

変化する

$message1 = "Store ".$username. " has submitted a dispute on invoice number ".$invoiceno;
// foreach line in disputedetails file for that invoice number, add to $message item, desc and 
while ($info = mysql_fetch_array($getdisputes)) {
    $message = $message1 + "\n <b>Invoice Number: </b>".$info['invno']." <b>Item ID:</b> ".$info['itemid']." <b>Description: </b>".$info['description']." <b>Disputed Quantity:</b> ".$info['disputeqty']." Reason: ".$info['reason'].".";
}

の中へ:

$message = "Store ".$username. " has submitted a dispute on invoice number ".$invoiceno;

while ($info = mysql_fetch_array($getdisputes))
    $message .= "\n <b>Invoice Number: </b>".$info['invno']." <b>Item ID:</b> ".$info['itemid']." <b>Description: </b>".$info['description']." <b>Disputed Quantity:</b> ".$info['disputeqty']." Reason: ".$info['reason'].".";
于 2013-01-20T21:43:22.840 に答える