Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.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 - Fatal编程技术网

Php 提交带有其他页面链接的表单

Php 提交带有其他页面链接的表单,php,html,Php,Html,我已经创建了3个php页面。第一种包括以下形式: <form method="POST" name="go" action="search_form_all.php" > <input name="value" type="text" id="search_form_1" size="65" placeholder="enter name"/> <input type="submit" value="" name="submit" /> </f

我已经创建了3个php页面。第一种包括以下形式:

<form method="POST" name="go" action="search_form_all.php"  >
  <input name="value" type="text" id="search_form_1" size="65" placeholder="enter name"/>
  <input type="submit" value="" name="submit" />
</form> 

第二个名为“search\u form\u all.php”的页面包含显示上述表单结果的php代码。因此,如果用户在表单中键入一个名称并按submit,“search_form_all.php”将根据用户在搜索表单中插入的内容显示我数据库中的所有名称


我只想在我的第三个php页面中有一个链接,当用户按下它来执行第一个页面中的表单时。例如,如果我在搜索表单中输入一个名字,如“john”,那么我希望能够转到我的第三页并按下要执行的表单的链接,并从数据库返回所有名字“john”。这是可能的吗?

是的,这在会话变量中是可能的。例如:

<?php
    session_start();

    if(isset($_SESSION['views'])) {
        $_SESSION['views']=$_SESSION['views'];
    } else {
        $_SESSION['views']=1;
    }

    echo "Views=". $_SESSION['views'];
?>

你也可以参考


如果您需要更多帮助,请告诉我。

如果是在第一页表单中输入“john”的同一用户,您可以将其存储在会话中,并在他按下第3页的链接时重新使用它。您想做什么您需要搜索,这是您在search\u form\u all.php(显示搜索结果)中获得的.你想链接第一页还是第二页?我必须在表格下使用此代码吗?第三页的链接示例是什么?链接与普通链接一样简单,您只需从会话中获取值,如我的回答中所述,比如$name=$\u session['search\u name'];