wyyuan 发表于 2007-3-23 12:43
请问下,如何将一个form中得值传给本页面呢?
<P>请问下,如何将一个form中得值传给本页面呢?<BR>action 和method怎么写啊?还有就是这个值怎么得到呢?还是用$_Post[] or $_GET[] ?</P>
rainic 发表于 2007-3-23 21:51
当method="post"<BR>用$_POST[]获取值 //全大写<BR> 当method="get"<BR>用$_GET[] 获取值<BR><BR><form action="<?=$_SERVER['PHP_SELF']?>" method="post"><BR><BR>FORM的话,METHOD一般都用POST
lmhllr 发表于 2007-3-29 13:34
YES!顶楼上!<BR><BR>一般传值有几种方法:POST.GET,COOKIE,SESSION,就这样,看情况使用...
wyyuan 发表于 2007-3-30 14:56
<P>thanks all of you </P>
wyyuan 发表于 2007-3-30 15:59
<P><?php<BR>echo $_POST['title'];<BR>echo $_POST['link'];<BR>echo "<form action=\"$_SERVER['PHP_SELF']\" method=\"post\">";<BR>echo "<table>";<BR>echo "<tr><td>"; <BR>echo "主题:</td><td>"; <BR>echo "<input type=\"text\" name=\"title\" size=\"20\" ></td></tr>";<BR>echo "<tr><td>"; <BR>echo "连接:</td>"; <BR>echo "<td colspan=\"2\">"; <BR>echo "<input type=\"text\" name=\"link\" size=\"20\" ></td> </tr>";<BR>echo "<tr><td>"; <BR>echo "<input type=\"submit\" value=\"完成\">";<BR>echo "</td>";<BR>echo "<td>"; <BR>echo "<input type=\"reset\" value=\"重新来过\">"; <BR>echo "</td> </tr>"; <BR>echo "</table>"; <BR>echo "</form>"; </P>
<P>?><BR><BR>为什么这样不行啊</P>
rainic 发表于 2007-3-30 23:01
第4行错了啊~~<BR>这样<BR>echo "<form action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">";<BR><BR>改成这样后,我这边可以
lmhllr 发表于 2007-3-30 23:32
回复:(wyyuan)
如果大量HTML推荐使用 <<<EOT....
rainic 发表于 2007-3-31 00:22
how to use "eot"?
lmhllr 发表于 2007-4-2 02:49
回复:(rainic)how to use
<P>斑竹真爱说笑,那我献丑了^_^<BR><BR><BR></P>
<DIV class=htmlcode>
<P><?php<BR>$str = "测试";<BR>echo <BR><<<EOT</P>
<P><table width="500" height="165" border="1" cellpadding="0" cellspacing="0"><BR> <tr><BR> <td>$str</td><BR> <td>&nbsp;</td><BR> <td>$str</td><BR> </tr><BR> <tr><BR> <td>&nbsp;</td><BR> <td>&nbsp;</td><BR> <td>&nbsp;</td><BR> </tr><BR></table><BR>EOT;<BR>?></P></DIV>
rainic 发表于 2007-4-3 22:24
<P>谢谢[em10],我学PHP才两个月</P>
lmhllr 发表于 2007-4-4 13:58
呵呵。。。学PHP一定得上phpchina或者phpx
页:
[1]