刚刚接触2天, 看了一下W3上的一些资源。
顺手写了一下demo,结果就出现了这个问题 从昨天下午开始到现在发帖期间, 问过百度 也问过相关有经验的开发人员。 但是我在页面中一直都找不到值 ,但是在network下是可以看到值的。 希望各位大神指教
顺手写了一下demo,结果就出现了这个问题 从昨天下午开始到现在发帖期间, 问过百度 也问过相关有经验的开发人员。 但是我在页面中一直都找不到值 ,但是在network下是可以看到值的。 希望各位大神指教
如果这样还有值那就不正常了。这个和post 、 get没关系。
现在你的表单改成post提交。然后在test1.php里面这样写file_put_contents('test.html',print_r($_POST,true));
提交表单后就会在你php脚本目录生成一个test.html文件然后双击查看有没有数据
name:<input type="text" name="name">
<input type="submit">
</form>
<?php echo $_POST['name']?>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<title>test</title>
</head>
<body>
<form action="test.php" method="post">
name:<input type="text" name="name" id="name">
<input type="submit" value="提交">
</form>
<?php echo $_POST['name']?>
</body>
</html>
楼主加个ID就行了
<html>
<head>
<title></title> </head>
<body>
<form action="index.php" method="post">
email:<input type="text" name="email" />
username:<input type="text" name="username" />
<input type="submit" value="提交">
</form>
<?php
$email=$_REQUEST['email'];
$username=$_REQUEST['username'];
var_dump('$email');
?>
</body>
</html>