So I have a class with all setParams
$this->setParams('matchwins', $users->getInfo($_SESSION['user']['id'], 'matchwins'));
So I could just use {matchwins}
around my website)
I tried to do the following statement on my user homepage.
<?php
$clan = $_GET["clan"];
$file = 'http://localhost/app/tpl/skins/warfare/images/clans/'. $clan .'/avatar.png';
if (file_exists($file)) {echo "<img src='http://localhost/app/tpl/skins/warfare/images/clans/'. $clan .'/avatar.png'/>";}
?>
I'm new to PHP, does anyone know what is wrong?
您应该使用双引号将变量包括在内,单引号用于保存您要回显的img
标签的src
属性。
echo "<img src='http://localhost/app/tpl/skins/warfare/images/clans/" . $clan . "/avatar.png'/>";
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.