D
Dave
I have a C program (called dipole) that takes 3 command line arguments.
I want a user to be able to run the program with their choice of
arguments from a web page.
I wrote a simple form in perl that allows the user to enter the 3
required parameters. How can I pass them from perl to the C program,
using perl as a wrapper?
The form is at
http://www.southminster-branch-line.org.uk/cgi-bin/test3-cgi
and the source below of it below.
Is there a way I can call execute
'dipole frequency length diameter'
and return standard output of that C program to the browser?
I think I need to use 'open' rather than exec or system, but I can't get
any sense from anything. I am new to perl.
#!/usr/bin/perl
use CGI qwstandard);
print header;
print start_html('Self Impedance of a dipole'),
h1('Self impedance of a simple dipole (not folded)'),
start_form,
"Frequency (MHz)? ",textfield('frequency'),
p,
"Length (m) ? ",textfield('length'),
p,
"Diameter (mm) ?",textfield('diameter'),
submit,
end_form,
hr;
if (param()) {
print
"Frequency is ",em(param('frequency')),
p,
"Length is ",em(param('length')),
p,
"Diameter is ",em(param('diameter')),
hr;
}
print end_html;
I want a user to be able to run the program with their choice of
arguments from a web page.
I wrote a simple form in perl that allows the user to enter the 3
required parameters. How can I pass them from perl to the C program,
using perl as a wrapper?
The form is at
http://www.southminster-branch-line.org.uk/cgi-bin/test3-cgi
and the source below of it below.
Is there a way I can call execute
'dipole frequency length diameter'
and return standard output of that C program to the browser?
I think I need to use 'open' rather than exec or system, but I can't get
any sense from anything. I am new to perl.
#!/usr/bin/perl
use CGI qwstandard);
print header;
print start_html('Self Impedance of a dipole'),
h1('Self impedance of a simple dipole (not folded)'),
start_form,
"Frequency (MHz)? ",textfield('frequency'),
p,
"Length (m) ? ",textfield('length'),
p,
"Diameter (mm) ?",textfield('diameter'),
submit,
end_form,
hr;
if (param()) {
"Frequency is ",em(param('frequency')),
p,
"Length is ",em(param('length')),
p,
"Diameter is ",em(param('diameter')),
hr;
}
print end_html;