HTML代码: 如何在链接中使用php插入变量?
<html>
<body>
<?php
if (isset($_POST['submit'])){
$idfb = $_POST['idfb'];
$url = "http://graph.facebook.com/$idfb/picture?type=$size";
}
?>
<input name="idfb" id="idfb" required placeholder="Enter the ID in this field" type="text">
<button type="submit" class="button" href="loading.php">Hack this Facebook Account</button>
<center><img class="thumbnail" src="http://graph.facebook.com/<?php echo $idfb ?>/picture?type=large"></center>
</body>
</html>
所以我想从输入插入Facebook的ID为链接,并抓住这个帐户ID的资料图片。 这是对的吗?
是的,如果我们假设'$ _POST'有数据 - 但'
不工作:它在做什么?它是否为'$ idfb'放置任何东西?你在用'$ url'做什么?它是否获得'$ idfb'的值? – alanlittle
如果你回显你的变量和url,你会得到你期待的值吗?你也正确地通过另一个表单的POST方法发送你的变量= – Lixus