Op 3/23/10 3:27 AM, Rob Gould schreef:
> I am trying to replicate the functionality that I see on this site:
> 
> http://blog.maniac.nl/webbased-pdf-lto-barcode-generator/
> 
> Notice after you hit SUBMIT QUERY, you get a PDF file with a page of 
> barcodes.  That's _exactly_ what I'm after.
> Fortunately, the author gives step-by-step instructions on how to do this on 
> this page:
> 
> http://blog.maniac.nl/2008/05/28/creating-lto-barcodes/
> 
> 
> So I've gotten through all the steps, and have created the 
> "barcode_with_samples.ps" file, and have it hosted here:
> 
> http://www.winecarepro.com/kiosk/fast/shell/
> 
> Notice how the last few lines contain the shell-script that renders the 
> postscript:
> 
> #!/bin/bash
> 
> BASE=”100″;
> NR=$BASE
> 
> for hor in 30 220 410
> do
> ver=740
> while [ $ver -ge 40 ];
> do
> printf -v FNR “(%06dL3)” $NR
> echo “$hor $ver moveto $FNR (includetext height=0.55) code39 barcode”
> let ver=$ver-70
> let NR=NR+1
> done
> done
> 
> 
> I need to somehow create a PHP script that "executes" this shell script.  And 
> after doing some research, it sounds like
> I need to use the PHP exec command, so I do that with the following file:
> 
> http://www.winecarepro.com/kiosk/fast/shell/printbarcodes.php
> 
> Which has the following script:
> 
> <?php 
> 
> $command="http://www.winecarepro.com/kiosk/fast/shell/barcode_with_sample.ps";;
> exec($command, $arr);
> 
> echo $arr;
> 
> ?>
> 
> 
> And, as you can see, nothing works.  I guess firstly, I'd like to know:
> 
> A)  Is this PHP exec call really the way to go with executing this shell 
> script?  Is there a better way?  It seems to me like it's not really 
> executing.

that's what exec() is for. $command need to contain a *local* path to the 
command in question, currently your
trying to pass a url to bash ... which obviously doesn't do much.

the shell script in question needs to have the executable bit set in order to 
run (either that or change to command to
run bash with your script as an argument)

I'd also suggest putting the shell script outside of your webroot, or at least 
in a directory that's not accessable
from the web.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to