PDA

View Full Version : سوال: چرا به echo ایراد می گیره؟ (حل شد)



ABZiko
سه شنبه 21 بهمن 1393, 23:48 عصر
سلام، من کد زیر رو نوشتم که اگر کاربر لاگین شده بود، اطلاعات یک محصول رو نمایش بده ولی یک ارور می ده، دلیلش چیه؟



<?php

require_once('User.php');

$id=$_GET['id'];
$obj=new User();
$thing=$obj->getProduct($id);

?>

<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Explanation</title>
<style type="text/css">

font-face {
font-family: "Segoe UI";
src: url(Segoe UI.eot);
src: url(Segoe UI.eot?#iefix) format("embedded-opentype"), url(Segoe UI.woff) format("woff"), url(Segoe UI.ttf) format("truetype"), url(Segoe UI.svg#Segoe UI) format("svg")}

*{
margin:0px;
padding:0px}

table{
width:100%;
border:1px solid #CCC}

td{
width:200px;
height:40px;
border:1px solid #CCC;
font:12px 'Segoe UI';
text-align:center}

input{
font:12px 'Segoe UI';
padding:0px 5px}

</style>
</head>
<body>

<?php

session_start();
if(!isset($_SESSION['userName'])){
echo "<a href='SignIn.html' style='font-family:Segoe UI'>Log In</a><br />";
echo "<a href='AddUser.html' style='font-family:Segoe UI'>Register</a><br />";
echo "<a style='font-family:Segoe UI'>Please Enter to Use the WebSite Facilities ! Also You Can Register from the Link Above !</a>";
echo "You Must Be Entered to Watch the Products !";}

else{
echo "<div style='font-family:Segoe UI'>Welcome ".$_SESSION['userName'].'&nbsp;'.$_SESSION['passWord']."</div>";
echo "<a href='logOut.php' style='font:12px Segoe UI'>Log Out</a>
<a href='SignIn.html' style='font:12px Segoe UI'>Sign In Again</a>
<a href='DashBoard.php' style='font:12px Segoe UI'>DashBoard</a>";
echo "<table>
<tr>
<td>".echo $thing['id'];."</td>
<td>".echo $thing['productName'];."</td>
<td>".echo $thing['price'];."</td>
<td>".echo $thing['number'];."</td>
<td>".echo $thing['explanation'];."</td>
</tr>
</table>";}

?>

</body>
</html>


( ! ) Parse error: syntax error, unexpected 'echo' (T_ECHO) in D:\Wamp\www\PDO\Explain.php on line 63

amir6268
چهارشنبه 22 بهمن 1393, 00:01 صبح
فکر میکنم به این دلیل باشه که داخل echo دوباره echo به کار بردی ...
یکبار بیشتر لازم نیست ...
همه اون echo هارو حذف کن مجدد امتحان کن ...

ABZiko
چهارشنبه 22 بهمن 1393, 00:07 صبح
چطور ازتون تشکر دوست عزیز، ممنون