Possible Duplicate:
PHP: “Notice: Undefined variable” and “Notice: Undefined index”未定义指数
我学习PHP和我已经使用POST方法提交表单数据,我不知道为什么我得到这两个错误:
Notice: Undefined index: search_for in \xampp\htdocs\samir\indexes.php on line 5
Notice: Undefined index: replace_with in \xampp\htdocs\samir\indexes.php on line 6
if(isset($_POST['user_input']) && isset($_POST['search_for']) && isset($_POST['replace_with'])
&& !empty($_POST['user_input']) && !empty($_POST['search_for']) && !empty($_POST['replace_with']))
echo $user_input = $_POST['user_input'];
echo $search_for = $_POST['search_for'];
echo $replace_with = $_POST['replace_with'];
某些代码可能? –
你能告诉我们你的代码吗? –
我们需要看你的代码! – simonlchilds