다음 문을 며칠 동안 추가하면 페이지가 공백이 됩니다. 정상적으로 삭제하세요
echo "isset($tireqty)".isset($tireqty)."
"; >echo "isset($nothere)".isset($nothere)."
"
echo "isset($tireqty)".empty($tireqty)."
";
echo "isset($nothere)".empty($nothere)."
";
<code> <head> <title>Bob's Auto Parts -Order Result</title> </head> <body> <h1>Bos's Auto Parts</h1> <h2>Order Result</h2> <?php define('TIREPRICE',100); define('OILPRICE',10); define('SPARKPRICE',4); $tireqty = $_POST['tireqty']; $oilqty = $_POST['oilqty']; $sparkqty = $_POST['sparkqty']; echo " <p>Order processed at".date('H:i, jS F Y')."</p>"; echo " <p>Your order is as follow:</p>"; echo $tireqty." tireqty<br/>"; echo $oilqty." oilqty<br/>"; echo $sparkqty." spark plugs <br/>"; $totalqty = 0; $totalqty = $tireqty + $oilqty + $sparkqty; echo "Items ordered: ".$totalqty."<br/>"; $totalamount = 0.00; $totalamount = $tireqty * TIREPRICE + $oilqty * OILPRICE + $sparkqty * SPARKPRICE; echo "Subtotal: $".number_format($totalamount,2)."<br/>"; $taxrate = 0.10; //total sales tax is 10% $totalamount = $totalamount * (1 + $taxrate); echo "Total including tax: $".number_format($totalamount,2)."<br/>"</code>
// echo "isset($nothere)".isset($nothere)."
";
// echo "isset($tireqty)".empty($tireqty)."
";
// echo "isset($nothere)" .empty($nothere)."
";
<code> ?> </body></code>
답글 내용:
echo "isset($tireqty)".isset($tireqty)."
"; >echo "isset($nothere)".isset($nothere)."
"
echo "isset($tireqty)".empty($tireqty)."
";
echo "isset($nothere)".empty($nothere)."
";
전체 코드는 아래에 나열되어 있습니다.
<code> <head> <title>Bob's Auto Parts -Order Result</title> </head> <body> <h1>Bos's Auto Parts</h1> <h2>Order Result</h2> <?php define('TIREPRICE',100); define('OILPRICE',10); define('SPARKPRICE',4); $tireqty = $_POST['tireqty']; $oilqty = $_POST['oilqty']; $sparkqty = $_POST['sparkqty']; echo " <p>Order processed at".date('H:i, jS F Y')."</p>"; echo " <p>Your order is as follow:</p>"; echo $tireqty." tireqty<br/>"; echo $oilqty." oilqty<br/>"; echo $sparkqty." spark plugs <br/>"; $totalqty = 0; $totalqty = $tireqty + $oilqty + $sparkqty; echo "Items ordered: ".$totalqty."<br/>"; $totalamount = 0.00; $totalamount = $tireqty * TIREPRICE + $oilqty * OILPRICE + $sparkqty * SPARKPRICE; echo "Subtotal: $".number_format($totalamount,2)."<br/>"; $taxrate = 0.10; //total sales tax is 10% $totalamount = $totalamount * (1 + $taxrate); echo "Total including tax: $".number_format($totalamount,2)."<br/>"</code>
// echo "isset($tireqty)".empty($tireqty)."
";
// echo "isset($nothere)" .empty($nothere)."
";
<code> ?> </body></code>
이전 인용 변수인 $nothere는 정의되지 않은 경우 오류를 보고합니다. 디버그 모드를 켜지 않으면 오류가 보고되지 않으며
isset 및 빈 반환 bool이 표시되지 않습니다. 종류이므로 당연히 표시되지 않습니다
error_reporting(E_ALL);
ini_set("display_errors", 1);
페이지 상단에 추가