有没有办法在这个脚本中使用 $row['username'] 来让实际登录的用户名显示在 'USERNAME' 的位置?(假设我有一个有效的查询设置,它没有显示)。
<script src="http://connect.soundcloud.com/sdk.js"></script>
<div id="soundcloud"></div>
<script>
SC.oEmbed("https://soundcloud.com/USERNAME", {color: "434C58", maxheight: 350, maxwidth: 450}, document.getElementById("soundcloud"));
</script>
在此先感谢,非常感谢任何帮助!
编辑:这看起来很乱,但它确实有效。
<script src="http://connect.soundcloud.com/sdk.js"></script>
<div id="soundcloud"></div>
<script>
SC.oEmbed("https://soundcloud.com/<?php
$sql = mysqli_query($con, "SELECT * FROM Users WHERE username = '" . $_GET["username"] . "'
");
while ($row = mysqli_fetch_array($sql)){
echo $row['soundcloud'] ;
}
?>", {color: "434C58", maxheight: 350, maxwidth: 450}, document.getElementById("soundcloud"));
</script>