htm的表单内容在php里没有显示??帮忙!!

htm的表单内容在php里没有显示??帮忙!!

htm的表单内容在php里没有显示??帮忙!!
//-----------------------------------------------------------------------HTML文件----------

------------------------------------
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<form id="form1" name="form1" method = "get"  action="input.php">
  <p>您的姓名: <input type="text" name="my_name" id="textfield" /></p>
  <p>您的性别: <label><input type="radio" name="" id="radio" value="1" /></label>男生

<label>
    <input type="radio" name="" id="radio2" value="2" /> </label>女生</p>
  <p>您的Email:<label> <input type="text" name="email" id="textfield2" /></label></p>
  <p>您的留言内容:</p> <p>
   <label>
   <textarea name="info" id="textarea" cols="36" rows="6"></textarea>
   </label> </p> <p>
    <label>
    <input type="submit" name="button1" id="button" value="提交" />
    </label>
    <label>
    <input type="reset" name="button2" id="button2" value="重新设定" />
    </label>
  </p>
</form>
</body>
</html>
//------------------------------------------------------------PHP内容----------------------

---------------
<?

    echo $my_name ;
   
    echo $ ;
   
    echo $email ;
   
    echo $info ;


?>

谢谢

所有值都在$_POST数组里,例如

[复制到剪切板]
CODE:
<?
    echo 
$_POST['my_name'] ;
  ?> ;


如履薄冰

回复 #1 大大肌肉王 的帖子

$_POST是个变量数组~~~但里面$_POST好像没有定义~?!?!?!

这些是预定义变量。php已经定义好了
如履薄冰

不过我看你表单用的方法是get
那就在$_GET数组里

[复制到剪切板]
CODE:
<?
    echo 
$_GET['my_name'] ;
 ?> ;


[ 本帖最后由 我不是鱼 于 2008-2-4 13:45 编辑 ]
如履薄冰

回复 #5 我不是鱼 的帖子

请问“吾非鱼”
你能不能把代码考到自己电脑试试呢?
我试过了“action="$PHP_SELF"”也试过了
不行~!!
谢谢

$PHP_SELF要用$_SERVER['PHP_SELF']
你测试一下吧

[复制到剪切板]
CODE:
<?php 
if(isset($_POST['button1'])){
    
print_r($_POST);
    exit;
}
?>
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<
title>无标题文档</title>
</
head>
<
body>
<
form id="form1" name="form1" method="post"  action="">
  <
p>您的姓名: <input type="text" name="my_name" id="textfield" /></p>
  <
p>您的性别: <label><input type="radio" name="" id="radio" value="1" /></label>男生

<label>
    <
input type="radio" name="" id="radio2" value="2" /> </label>女生</p>
  <
p>您的Email:<label> <input type="text" name="email" id="textfield2" /></label></p>
  <
p>您的留言内容:</p> <p>
   <
label>
   <
textarea name="info" id="textarea" cols="36" rows="6"></textarea>
   </
label> </p> <p>
    <
label>
    <
input type="submit" name="button1" id="button" value="提交" />
    </
label>
    <
label>
    <
input type="reset" name="button2" id="button2" value="重新设定" />
    </
label>
  </
p>
</
form>
</
body>
</
html> ;

毕业了。。。