简体   繁体   English

用PHP $ _GET-parameter填充HTML-textfield-value

[英]Fill HTML-textfield-value with PHP $_GET-parameter

I have a link like this: 我有这样的链接:

/index.php?textfieldvalue=test123

This link navigates to a site with a textfield. 此链接导航到带有文本字段的站点。 If this site is opened, the default-value should be "test123". 如果打开此站点,则默认值应为“ test123”。 To do this i used the PHP $_GET-parameter "textfieldvalue". 为此,我使用了PHP $ _GET-parameter“ textfieldvalue”。

My textfield looks like this: 我的文本字段如下所示:

<input type="text" value="<?php $_GET('textfieldvalue') ?>" required />

But the textfield is still empty.... 但是文本字段仍然为空。

(And $_GET('target') is not empty! I printed it for testing seperate out) (并且$ _GET('target')不为空!我单独打印出来进行测试)

Please remove '&' After '?' 请在“?”之后删除“&” and in input field write: 并在输入字段中输入:

<input type="text" value="<?php echo $_GET['textfieldvalue'] ?>" required />

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

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