我不确定在大括号、方括号和分号排成一行后,我能读多少次或数一数。这已经折磨了我好几个小时。任何见解将不胜感激。
该程序大部分时间都在工作。当我发布它并且它起作用时,我会看到需要注意的细节。有时对其进行调整会使它崩溃,就像这样。
文本内容无关紧要,因为取出后问题仍然存在。说是第98行。
代码是否正确缩进?我试过了。
ini_set ('display_errors', 1);
error_reporting (E_ALL | E_STRICT);
require ('head_metas.htm');
require ('head_menus.htm');
//bid_handler.php
// get items
$title = trim($_POST['title']);
$img = trim($_POST['img']);
$medium = trim($_POST['medium']);
$size = trim($_POST['size']);
$date = trim($_POST['date']);
$value = trim($_POST['value']);
// visitor info
$visitorF = trim($_POST['visitorF']);
$visitorL = trim($_POST['visitorL']);
$phone = trim($_POST['phone']);
$email1 = trim($_POST['email1']);
$email2 = trim($_POST['email2']);
$validation1 = filter_var($email1, FILTER_VALIDATE_EMAIL);
$validation2 = filter_var($email2, FILTER_VALIDATE_EMAIL);
$bid_value = trim($_POST['bid_value']);
// confirmation mails
$headers = '...';
$to = 'my@email.com, $email1';
$subject = '...';
$message = $visitorF . $visitorL . ' has offered ' . $bid_value . ' for ' . $title . '.\n\nContact information:\nPnone: ' . $phone . '\nemail address: ' . $email1;
$okay = TRUE;
// welcome + image
if ($okay == TRUE)
{
print "
<p>
Luring text and a captivating image
<br />
All \" quotes \" are meticulously struck
</p>
";
$okay = TRUE;
}
// inaccessible entries
if (
(empty($visitorF)) ||
(empty($visitorL)) ||
(empty($email1)) ||
(empty($email2)) ||
($email1 != $email2) ||
($validation1 == NULL) ||
($validation2 == NULL)
)
{
print "
There were errors.
";
$okay = FALSE;
}
// everything looks great
elseif (
($okay == TRUE) &&
(is_numeric($bid_value)) &&
($bid_value >= $value) &&
(isset($visitorF)) &&
(isset($visitorL)) &&
(isset($email1)) &&
(isset($email2)) &&
($email1 == $email2) &&
($validation1 == TRUE) &&
($validation2 == TRUE)
)
{
print "
<p>
Thank you, your information is as follows:
<br />
Info... prints the variables in a stylish fashion
</p> ";
$okay = FALSE;
}
else (
($bid_value < $value) ||
(empty($bid_value))
)
{
print "
<p>
However, your bid has not met the minimum reserve for this piece.
<br />
Please enter a numeric value and try again.
</p>
";
$okay = FALSE;
}
require ('footer.html');
?>