• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

run curl from a cgi script

 
Howard Ralston
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
I am trying to run a perl script (runCurl.cgi) from my cgi-bin. In the program I simply want to pass parameters, create a string, and then run curl use the string. For example:
curl "https://myvendor.com/cgi-bin/program.cgi?name=parameter1&password=parameter2"
I have tried to use this but get a syntax error:
syntax error at runCurl.cgi line 7, near "curl "https://www.myvendor.com/admin-cgi-bin/program.cgi?domain=yadayada.com&uid=admin&pass=noneed&cmd=add&login=bugs&password=123qwe&firstname=Howard&lastname=Ralston&reminder=java""
Execution of runCurl.cgi aborted due to compilation errors.
Here is what I have. I have not set up receipt of parameters yet just have it hard coded.

Any ideas on how to actually do this?
Thanks,
Howard
[ March 21, 2003: Message edited by: Howard Ralston ]
 
Donal Lynch
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not familiar with curl, but assuming that it's a separate program and not a Perl function, you can get its output with open FILEHANDLE,'command|':

Since this is interpreted by something like a shell, you might have to escape out the ampersands and question marks; also be aware of the security implications of substituting parameters.
[ March 22, 2003: Message edited by: Donal Lynch ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic