[kwlug-disc] Script question

Khalid Baheyeldin kb at 2bits.com
Mon Mar 9 15:52:15 EDT 2009


PHP has a CLI mode (command line interpreter).

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.

The same script can then be used from a web based application or command
line.

See more here http://ca.php.net/features.commandline

And make sure you sanitize the input. Never trust use input in web
application. NEVER!

On Mon, Mar 9, 2009 at 3:28 PM, Insurance Squared Inc. <
gcooke at insurancesquared.com> wrote:

> 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:
>
> http://192.168.0.1/myscript.php?var1=val1&var2=val2
>
> I want to repeat that numerous times as a shell script, with the file
> upload attached somehow.
>
> Help? :)  I don't even know what to Google.
>
> _______________________________________________
> kwlug-disc_kwlug.org mailing list
> kwlug-disc_kwlug.org at kwlug.org
> http://astoria.ccjclearline.com/mailman/listinfo/kwlug-disc_kwlug.org
>



-- 
Khalid M. Baheyeldin
2bits.com, Inc.
http://2bits.com
Drupal optimization, development, customization and consulting.
Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
Simplicity is the ultimate sophistication. --   Leonardo da Vinci
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://astoria.ccjclearline.com/pipermail/kwlug-disc_kwlug.org/attachments/20090309/d5b3347e/attachment-0001.html>


More information about the kwlug-disc_kwlug.org mailing list