I print some text after my CGI script finishes. As I understand the following line is compulsory:
print('Content-type: text/html\n\n')
apparently for the server to know that it must output HTML?
However, what solution would you suggest to make it invisible on the output page?
even if after that print i add:
print("<HTML>")
...
print("</HTML>")
the content type is printed after the html tag like regular text
EDIT. full code:
#!/usr/bin/python3
import cgi
import cgitb
import sys
import subprocess
import os
import threading
import myModule
cgitb.enable()
form = cgi.FieldStorage()
a1= form['a1'].value
a2=form['a2'].value
a3=form['a3'].value
print('Content-type: text/html\n\n')
print('<html><head></head><body>')
pid=os.fork()
if(pid==0):
print('<div align="center" > <br/><br/><br/><br/><h1>')
infoMsg=myModule.myFun(a1,a2,a3)
print('</h1></div></body></html>')
else:
exit()