简体   繁体   English

PHP从url获取值并将其传递到文本字段

[英]PHP get value from url and pass it to text field

Hi I am a jsf programmer and want to integrate a documents repositary developed using php in my jsf application. 嗨,我是一个jsf程序员,并且想要在我的jsf应用程序中集成使用php开发的文档存储库。 So what i am doing is when the user clicks a link from my jsf screen it gets a value for the link pass it to the php url and opens a page where the user can add docs. 所以我在做的是,当用户单击我的jsf屏幕上的链接时,它会获得该链接的值,并将其传递到php url,然后打开一个页面,用户可以在其中添加文档。 I am getting the value from url and displaying it in the page. 我从url获取值并将其显示在页面中。 But what i want is instead of user entering the *number field(please look at the screen shot) the value from URL should pass automatically to the database as number and the number field should be removed . 但是我想要的是代替用户输入* number字段(请看屏幕截图),URL的值应作为number自动传递给数据库,并且应该删除number字段。 Please look at screen shots. 请看屏幕截图。

在此处输入图片说明在此处输入图片说明

and the code snippets 和代码片段

<td class="ThRows">*Number</td>
$cellvalue = "";
if ((!isset($_GET["add_fd9"])) && (!isset($_POST["add_fd9"]))) {
$itemvalue = "";
} else {
$itemvalue = qsrequest($_GET["add_fd9");

then 然后

fieldPrompts[_No] = "*Number"; fieldPrompts [_No] =“ * Number”;

pgitm_No= document.getElementsByName("add_fd9")[0]; pgitm_No = document.getElementsByName(“ add_fd9”)[0];

I dont understand where to pass the url value 我不知道将url值传递到哪里

Try it : 试试吧 :

$cellvalue = "";
if (!isset($_REQUEST["add_fd9"])) {
$itemvalue = "";
} else {
$itemvalue = qsrequest($_REQUEST["add_fd9"]);
}

Use $_REQUEST 使用$ _REQUEST

as

<input type="text" name="text1" value="<?php echo isset($_REQUEST['add_fd9'])?$_REQUEST['add_fd9']:'';?>">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM