为什么会执行2次啊 把你的PHP脚本放到HTML静态代码后面. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head><meta http-equiv="Content-Language" content="en" /><meta name="GENERATOR" content="PHPEclipse 1.0" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>title</title></head><?php if(isset($_POST["submit"])) { ?><script>alert("success");</script><?php } else { ?><script>alert("fail");</script><?php } ?><body> <form name="form" method="post"> <input type="submit" name="submit" value="close"> </form></body></html>原因:语言声明应出现在页面的内容的 <html><head><meta http-equiv="Content-Language" content="en" /><meta name="GENERATOR" content="PHPEclipse 1.0" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>title</title></head><body> <form action="text.php" name="form" method="post"> <input type="submit" name="submit" value="close"> </form></body></html><?php if(isset($_POST["submit"])) { ?> <script language=javascript> alert("success"); </script> <?php } else { ?> <script>alert("fail");</script> <?php }?> 这样可以提交后弹出窗口撒。<?phpif(isset($_POST["submit"])){?><script>alert("success");</script><?php}else{?><script>alert("fail");</script><!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=utf-8" /><title>无标题文档</title></head><body> <form action="test.php" name="form" method="post"> <input type="submit" name="submit" value="close"> </form></body></html><?php} ?> 同意楼上的,不过也可以分成2个文件,test.php和xx.html 分层模式下数据库连接问题 php如何向xml中添加新节点 在Smarty中如何自定义一个函数,类似CSubStr(str,start,length)?? 求个思路 请问在win2000下 php5 + apache + mysql的具体安装步骤....... 请问怎么用PHP实现这样的保护? 附件上传的安全性 您想兼职赚钱吗?我们为您提供机会,绝对免费,欢迎有时间有能力的人访问 IIS+PHP4.21 出问题。。 php5 两个调用符号(->) 最后被调用的函数位于哪里? 谁有好用的OA系统, url重写问题求助?
<head>
<meta http-equiv="Content-Language" content="en" />
<meta name="GENERATOR" content="PHPEclipse 1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>title</title>
</head><?php
if(isset($_POST["submit"]))
{
?><script>alert("success");</script><?php
}
else
{
?><script>alert("fail");</script><?php
}
?>
<body>
<form name="form" method="post">
<input type="submit" name="submit" value="close">
</form>
</body>
</html>
原因:
语言声明应出现在页面的内容的
<head>
<meta http-equiv="Content-Language" content="en" />
<meta name="GENERATOR" content="PHPEclipse 1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>title</title>
</head>
<body>
<form action="text.php" name="form" method="post">
<input type="submit" name="submit" value="close">
</form>
</body>
</html><?php
if(isset($_POST["submit"]))
{
?>
<script language=javascript>
alert("success");
</script>
<?php
}
else
{
?>
<script>alert("fail");</script>
<?php
}
?>
if(isset($_POST["submit"]))
{
?>
<script>alert("success");</script>
<?php
}
else
{
?>
<script>alert("fail");</script><!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=utf-8" />
<title>无标题文档</title>
</head><body>
<form action="test.php" name="form" method="post">
<input type="submit" name="submit" value="close">
</form>
</body>
</html>
<?php
}
?>