但引号中的变量不被运算,变量名被当作字符串解释
改写为
$showdown=<<< TEXT
<table><form name="selform" method="post" action=""><tr bgcolor=#ccffff><td><input type="button" name="view" value=$finishbutton1 onclick="openwin2()"></td><td><img src=images/top1.gif width=16 height=16><img src=images/left1.gif width=16 height=16>
TEXT;
即可
改写为
$showdown=<<< TEXT
<table><form name="selform" method="post" action=""><tr bgcolor=#ccffff><td><input type="button" name="view" value=$finishbutton1 onclick="openwin2()"></td><td><img src=images/top1.gif width=16 height=16><img src=images/left1.gif width=16 height=16>
TEXT;
即可
function getpage($sumrows,$page,$link,$pagelistnum)
{
session_start();
$finishbutton1="View";
echo $finishbutton1;
if (empty($page))
$nowpage=1;
else
$nowpage=$page;
$offset=($page-1)*$pagelistnum;
global $sumpage;
$sumpage=floor($sumrows/$pagelistnum)+1;
if ($sumrows % $pagelistnum==0) $sumpage=$sumrows/$pagelistnum;
$tmphead="<a href=".$link."&page=";
if ($nowpage<2)
{
$showdown=<<< TEXT
<table><form name="selform" method="post" action=""><tr bgcolor=#ccffff><td><input type="button" name="view" value=$finishbutton1 onclick="openwin2()"></td><td><img src=images/top1.gif width=16 height=16><img src=images/left1.gif width=16 height=16>
TEXT;
}
return shutdown;
}
?>
{
session_start();
$finishbutton1="View";
echo $finishbutton1;
if (empty($page))
$nowpage=1;
else
$nowpage=$page;
$offset=($page-1)*$pagelistnum;
global $sumpage;
$sumpage=floor($sumrows/$pagelistnum)+1;
if ($sumrows % $pagelistnum==0) $sumpage=$sumrows/$pagelistnum;
$tmphead="<a href=".$link."&page=";
if ($nowpage<2)
{
$showdown="<table><form name=\"selform\" method=\"post\" action=\"\"><tr bgcolor=#ccffff><td><input type=\"button\" name=\"view\" value=".$finishbutton1." onclick=\"openwin2()\"></td><td><img src=images/top1.gif width=16 height=16><img src=images/left1.gif width=16 height=16> ";
}
return shutdown;
}
========================================
上面的兄弟, 单引号里面的$ 符号被解释成一般字符,所以无法显示。可以用.连接变量。如:
$shutdown='<table><form name="selform" method="post" action=""><tr bgcolor=#ccffff><td><input type="button" name="view" value='.$finishbutton1.'onclick="openwin2()"></td><td><img src=images/top1.gif width=16 height=16><img src=images/left1.gif width=16 height=16> ';