Bạn đang xem: Passing url parameters to a cgi script from the shell
Here is the CGI form code from the site:
Enter the amount of money: Enter the initial year (1800-2008): Enter the final year (1800-2008): I"ve tried passing arguments via the "?" và "&" syntax, but none of these work:
http://www.westegg.com/inflation/infl.cgi?money=1&first=1800&last=1900http://www.westegg.com/inflation/infl.cgi?money="1.00"&first="1800"&last="1900"Thanks for your help :)
Highest score (default) Trending (recent votes count more) Date modified (newest first) Date created (oldest first)
Notice that the khung uses the POST method, not GET. It"s impossible to just pass the arguments in the URL. There"s a lot of information out there how POST works.
SO I was able to lớn get something similar to lớn work. First, make sure that you"ve got the right parameters and names (you"ve got the variable names apparently). You"ll need to look at the source code of the resultant page, but you need khổng lồ find the variable that executes the form. In my case I was using a search page & the button name was "searchresult
Flag". Try something like:
http://www.westegg.com/inflation/infl.cgi?money=1&first=1800&final=1900&searchresult
Flag=1
My parameters were different from yours, but this worked for me.
Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more
Thanks for contributing an answer to Stack Overflow!
But avoid …
Asking for help, clarification, or responding khổng lồ other answers.Making statements based on opinion; back them up with references or personal experience.To learn more, see our tips on writing great answers.
Post Your Answer Discard
By clicking “Post Your Answer”, you agree khổng lồ our terms of service và acknowledge you have read our privacy policy.
Company cookie-settings#toggle" class="s-btn s-btn__link py4 js-gps-track -link" data-gps-track="footer.click( location: 2, link: 38 )" data-consent-popup-loader="footer">Cookie Settings
Site thiết kế / hình ảnh sản phẩm © 2024 Stack Exchange Inc; user contributions licensed under CC BY-SA. Rev2024.3.28.7077
Monks
Passing URL parameters to a CGI script from the shellby Bilbo (Pilgrim) |
on Apr 01, 2003 at 19:05UTC( [id://247314]=perlquestion: print w/replies, xml ) | Need Help?? |
Bilbo has asked for the wisdom of the Perl Monks concerning the following question:
| ||||||||
Re: Passing URL parameters khổng lồ a CGI script from the shellby The Mad Hatter (Priest) on Apr 01, 2003 at 19:59UTC | ||||||||
What jasonk said was good. If you don"t really need to lớn use url_param (I don"t know if you do), you can use the param method (which will fetch data from POST or GET) & easily emulate the script being passed data by specifying name=value pairs as arguments. For example: ./myscript.cgi mode=1 foo=bar. Update Just wanted to lưu ý that cbro was right about using QUERY_STRING. | ||||||||
Re: Passing URL parameters khổng lồ a CGI script from the shellby Anonymous Monk on Jan 16, năm ngoái at 07:24UTC | ||||||||
www.google.com |
What"s my password? Create A New User | |||||||
www.com | www.net | www.org | ||||||||
node history Perl Monks graciously bestowed by Tim Vroom. Perl Monks somehow became entangled with The Perl Foundation. Wonderful website Servers and Bandwidth Generously Provided by pair Networks Built with the Perl programming language. |