<?php
//根据用户输入的语言名称,打印出对应的语言说明
header('Content-type:text/html;Charset=utf-8');
echo <<<LANG
<from action='' method='post'>
<datalist id ='lang'>
<option value="html">
<option value="css">
<option value="javascript">
<option value="php">
</datalist>
<label for="lang">我正在学习的课程是:</label>
<input type="text" name="lang" id="name" list="lang">
<input type="submit" value="提交">
</from>
LANG;
echo $_POST['lang'];
// Notice: Undefined index: lang in C:\phpStudy\PHPTutorial\WWW\PHPEDU\switch.php on line 17
?>
尴尬 from form 标签写错了