PDA

View Full Version : OK, I give up.... a CGI script from a PHP module using vb & vba variables.


KW802
07-26-2004, 11:36 AM
OK, I'm waving the white flag on this one, I give up..... :o

I have an old CGI script that reads through a flat file and outputs three different HTML tables, one for birthdays, reminders, and events that took place on a particular date. If there were no birthdays, for example, found in the flat file then that particular HTML table is not created so the output could be either blank or from 1 to 3 HTML tables. The CGI script is using "print" statements for it's output.

What I've done so far in order to turn this into a CMPS module is to (a) create a PHP wrapper that executes the CGI script and captures the results into a variable and then (b) I created a template with nothing in it other than the name of the variable from the PHP wrapper (since, remember, the HTML tables are produced in the CGI script).

Now so far that went pretty easy and I was getting output like I was expecting. The problem I ran into is that the tables in the CGI script, of course, aren't looking like the rest of the modules on the screen. No problem, I thought, I'd just change the HTML code in the CGI script to mimic the usual generic CMPS template. Oh, that's when the fun began.

First problem was that when I put the variables like $vba_options[portal_blockbullet] into the CGI script it would interpret it as a local variable so since that variable wasn't assigned locally it wouldn't display anything. OK, no problem. I just put a slash "\" in front of the $ so that it would treat it as a literall instead of a local variable.

Well, now the output is literally displaying $vba_options[portal_blockbullet] instead of treating it as a local variable once it gets to the PHP wrapper. :(

Any thoughts? Am I up the river on this one?

Brian
07-26-2004, 11:58 AM
Sorry, I don't know a thing about CGI though.

Our Sponsors
 

KW802
07-26-2004, 01:36 PM
Sorry, I don't know a thing about CGI though.
Any thoughts then on when it converts the string to the variable value? It looks like $vba_options[portal_blockbullet] is getting passed back to the template as part of the variable thats getting created in the PHP wrapper but I'm lost as to at what point does something interpret the $vba_options[portal_blockbullet] variable. Does the translation take place in the PHP wrapper or in the CMPS code when it displays the template?

In other words, if the output (see middle column of http://www.farpointstation.org, 2nd module down) contains a value of $vba_options[portal_blockbullet] then why wouldn't it display the proper value? :confused:

If I can figure out where it's supposed to change $vba_options[portal_blockbullet] to the variable value then hopefully I can figure out why it isn't doing it. I was thinking that perhaps it was retaining the "\" from the CGI script but it doesn't appear to be.

(If my rambling isn't making sense just say so. :p )