OT: filepro HTML output

Enrique Arredondo henry at vegena.net
Fri Aug 6 10:36:40 PDT 2010


Hi ,

I'm having an issue with a cgi-bin script that runs a filepro report and 
generates a HTML page but when I cat that page back to the browser it only 
displays the HTML part but any php script within it won't execute. Why ? 
Can I use something else than cat ?

Example :

this is the cgi bin file :

#!/bin/ksh
umask 0

. ./fpsetenv.bat
FILE=/usr2/tmp/tsb$$.php
> $FILE
FP=$QUERY_STRING

case $REMOTE_ADDR in
99.49.*|76.*|71.108.*|75.51.*|71.108.15.136|66.143.70.126|69.53.25.82|69.239.42.
*|148.243.236.*|12.191.30.122)

echo Content-type: text/html
echo

$PFPROG/fp/report cgi -f bulletin -sr "1" -u -rw "$$" -y n -r "$FP" > 
/dev/null
2>&1

cat -v $FILE


------------- cut here---------

and here is the fp code snippet , that has the php script :

::html id tx "<?php":
::html id tx "$hd=mysql_connect (\"http_server\",\"login\",\"password\")":
::html id tx " or die('Could not connect^A ' . mysql_error());":
::html id tx "mysql_select_db(\"engspecs\", $hd);":
::html id tx "$result=mysql_query (\"Select * from bulletin where 
bulletinid='
"{@pm{"';\");":
::html id tx "$row=mysql_result($result,\"0\",\"bulltext\");":
::html id tx "$text=str_replace(\"\n\",\"<br>\",$row);":
::html id tx "echo $row;":
::html id tx "mysql_close($hd);":
::html id tx "?>":

----------- cut here ------------

so the output file RUNS perfectly if opened with a web browser but won't 
when is cated back.

Here's the code from the browser "source code viewer".

<HTML>
<HEAD>
</HEAD>
<BODY>
<style type="text/css">
font, body {background-color:#000000;
font-family:Calibri, verdana, arial, sans-serif;color:#FFFFFF}
A:hover {text-decoration: underline;color:red;font-weight:bold}
A:link {text-decoration: underline;color:orange;font-weight:bold}
A:visited {text-decoration: underline;color:red;font-weight:bold}
</style>
<H2 ALIGN="center">
Technical Service Bulletins
</H2>
<H3 ALIGN="center">
TSB - 1199
</H3>
<TABLE>
<TR>
<TD>
",$row);
echo $row;
mysql_close($hd);
?>
</TD>
</TR>
</TABLE>
<DIV ALIGN="Center">
<A HREF="javascript:history.go(-1)">
Go Back
</A>
</DIV>
</BODY>
</HTML>


Thanks


More information about the Filepro-list mailing list