<?php
if($_POST['Submit']){
msg("提交表单");
echo "提交表单";
}


?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title></head><body>
<form action="<?=$_SERVER['../PHP_SELF'];?>" method="post" enctype="multipart/form-data" name="form1" id="form1" >
<input type="image" name="img" src="a1262603582.jpg"  "/>
</form></body>
</html>这个是代码,请各位大虾指教下

解决方案 »

  1.   

    $_POST['Submit'] 中 Submit 是表单哪个元素的name? 没有找到啊。  这样$_POST['Submit'] ==NULL了, if 语句当然不会执行了。
      

  2.   

    看此贴有回顾从前的感觉想当年!出来混的时候,我也是这样...时间过的真快啊~~~~~  
    =============
    友情提示下楼主:
      1、写程序是细活,别太马虎大意了。大小写一定要分清楚
      2、想检查的东西一定要清楚是否真有,别判断空气
      3、左手GOOGLE,右手手册
      

  3.   

    判断是否为post提交用
    if($_SERVER['REQUEST_METHOD'] == "POST")
      

  4.   

    <?php 
    if($_POST['Submit']){ 
    msg("提交表单"); 
    echo "提交表单"; 

    ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 
    <title>无标题文档 </title> </head> <body> 
    <form action=" <?=$_SERVER['../PHP_SELF'];?>" method="post" enctype="multipart/form-data" name="form1" id="form1" > 
    <input type="image" name="img" src="a1262603582.jpg"  "/> 
    </form> </body> 
    </html> 
      

  5.   

    <script   language="Javascript">   
        var   str;   
        function   s_value()   
          {  
             window.location.href="show.php";  
          }   
     
      </script>   
        
      <input   type="image"   onclick="s_value()"   name=img   src="a122323233.jpg">