print "<a href=\ "$this_script?$offset=".($offset-PAGE_LIMIT)."\"><<Previous
Entries</a> ";当调用这个函数时
nav($offset);
如果用户点击了上面的Previous Entries是不是又再次调用的这个函数,并将改变后的offset值做为参数传递过来
Entries</a> ";当调用这个函数时
nav($offset);
如果用户点击了上面的Previous Entries是不是又再次调用的这个函数,并将改变后的offset值做为参数传递过来
运行时提示这句话有错误 ,请问错在哪?什么提示?(2)
\ "$this_script?$offset=".($offset-PAGE_LIMIT)."\"上面的这个\ 有什么用?中间那个问号呢?
请详细的解释这一句话,谢谢
\是转义字符,让"不至于被作为php语法而作为一个字符。问号是指后面就是变量了啊,这是基本的php常识吧。(3)这是用的什么语法格式????这是php。
请贴出错误信息2、
print "<a href=\ "$this_script?$offset=".($offset-PAGE_LIMIT)."\"><<Previous
Entries</a> ";
应写作
print "<a href=\"$this_script?$offset=".($offset-PAGE_LIMIT)."\"><<Previous
Entries</a> ";
即\ "的\后面没有空格\"表示这个"是“"”字符而不是串分隔符
Parse error: parse error, unexpected T_VARIABLE in C:\Apache\Apache2\htdocs\guestbook\header.php on line 214function nav($offset = 0, $this_script = "")
{
global $PHP_SELF;
if (empty($this_script))
{
$this_script = $PHP_SELF;
}
if (empty($offset))
{
$offset = 0;
}
$result = safe_query("select count(*) from guestbook");
print "<p>\n";
if ($offset > 0)
{
print "<a href=\ "$this_script?$offset=".($offset-PAGE_LIMIT)."\"><<Previous
Entries</a> ";
}
if ($offset+PAGE_LIMIT < $total_rows)
{
print "<a href=\ "$this_script?offset=".($offset-PAGE_LIMIT)."\">Next
Entries>></a> ";
}
print "</p>\n";
}?>
if ($offset > 0)
{
print "<a href=\ "$this_script?$offset=".($offset-PAGE_LIMIT)."\"><<Previous
Entries</a> ";
}
if ($offset+PAGE_LIMIT < $total_rows)
{
print "<a href=\ "$this_script?offset=".($offset-PAGE_LIMIT)."\">Next
Entries>></a> ";
}好像没起作用,怎么回事?
{
print "<a href=\ "$this_script?$offset=".($offset-PAGE_LIMIT)."\"><<Previous
Entries</a> ";
}
if ($offset+PAGE_LIMIT < $total_rows)
{
print "<a href=\ "$this_script?offset=".($offset-PAGE_LIMIT)."\">Next
Entries>></a> ";
}
改好了,语法是正确了,但只显示了两行记录,上面的语句好像没起效果
问号指后面的变量????PHP哪里说的????
a.php?b=c。后面的b=c就是变量部分了啊。
{
print "<a href=\"$this_script?$offset=".($offset-PAGE_LIMIT)."\"><<Previous
Entries</a> ";
}
if ($offset+PAGE_LIMIT < $total_rows)
{
print "<a href=\"$this_script?offset=".($offset-PAGE_LIMIT)."\">Next
Entries>></a> ";
}改过了,刚才贴的没改而已
不过好像没起作用,只显示两个记录,没法翻页!!!!!!!!!!!