Php 从url=$url的数据库获取数据

Php 从url=$url的数据库获取数据,php,html,mysql,Php,Html,Mysql,在url=$url的位置获取数据时遇到问题 我已经成功地用url存储了数据,现在想在url的基础上获取这些数据。 我的意思是,若我有一个表单,当用户填写表单并提交时,我会收到数据库中带有url的所有信息。例如,当用户在此页面上填写表单时http://test.pricemoment.com/test.php我在数据库中获得url/test.php 现在我想获取用户在表单下面的页面中填写的所有数据 注意:我有很多页面如何从数据库中使用url获取在特定页面上提交的数据 例如,当用户访问此页面时htt

在url=$url的位置获取数据时遇到问题 我已经成功地用url存储了数据,现在想在url的基础上获取这些数据。 我的意思是,若我有一个表单,当用户填写表单并提交时,我会收到数据库中带有url的所有信息。例如,当用户在此页面上填写表单时
http://test.pricemoment.com/test.php
我在数据库中获得url/test.php

现在我想获取用户在表单下面的页面中填写的所有数据

注意:我有很多页面如何从数据库中使用url获取在特定页面上提交的数据

例如,当用户访问此页面时
http://test.pricemoment.com/test.php
如何获取用户在此页面上提交的所有数据

表格代码为

<div class="form-group replyin">
 <form method="post" action="'.$_SERVER['REQUEST_URI'].'" id="foo">
<input type="hidden" name="tm" value="'.time().'"/>
<input type="hidden" name="uri" value="'.$_SERVER['REQUEST_URI'].'"/>
<input type="hidden" name="id" id="id" value="0"/>
 <div class="form-group">
      <input type="text" class="form-control" id="name" name="name" required placeholder="Name...">
  </div>

  <div class="form-group">
       <input type="text" class="form-control" id="email" name="email" required placeholder="Email...">
   </div>

   <div class="form-group">
      <textarea class="form-control" id="comment" name="comment" row="5"  required placeholder="Add a public comment..."></textarea>
  </div>
  <div class="form-group">
      <button type="submit" class="btn btn-info" id="submit">Comment</button>
  </div>
</form>
  </div>

评论

我认为,与其将数据与URL一起存储,不如在数据库名称
“page\u name”
中创建一列,并将每个表单的隐藏字段传递给您,该字段说明其名称,然后将该名称保存在
“page\u name”
列中,以便您可以从数据库中精确地获取数据,如
从表格中选择*页面名称=“”
或者你可以使用
这样的查询,哪种查询适合你。如果我误判了您保存数据的方法,请告知我们。快乐编码:)