有没有办法在此脚本中使用$ 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>
是的,只需内联PHP变量即可:
<script src="http://connect.soundcloud.com/sdk.js"></script>
<div id="soundcloud"></div>
<script>
SC.oEmbed("https://soundcloud.com/<?php echo $row['username'];?>", {color: "434C58", maxheight: 350, maxwidth: 450}, document.getElementById("soundcloud"));
</script>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句