[php] [html]无法弄清楚为什么会有错误

时间:2016-01-17 06:13:20

标签: php html

如果有人能帮我弄清楚为什么第37行出现错误,我会非常感谢,我试图改变“”的位置;在echo之后但没有任何效果....我还尝试将整个php代码放在img class =“profilePic”src =“http://i.imgur.com/ZICYW5z.png”/>然后使用echo作为名称(我希望它在登录时更改图像和名称。) 代码:

<?php
    require ('steamauth/steamauth.php');  
    
	# You would uncomment the line beneath to make it refresh the data every time the page is loaded
	// $_SESSION['steam_uptodate'] = false;
?>
<html>
	<head>
		<meta charset="utf-8">
		<link rel="stylesheet" href="./css/stylesheet.css" media="screen" title="no title" charset="utf-8">
		<script src="./js/jquery-2.1.4.min.js" charset="utf-8"></script>
		<title>CSGOSuprise.party</title>
		<style>
		html
		{ background-image: url("images/background.jpg"); }
		</style>
			<body ondragstart="return false" onselectstart="return false">
			<div class="header">
				<ul>
					<li class="logo"><a href="index.html">CSGOSuprise</a></li>
<?php
if(!isset($_SESSION['steamid'])) {

   steamlogin();
}  else {
    include ('steamauth/userInfo.php');
	?>
<li><a href="#">Help</a></li>
				</ul>
			</div>
	</head>
	<body ondragstart="return false" onselectstart="return false">
	  <div class="container">
        <div class="leftMain">
          <div class="profile">
            <div class="profileTop">
<?php echo '<img class="profilePic" src=.$steamprofile['avatarfull'].'; ?>
<?php echo '<a href="index.php">' . $steamprofile['personaname'] . '</a>'; ?>
              <div class="medals">
                <img src="./images/medals/italy_small.png" alt="" />
                <img src="./images/medals/dust2_small.png" alt="" />
                <img src="./images/medals/victory_small.png" alt="" />
                <img src="./images/medals/inferno_small.png" alt="" />
              </div>
              <div class="rankXP">
                <img class="rankXPImage" src="./images/ranks/xp/level39.png" alt="" />
                <span class="rankXPCurrent">Rank 39</span>
                <span class="rankXPNext">Rank 40</span>
                <progress id="xp" value="95" max="100"></progress>
              </div>
            </div>
            <div class="rankComp">
              <img class="rankCompImage" src="./images/ranks/comp/14.png" alt="" />
              <div class="rankCompText">Distinguished Master Guardian</div>
              <div class="wins">
              <img class="rankTrophy" src="./images/trophy.png"/>
              <span class="winNumber">232</span>
              </div>
            </div>
          </div>
          <div class="friendsMain">
						<div class="friendsTop">
							<span>Friends</span>
						</div>
						<div class="friendsList">
						   <div class="friendOnline">
							 <img class="profilePicSmall" src="http://i.imgur.com/ZICYW5z.png" alt="" />
							 <div class="friendNameOnline">8</div>
							 </div>
							<div class="friendOnline">
								<img class="profilePicSmall" src="http://i.imgur.com/ZICYW5z.png" alt="" />
								<div class="friendNameOnline">7</div>
							</div>
								<div class="friendOnline">
								<img class="profilePicSmall" src="http://i.imgur.com/ZICYW5z.png" alt="" />
								<div class="friendNameOnline">4</div>
							</div>
							<div class="friendOffline">
								<img class="profilePicSmall" src="http://i.imgur.com/ZICYW5z.png" alt="" />
								<div class="friendNameOffline">6</div>
							</div>
							<div class="friendOffline">
								<img class="profilePicSmall" src="http://i.imgur.com/ZICYW5z.png" alt="" />
								<div class="friendNameOffline">5</div>
							</div>
							<div class="friendOffline">
								<img class="profilePicSmall" src="http://i.imgur.com/ZICYW5z.png" alt="" />
								<div class="friendNameOffline">4</div>
							</div>
                      		<div class="friendOffline">
								<img class="profilePicSmall" src="http://i.imgur.com/ZICYW5z.png" alt="" />
								<div class="friendNameOffline">3</div>
							</div>
							                      		<div class="friendOffline">
								<img class="profilePicSmall" src="http://i.imgur.com/ZICYW5z.png" alt="" />
								<div class="friendNameOffline">2</div>
							</div>
							                      		<div class="friendOffline">
								<img class="profilePicSmall" src="http://i.imgur.com/ZICYW5z.png" alt="" />
								<div class="friendNameOffline">1</div>
							</div>
						</div>
					</div>
        </div>

        <div class="rightMain">
          <div class="main"></div>
        </div>

		   </div>
			
			<script src="./js/script.js" charset="utf-8"></script>
	</body>
</html>

1 个答案:

答案 0 :(得分:0)

我认为不是

<?php echo '<img class="profilePic" src=.$steamprofile['avatarfull'].'; ?>
你的意思是

<?php echo '<img class="profilePic" src="' . $steamprofile['avatarfull'] . '">'; ?>

但你也可以这样做

<img class="profilePic" src="<?= $steamprofile['avatarfull'] ?>">