由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - cgi GET method: display results for the 1st time
相关主题
question on CSSdifference between firefox and IE
How to display webpages 1 by 1 ?Interview question - use a STL vector object as an argument of function.
pdfjs displaying pdf issueC#: DataSet vs. Class
help for Matlab figuressomebody used logsys before?
how to display an excel file in java? (转载)Qt: How to display a cursor when a QLineEdit is not focused
Matlab Gui HelpOpenGL能否方便实现自定义图形的移动,擦除和分层显示?
an interview problemWhoCrashed v1.01 - post-mortem crashdump analysis.
Help: How to display data from excel in C# windows formRe: gedit can't display chinese.. (转载)
相关话题的讨论汇总
话题: page话题: results话题: get话题: display话题: lines
进入Programming版参与讨论
1 (共1页)
w*s
发帖数: 7227
1
say my url is
http://10.50.1.2/mycgi.pl?records_per_page=10
it'll display 10 lines in the page.
now if you click the link from the main page,
the url is actually,
http://10.50.1.2/mycgi.pl
so you click it, no lines will displayed in the page.
Then you need to click the "submit" to see results.
If i want to see 10 lines by default at the 1st time,
how should i do that ?
p*********t
发帖数: 2690
2
打不开网站啊。

【在 w*s 的大作中提到】
: say my url is
: http://10.50.1.2/mycgi.pl?records_per_page=10
: it'll display 10 lines in the page.
: now if you click the link from the main page,
: the url is actually,
: http://10.50.1.2/mycgi.pl
: so you click it, no lines will displayed in the page.
: Then you need to click the "submit" to see results.
: If i want to see 10 lines by default at the 1st time,
: how should i do that ?

X****r
发帖数: 3557
3
Many ways to do it, e.g.
1) make mycgi.pl have a default 'records_per_page' of 10 (or whatever number
you want on the first page).
OR
2) change the link on the main page to point to 'mycgi.pl?records_per_page=
10'

【在 w*s 的大作中提到】
: say my url is
: http://10.50.1.2/mycgi.pl?records_per_page=10
: it'll display 10 lines in the page.
: now if you click the link from the main page,
: the url is actually,
: http://10.50.1.2/mycgi.pl
: so you click it, no lines will displayed in the page.
: Then you need to click the "submit" to see results.
: If i want to see 10 lines by default at the 1st time,
: how should i do that ?

w*s
发帖数: 7227
4
how to do the option 1 pls ?

number

【在 X****r 的大作中提到】
: Many ways to do it, e.g.
: 1) make mycgi.pl have a default 'records_per_page' of 10 (or whatever number
: you want on the first page).
: OR
: 2) change the link on the main page to point to 'mycgi.pl?records_per_page=
: 10'

X****r
发帖数: 3557
5
By changing the perl source code, of course. I assume you're the developer?

【在 w*s 的大作中提到】
: how to do the option 1 pls ?
:
: number

d****n
发帖数: 1637
6
1.server 方面,每次用户submit时候,同时返回一个当前记录的指针。
这个指针用来跟踪哪10个记录已经被显示了。作为一个parameter 回到你
的perl script中。
假设你用 perl+mysql
sub get_nth_record{
$nth=$_[0]; // keep user returned pointer
$stmt=$_[1]; // and more params
mysql="SELECT * from myTABLE where conditions limit nth,nth+10";

return mysql_results;
}
^好久不用perl了,惭愧
2.if you do it from client side, that will be better.
use javascript. save all the results (if not too many) into an array object.
keep a global value/pointer to save current record. only to display nth 10
records. that is basic.

【在 w*s 的大作中提到】
: say my url is
: http://10.50.1.2/mycgi.pl?records_per_page=10
: it'll display 10 lines in the page.
: now if you click the link from the main page,
: the url is actually,
: http://10.50.1.2/mycgi.pl
: so you click it, no lines will displayed in the page.
: Then you need to click the "submit" to see results.
: If i want to see 10 lines by default at the 1st time,
: how should i do that ?

w*s
发帖数: 7227
7
brother, i know you have been warmhearted to help,
but if if you treat Chinese just like Indians treat Indians,
then you will have more chance to survive in IT in the future.
i got this from linuxquestions,
In your program, check for environment variable QUERY_STRING: if it is empty
, simply act as if it were record_per_page=10
what happened is i was too tired and forget to take care the default for one
of the variables.

【在 X****r 的大作中提到】
: By changing the perl source code, of course. I assume you're the developer?
w*s
发帖数: 7227
8
thanks a lot !

【在 d****n 的大作中提到】
: 1.server 方面,每次用户submit时候,同时返回一个当前记录的指针。
: 这个指针用来跟踪哪10个记录已经被显示了。作为一个parameter 回到你
: 的perl script中。
: 假设你用 perl+mysql
: sub get_nth_record{
: $nth=$_[0]; // keep user returned pointer
: $stmt=$_[1]; // and more params
: mysql="SELECT * from myTABLE where conditions limit nth,nth+10";
:
: return mysql_results;

X****r
发帖数: 3557
9
Thanks for the advice. Next time I should resist the temptation
that would end in digging a hole for myself when browsing.

empty
one

【在 w*s 的大作中提到】
: brother, i know you have been warmhearted to help,
: but if if you treat Chinese just like Indians treat Indians,
: then you will have more chance to survive in IT in the future.
: i got this from linuxquestions,
: In your program, check for environment variable QUERY_STRING: if it is empty
: , simply act as if it were record_per_page=10
: what happened is i was too tired and forget to take care the default for one
: of the variables.

w*s
发帖数: 7227
10
you can search answers in google if you know what to search,
same as my question.
since i didn't know the answer, i didn't know what to ask.
certainly i appreciate your help a lot !

【在 X****r 的大作中提到】
: Thanks for the advice. Next time I should resist the temptation
: that would end in digging a hole for myself when browsing.
:
: empty
: one

1 (共1页)
进入Programming版参与讨论
相关主题
Re: gedit can't display chinese.. (转载)how to display an excel file in java? (转载)
问一个web browser 的问题Matlab Gui Help
请教一个vignette vcm问题 (转载)an interview problem
use abort() to generate coredump (转载)Help: How to display data from excel in C# windows form
question on CSSdifference between firefox and IE
How to display webpages 1 by 1 ?Interview question - use a STL vector object as an argument of function.
pdfjs displaying pdf issueC#: DataSet vs. Class
help for Matlab figuressomebody used logsys before?
相关话题的讨论汇总
话题: page话题: results话题: get话题: display话题: lines