PHP动态网页WAMP不行,但是用APPserv可以

来源:百度知道 编辑:UC知道 时间:2024/06/17 15:53:16
比如用一下代码
<?php
if($Submit=="提交"){
$username=$_POST[username];
$password=$_POST[password];
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>获取文本框提交的值</title>
<style type="text/css">
<!--
.style1 {font-size: 13px}
-->
</style>
</head>

<body>
<table width="283" height="85" border="1" cellpadding="0" cellspacing="0" background="images/admin2.gif">
<form name="form1" method="post" action="index.php">
<tr>
<td width="114" height="30" align="center" class="style1">管理员:</td>
<td width="163" height="30" align="center"><input n

搜索找到php.ini
将register_globals = off 改成 on

把这个if($Submit=="提交")换成if(isset($_POST['submit']))
把action="index.php"换成本页试试 action="<?php echo $_SERVER['PHP_SELF'];?>"

<?php
if(isset($_POST['Submit']){
$username=$_POST['username'];
$password=$_POST['password'];
}
?>