在数据库中有一张表present,字段有p_id,p_name,p_link.
p_link就是p_name的链接在a.php页面代码是:
<?
include("db_conn.php"); session_start();
$present=$_SESSION['present']; $SQLStr="select * from presents where p_name='$present'";
$res=mysql_query($SQLStr);
$row=mysql_fetch_array($res);
$link=$row['p_link'];
echo "<script>";
echo "alert(\".$link.\");";
echo "</script>";
?>现在那个提示框显示的就只是两个“.”
请问这是什么原因啊????
p_link就是p_name的链接在a.php页面代码是:
<?
include("db_conn.php"); session_start();
$present=$_SESSION['present']; $SQLStr="select * from presents where p_name='$present'";
$res=mysql_query($SQLStr);
$row=mysql_fetch_array($res);
$link=$row['p_link'];
echo "<script>";
echo "alert(\".$link.\");";
echo "</script>";
?>现在那个提示框显示的就只是两个“.”
请问这是什么原因啊????
echo 'alert("'.$link.'");';
echo " </script>";
我后面的代码是
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="smallwindow.css" rel="stylesheet" type="text/css" />
</head><body>
<div id="prize">
<div>
<div id="prizeblank"></div>
<div id="prizemessage">
<div id="prizetitle">恭喜您!</div><br>
<div id="prizecontent">您已获得由xx公司送出<a style="color:#CC3333" target="_top" href=<?=$link?>><?=$present?></a>一份,请继续加油哦,还有更精致的礼物在等着你呢。</div>
</div>
</div>
</div>
</body>
</html>那个<?=$present?>能显示啊