Skip to main content

Executing php from a acucobol cgi

  • May 23, 2011
  • 4 replies
  • 0 views

[Migrated content. Thread originally posted on 20 May 2011]

Hello,

I have a website that run with acucobol cgi scripts. Now we want integrate some php code within the pages generated by our cgi scripts. The problem is that the output of the cobol program that runs the cgi (created via displays) is sent directly to navigator and the server does not interpret the php code embedded on page.

As a possible solution we plan to run the php code via call system using "php-p something.php >> outputfile" and then the cobol program to read the file outputfile and integrate it into the page but does not seem a very good solution.


Any help will be appreciated.

4 replies

[Migrated content. Thread originally posted on 20 May 2011]

Hello,

I have a website that run with acucobol cgi scripts. Now we want integrate some php code within the pages generated by our cgi scripts. The problem is that the output of the cobol program that runs the cgi (created via displays) is sent directly to navigator and the server does not interpret the php code embedded on page.

As a possible solution we plan to run the php code via call system using "php-p something.php >> outputfile" and then the cobol program to read the file outputfile and integrate it into the page but does not seem a very good solution.


Any help will be appreciated.
The problem is that the output of the cobol program that runs the cgi (created via displays) is sent directly to navigator and the server does not interpret the php code embedded on page.


first: sorry for my bad english and i hope i can explain what i would do with a problem like this.

yeah thats the problem and there you must hook to solve the problem :)
if i had the problem i would add a ajax/javascript which loads the php data.

Normal way
you visit mypage.acu
server generate the output and
send to the browser

With the javascript
you visit mypage.acu
server generate the output with the ajax part and
send to the browser
the browser gets the command from ajax to load mypage-upgrade.php
mypage-upgrade.php is loaded, send the data to the ajax part
the ajax-part place it at the defined place from your acu-output

--> this is like an iframe without an iframe :D

i think its the better solution without the need of temp-files.

[Migrated content. Thread originally posted on 20 May 2011]

Hello,

I have a website that run with acucobol cgi scripts. Now we want integrate some php code within the pages generated by our cgi scripts. The problem is that the output of the cobol program that runs the cgi (created via displays) is sent directly to navigator and the server does not interpret the php code embedded on page.

As a possible solution we plan to run the php code via call system using "php-p something.php >> outputfile" and then the cobol program to read the file outputfile and integrate it into the page but does not seem a very good solution.


Any help will be appreciated.

Short example with the use of the jquery-framework (jquery-1.4.1.min.js) - NOT TESTED

Script in the head:

<script type="text/javascript">
    $.ajax({
       type: "GET",
       url: "reload.php?parameter1=<?php echo $_GET['paramerter1']; ?>&parameter2=<?php echo $parameter2; ?>",
       data: "reload",
       success: function(reload){
   
           $('#reload').empty();
           $('<span>' reload '</span>').appendTo('#reload');
   
       }
     });   
</script>



Place the php output:

<div id="reload" style='text-align:center;'>

<img src="loading.gif" alt="" />
<br />
<div style='color:grey;'><small>php data is loading...</small></div>
                           
</div>



[Migrated content. Thread originally posted on 20 May 2011]

Hello,

I have a website that run with acucobol cgi scripts. Now we want integrate some php code within the pages generated by our cgi scripts. The problem is that the output of the cobol program that runs the cgi (created via displays) is sent directly to navigator and the server does not interpret the php code embedded on page.

As a possible solution we plan to run the php code via call system using "php-p something.php >> outputfile" and then the cobol program to read the file outputfile and integrate it into the page but does not seem a very good solution.


Any help will be appreciated.
Thanks neidingd

It could be a solution. Now we must learn a bit of AJAX to solve it.






[Migrated content. Thread originally posted on 20 May 2011]

Hello,

I have a website that run with acucobol cgi scripts. Now we want integrate some php code within the pages generated by our cgi scripts. The problem is that the output of the cobol program that runs the cgi (created via displays) is sent directly to navigator and the server does not interpret the php code embedded on page.

As a possible solution we plan to run the php code via call system using "php-p something.php >> outputfile" and then the cobol program to read the file outputfile and integrate it into the page but does not seem a very good solution.


Any help will be appreciated.
Thanks neidingd

It could be a solution. Now we must learn a bit of AJAX to solve it.