Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Error while trying to compile a pascal program from a cgi file

sinelawsinelaw Member Posts: 51
I used C to write a cgi script to call the turbo pascal compiler to compile a pascal program.

system("tp7\bin\tpc test.pas");

When I used the above code, I get the following error message in the error log:
malformed header from script. Bad Header=Turbo Pacal Version 7.0 Copyright: [directory of the cgi]


I'm running the Apache server on a Windows XP system, but the error also occurs in win98.



Comments

  • JonathanJonathan Member Posts: 2,914
    : I used C to write a cgi script to call the turbo pascal compiler to compile a pascal program.
    :
    : system("tp7\bin\tpc test.pas");
    :
    : When I used the above code, I get the following error message in the error log:
    : malformed header from script. Bad Header=Turbo Pacal Version 7.0 Copyright: [directory of the cgi]
    :
    :
    : I'm running the Apache server on a Windows XP system, but the error also occurs in win98.
    :
    Your problem is that system() will pass on any output the pascal compiler gives. You may or may not want this.

    If you do want it, you need to print a valid HTTP header before calling system(). That'd most likely look like:-
    printf("Content-type: text/html

    ");

    If you don't want it, you need to find a way of starting the process without havings its output passed straight on.

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

Sign In or Register to comment.