Hi all-

We've been working on wrapping the OpenSRS scripts (reg_system.cgi, 
manage.cgi, and renew.cgi) with PHP pages, so that a site's header, nav, 
footer, etc. can be displayed around the output of the scripts.  This is 
something we've done before with other cgis, albeit simpler cgis.

I've never needed to pass cookies through to the cgi or multiple fields 
with the same name. (manage.cgi uses an http cookie, and reg_system.cgi 
wants multiple "domain" fields sent with all the domains you're registering)

Has anyone else done this successfully?  What method did you use for 
calling the cgis?

We've tried several methods including:

- Treat the url as a file: $page = join (@file ("$url"),''); where $url is 
the url of the cgi with GET parameters appended.  This way all the fields 
had to show up on the URL string, which is not very secure.

- Using apache virtual includes: $result = 
virtual($script.'?'.$QSTRING);  This didn't allow us to modify the output 
to change the urls from /cgi-bin/manage.cgi to manage.php.

- Using exec or ``: $result = `$cmd $args`;  Here we converted the POSTed 
variables onto the arg list, but PHP doesn't like the multiple "domain" 
fields it's sent - it just picks the last one.

- CURL: haven't tried yet because it means recompiling the web server to 
install.


I have heard of and seen the pure PHP interfaces out there (nice job Colin 
V. :-) but we're looking for an implementation that allows us to drop in 
the actual code from OpenSRS, while keeping the framework of the page PHP 
(primarily to ease and speed upgrades).  I know the cgi's will pull html in 
from base.html (we just blew away the file and modified the templates to 
match our design), but the template code won't be executed as PHP.

Personally, I'm open to alternate solutions.

I'd be interested in hearing about how others have implemented the scripts 
and whether you were able to wrap the scripts (with minimal modification to 
the scripts themselves) or if you had to add hooks to your own code into 
the OpenSRS scripts to accomplish what I'm talking about.

Thanks!

-Russ






Reply via email to