Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php页面提供空白页面或空值_Php_Html_Post - Fatal编程技术网

php页面提供空白页面或空值

php页面提供空白页面或空值,php,html,post,Php,Html,Post,我有一个html论坛,有3个字段Naam Achternaam电子邮件 在用户填写论坛并单击submit之后,它将调用一个名为action_page.php的php脚本 Taht脚本应该将html论坛中给定的信息发回屏幕 此时,它只返回3个空值 纳姆: 阿切特纳姆: 电邮: 这是html代码 如何让PHP脚本从html页面获取填充字段,然后显示在屏幕上 <?php // what post fields? $fields = array( 'Naam' => $Naa

我有一个html论坛,有3个字段Naam Achternaam电子邮件

在用户填写论坛并单击submit之后,它将调用一个名为action_page.php的php脚本

Taht脚本应该将html论坛中给定的信息发回屏幕

此时,它只返回3个空值

纳姆: 阿切特纳姆: 电邮: 这是html代码

如何让PHP脚本从html页面获取填充字段,然后显示在屏幕上

<?php    
// what post fields?
$fields = array(
   'Naam' => $Naam,
   'Achternaam' => $Achternaam,
   'Email' => $Email,
);

// build the urlencoded data
$postvars = http_build_query($fields);

// open connection
$ch = curl_init();

// set the url, number of POST vars, POST data
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars);

// execute post
$result = curl_exec($ch);

// close connection
curl_close($ch);
?>

这是php代码

html页面有3个字段

<html>
<body>

<form action="/action_page.php" method="post">
  Naam: <input type="text"name="Namm"><br>
  Achternaam: <input type="text" name="Achternaam"><br>
  Email: <input type="text" name="Email"><br>

 <td><input type='submit' name='post' value='post'></td>
<td><input type='reset' name='Rest' value='Reset'></td>
</form>


</body>
</html>

纳姆:
阿切特纳姆:
电子邮件:
但在我单击op sumbit之后,action_页面返回一个空白页面,或者对于每个填充的字段,它在屏幕上回显NULL

我想做的是一个php页面,它从html页面打印3个填充字段,然后将它们发布到php页面,这样就可以将它们打印到屏幕上


我是不是在这里搞错了什么,还是在代码的某些地方输入了错误?

不确定这是否是您要查找的内容,但要获取发布的值,您将使用
$\u POST
超级全局

$fields = array(
    'Naam' => $_POST["Naam"],
    'Achternaam' => $_POST["Achternaam"],
    'Email' => $_POST["Email"],
);

他们都在岗位上你为什么要用卷发来做这么简单的日常工作?!?不工作还是空白page@baao我想看看他们的
,有几个原因。缺少间距和错误的“名称”属性。@fred wat您指的是“工作名称”属性吗