PHP has a CLI mode (command line interpreter).<br><br>You can use argv and argc like from any other language. Just check if the arguments are set, and then process things normally, and spit the output, perhaps without HTML markup.<br>
<br>The same script can then be used from a web based application or command line.<br><br>See more here <a href="http://ca.php.net/features.commandline">http://ca.php.net/features.commandline</a><br><br>And make sure you sanitize the input. Never trust use input in web application. NEVER!<br>
<br><div class="gmail_quote">On Mon, Mar 9, 2009 at 3:28 PM, Insurance Squared Inc. <span dir="ltr"><<a href="mailto:gcooke@insurancesquared.com">gcooke@insurancesquared.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I've got a web based php script I run on my webserver. It accepts, via a standard input form, a few variables and an input file. Then it crunches some numbers and sends the results as a file via email. I have a number of files I want to parse through this script and I want to do it locally. How do I effectively POST a file (I could probably change the script to accept GET as well, though I expect it doesn't make a difference) via a line in a shell script? I know how to do it with the other variables, I just do this:<br>
<br>
<a href="http://192.168.0.1/myscript.php?var1=val1&var2=val2" target="_blank">http://192.168.0.1/myscript.php?var1=val1&var2=val2</a><br>
<br>
I want to repeat that numerous times as a shell script, with the file upload attached somehow.<br>
<br>
Help? :) I don't even know what to Google.<br>
<br>
_______________________________________________<br>
<a href="http://kwlug-disc_kwlug.org" target="_blank">kwlug-disc_kwlug.org</a> mailing list<br>
<a href="http://kwlug-disc_kwlug.org" target="_blank">kwlug-disc_kwlug.org</a>@<a href="http://kwlug.org" target="_blank">kwlug.org</a><br>
<a href="http://astoria.ccjclearline.com/mailman/listinfo/kwlug-disc_kwlug.org" target="_blank">http://astoria.ccjclearline.com/mailman/listinfo/kwlug-disc_kwlug.org</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Khalid M. Baheyeldin<br><a href="http://2bits.com">2bits.com</a>, Inc.<br><a href="http://2bits.com">http://2bits.com</a><br>Drupal optimization, development, customization and consulting.<br>
Simplicity is prerequisite for reliability. -- Edsger W.Dijkstra<br>Simplicity is the ultimate sophistication. -- Leonardo da Vinci<br>