单击提交按钮在php中显示网页 [英] Display web page in php on click of submit Button

查看:88
本文介绍了单击提交按钮在php中显示网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。我是Atif这个论坛的新手


我有一个关于php的问题。如果有人能回答,我会受到尊重。

提前预付款。

-------------------- -------------------------------------------

我在MYSQL中有一个名为product的表。

产品中的列被命名为pcode(产品代码)和purl(产品URL)。


i必须生成一个搜索代码,如果我在相应的purl的搜索文本中输入pcode,


当我点击提交

按钮时,显示与该网址对应的网页。

我尽我所能,最后我只能显示网址,而不是网页对应的网页。


这里是代码我尝试过:。

------------------------------------- ------------------------------------

Productmanage.php
-----------------------------

Hi to all and sundry. I''m Atif a newbie to this forum

I''ve a question regarding php. if anyone could answer it i would be hononured.
thanx in advance.
---------------------------------------------------------------

I have a table in MYSQL named product.
Columns in product are named as pcode(product code ) and purl (product url).

i have to generate a search code such that,

if i enter the pcode in the search text for the corresponding purl,

the webpage corresponding to that url gets displayed as i click the submit
button.
I tried out my best ,in the end i was able to display the url only and not the web page corresponding to that url.

here is the code i tried:.
-------------------------------------------------------------------------
Productmanage.php
-----------------------------

展开 | 选择 | Wrap | 行号

推荐答案

您好TechnoAtif,


我认为您正朝着正确的方向前进,但下次请使用代码标签显示你的鳕鱼e - 它使阅读更容易。


回到问题所在。


我认为您需要做的是在获得位置后设置标题。这个过程将是:

1)一个页面,其中包含表格,供用户输入产品代码,然后点击搜索。

2)seacrh(提交)按钮将转到基于
Hi TechnoAtif,

I think you are heading along the right lines, though next time please use the code tags to display your code - it makes it easier to read.

Back to the problem.

I think what you need to do is set the header once you have the location. The process would be:
1) A page with the form on for the user to enter to product code and then click search.
2) The seacrh (submit) button would go to a php page that queries the database based on the


_POST []数据查询数据库的php页面

3)如果记录为foudn,则设置标题

[php]

header(" Location:
_POST[] data
3) If the record is foudn the set the header
[php]
header("Location:


URL"); //其中
URL"); // where


这篇关于单击提交按钮在php中显示网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆