这几天正在学习PHP.遇到了一个问题.是PHP如何接收表单的数据的.但根据教材上给的代码.我在IIS中运行,结果却出现错误.代码分为两个文件,一个为jobapp.html,一个为"jobapp_action.php":
<HTML>
<!-- jobapp.html -->
<TITLE>工作申请表</TITLE>
<BODY>
<H1>Phop's Bicycles Job Application</H1>
<P>Are you looking for an exciting career in the world of cyclery?
Look no further!
</P>
<FORM NAME="frmJobApp" METHOD="POST" ACTION="jobapp_action.php">
Please enter your name:
<INPUT TYPE="TEXT" NAME="applicant"><BR>
<INPUT TYPE="SUBMIT" NAME="enter" VALUE="提交">
</FORM>
</BODY>
</HTML>
<HTML>
<!-- jobapp_action.php -->
<BODY>
<P>Welcome <?php echo($applicant); ?>!</P>
</BODY>
</HTML>
运行jobapp.html之后,输入姓名之后点提交,就出现了以下错误:
Welcome
Notice: Undefined variable: applicant in c:\inetpub\wwwroot\jobapp_action.php on line 3
!
不知为何???望各位多加指教...
还有一个:
<HTML>
<!-- test.php -->
<FORM>
Please type yuour name here:<BR>
<INPUT NAME="username" TYPE=TEXT><BR><BR>
<INPUT NAME="submit" TYPE=SUBMIT>
</FORM>
<BR><BR>
you typed:
<?php
echo($username);
?>
</HTML>
结果也出现了以下问题:
Notice: Undefined variable: username in c:\inetpub\wwwroot\test.php on line 12
请各位指教!!!