简体   繁体   English

不带参数名称的传递参数

[英]Passing parameter without parameter name

I am trying to pass a parameter after string query. 我正在尝试在字符串查询后传递参数。
I know that I can pass parameter with a name to cgi, for example I can pass a name parameter by doing www.mypage.com/index.html?name=Sae 我知道我可以将带有名称的参数传递给cgi,例如,我可以通过执行www.mypage.com/index.html?name=Sae传递名称参数
and retrieve it using CGI my $name = q->param('name') 并使用CGI my $name = q->param('name')检索它

But is there a way to pass parameters without parameter name? 但是,有没有方法可以传递不带参数名称的参数?
For example if I want to pass the Sae part in www.mypage.com/index.html?Sae 例如,如果我想通过www.mypage.com/index.html?SaeSae部分

is there any way to do this? 有什么办法吗? any programming language is welcome 欢迎任何编程语言

Have you tried inspecting param after calling a CGI script with only ?Sae ? 您仅用?Sae调用CGI脚本后是否尝试过检查param

In debug mode, it seems to assign the value to the keywords key: 在调试模式下,似乎将值分配给keywords key:

echo Sae | perl -MCGI=:debug -E '
    $q=CGI->new;
    say "$_: ", scalar $q->param($_) for $q->param'

(offline mode: enter name=value pairs on standard input; press ^D or ^Z when done)
keywords: Sae

$q->keywords seems to work, too. $q->keywords似乎也可以。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM