但引号中的变量不被运算,变量名被当作字符串解释
改写为
$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>&nbsp;&nbsp;
TEXT;
即可

解决方案 »

  1.   

    Parse error: parse error, unexpected T_SL in /www/sitna/int/function3.php on line 15
      

  2.   

    我这没有问题,不知道你是怎么替换的<?php
    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>&nbsp;&nbsp;
    TEXT;
    }
    return shutdown;
    }
    ?>
      

  3.   

    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="<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>&nbsp;&nbsp;";
    }
    return shutdown;
    }
      

  4.   

    楼上的。不行啊。还是显示$finishbutton1
      

  5.   

    $showdown='<table><form name="selform" method="post" action=""><tr bgcolor=#ccffff><td><input type="button" name="view" value=$finishbutton1 //此处为什么显示原来$finishbutton1啊?要是没有值他不就是空字符串吗?onclick="openwin2()"></td><td><img src=images/top1.gif width=16 height=16><img src=images/left1.gif width=16 height=16>&nbsp;&nbsp;';
    ========================================
    上面的兄弟, 单引号里面的$ 符号被解释成一般字符,所以无法显示。可以用.连接变量。如:
    $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>&nbsp;&nbsp;';