English 中文(简体)
PHP动态页面搜索
原标题:Search on a dynamic page in PHP

i 设有一个配有简单薄膜搜索表的Sphp动态网站,这意味着有页数变的单一索引网页。

现在,我的问题是,一是用唯一的搜索术语来检索我的页数。

参看以下编码实例。

This is my dynamic php starting page with the search form.

index.php?v=counselling

搜查一经进行。

index.php?name=value

my initial page variable in my case V get replaced with the search terms.

here is my html from tag..

 <form action="index.php?v=counselling" method="get">

i 并尝试了<代码>_SERVER[PHP_SELF],但迄今为止没有uck。

what mistake im doing here?

最佳回答
<form action="index.php" method="get">
    <input type="hidden" name="v" value="counselling" />

连同你的搜索投入,将其视作隐蔽的投入价值。

问题回答

when you have query string and post data together . you can be use this code . HTML code:

<form action="index.php?v=counselling" method="post">
  <input type="text" name="post1" value="value" />
</form>

PHP代码:

echo "use $_GET and $_POST together. ";
echo $_POST[ post1 ].     .$_GET[ v ];




相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签