i tried several methods but this was the best:
cat *.MPG | ffmpeg -i - -b 1500k -ar 44100 together.flv
the * goes in ordered state so if you have videos from your camera they are already ordered.
i hate when people escape the quotes in a php or perl or bash cgi script :
there is a little workaround called End Of Message:
in perl do
print << EOM; htmlcode without escaping EOM;
with bash you would use cat instead of print.