我有这个小代码。它在HTML中获取3个值,并应使用1个函数来回显它们。但是我看到错误!而且我不知道问题是什么。
错误 :
警告:缺少date()的参数1,在第20行的C:\ Program Files(x86)\ EasyPHP-5.4.0RC4 \ www \ test \ index.php中调用,并且在C:\ Program Files(x86)\ EasyPHP中定义-5.4.0RC4 \ www \ test \ index.php在第17行
警告:缺少dates()的参数2,在第20行的C:\ Program Files(x86)\ EasyPHP-5.4.0RC4 \ www \ test \ index.php中调用,并且在C:\ Program Files(x86)\ EasyPHP中定义-5.4.0RC4 \ www \ test \ index.php在第17行
警告:缺少dates()的参数3,在第20行的C:\ Program Files(x86)\ EasyPHP-5.4.0RC4 \ www \ test \ index.php中调用,并且在C:\ Program Files(x86)\ EasyPHP中定义-5.4.0RC4 \ www \ test \ index.php在第17行
注意:未定义的变量:在第18行的C:\ Program Files(x86)\ EasyPHP-5.4.0RC4 \ www \ test \ index.php中
注意:未定义变量:第18行的C:\ Program Files(x86)\ EasyPHP-5.4.0RC4 \ www \ test \ index.php中的rooz
注意:未定义的变量:在第18行的C:\ Program Files(x86)\ EasyPHP-5.4.0RC4 \ www \ test \ index.php中为mah
代码 :
<form method="POST" name="my">
<input type="text" name="hafte"><br>
<input type="text" name="rooz"><br>
<input type="text" name="mah"><br>
<input type="submit" name="submit">
</form>
<?php
if (isset($_POST['hafte'])){
$hafte = $_POST['hafte'];
}
if (isset($_POST['rooz'])){
$rooz = $_POST['rooz'];
}
if (isset($_POST['mah'])){
$mah = $_POST['mah'];
}
function dates($hafte,$rooz,$mah) {
echo $hafte." ye ".$rooz." ye ".$mah;
}
dates();
?>
用类似的参数调用函数
function dates($hafte,$rooz,$mah) {
echo $hafte." ye ".$rooz." ye ".$mah;
}
dates($hafte,$rooz,$mah);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句