如何插入從表單變量成的file_get_contents(「鏈接+ FORMDATA」)我如何插入一個變量?從形式到的file_get_contents鏈接
變量正在通過表單提交,幷包含句號,數字,字母
實施例:danny.29將在下面的鏈接取代的位置:
的file_get_contents( 「http://userapi.website.com/HERE」);
正如你看到的我是很新的這一點,任何幫助將是非常讚賞:)
的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>
您可以使用大括號在字符串中進行連接。 – 2013-03-09 12:33:30