SQL statements from MC/Rev under Linux

Pierre Sahores psahores at easynet.fr
Sat Jan 5 11:54:00 EST 2002


Hi the List, Tuviah,

Because i could'nt have, for yet, the revdb up running under Linux, here
is the scripts i continue to use to access to MySQL and PostGreSQL from
within MC :


on the "mc" side :

> on SQLbyMC
>   global DBParsed
>   
>   put "test1=1&test2=2&test3=3&test4=4" into DBParsed # to replace by the SQL statements to post to the .php sockets listener script
>   
>   repeat 22
>     put "z" after DBParsed
>   end repeat
>   set httpheaders to "Content-Type: application/x-www-form-urlencoded" & cr & "Content-Length:" && the length of DBParsed & cr & cr # Apache :yes ; IIS : no
>   post DBParsed to url "http://localhost/wmc4.xml"
>   
>   put line 3 of it into DBParsed
>   answer DBParsed
>   
> end SQLbyMC



on the "php" side :

> <?
> 
> if ($REQUEST_METHOD == POST) {
> 
> 	$headers = $HTTP_POST_VARS;
> 	while (list($header, $value) = each($headers)) $exAE .= "$header=$value&";
> 	
> 	print $exAE." vu !"; // using the php commands, SQL statments have to be insered there.
> 		
> }
> 
> else print("<HTML><HEAD><TITLE>ERROR: File Not Found</TITLE></HEAD>".
>         "<BODY background='/gif/fond-maison.gif'><H1>File Not Found</H1><P>".
>         "<H3>The file you have requested does not exist on this server.</H3></BODY></HTML><BR>\n");
> 
> ?>


This way run fine too and don't need to have any ODBC bridge installed.

Best Regards, Pierre Sahores

WEB & VPN applications & databases servers
Inspection académique de Seine-Saint-Denis
Qualifier & produire l'avantage compétitif


BTW : I'm far ok with the complete "MC/Rev web applications server"
stack model, i will post to the ones who asked about before Christmas !
;-)



More information about the metacard mailing list