php代码错误,此代码不断使用未定义的常量错误..请帮助
< ? php
$d = 1;
$a = $_POST[keya];
$b = $_ POST[keyb];
$c = $_POST[keyc];
$d = $a + $b + $c;
echo $d;
? >
php代码错误,此代码不断使用未定义的常量错误..请帮助
< ? php
$d = 1;
$a = $_POST[keya];
$b = $_ POST[keyb];
$c = $_POST[keyc];
$d = $a + $b + $c;
echo $d;
? >
$d = 1;
$a = $_POST['keya'];
$b = $_POST['keyb'];
$c = $_POST['keyc'];
$d = $a + $b + $c;
echo $d;
您应该在 POST 中使用字符串键
您需要检查表单是否已提交并添加引号:
<?php
if(!empty($_POST)) {
$d = 1;
$a = $_POST['keya'];
$b = $_POST['keyb'];
$c = $_POST['keyc'];
$d = $a + $b + $c;
echo $d;
}
?>