我如何插入变量?从表单到file_get_contents链接 [英] how do i insert a variable? from a form into a file_get_contents link
本文介绍了我如何插入变量?从表单到file_get_contents链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将表单中的变量插入到file_get_contents(link + formdata)
how do i insert a variable from a form into a file_get_contents("link+formdata")
通过表单提交的变量并包含完整的句点,Numbers ,信
the variable being submitted via a form and contains full stops,Numbers,letter
示例:danny.29将在以下链接中替换HERE:
Example: danny.29 would replace HERE in the link below:
file_get_contents( http://userapi.website.com/HERE );
file_get_contents("http://userapi.website.com/HERE");
正如你所看到我对此非常陌生,我们非常感谢任何帮助:)
As you can see i'm very new to this, any help would be very much appreciated :)
index.html
index.html
<html>
<body>
<form action="add.php" method="post">
ID: <input type="text" name="add">
<input type="submit">
</form>
</body>
</html>
add.php
<html>
<body>
<?php $x=$_POST['add'];?>
<?php
echo file_get_contents("http://userapi.website.com/"echo $x;");
?>
<?php echo $_POST["file_get_contents"]; ?>
</body>
</html>
推荐答案
<?php echo file_get_contents("http://userapi.website.com/" . $x); ?>
Dot代表连接
这篇关于我如何插入变量?从表单到file_get_contents链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文