Jackanape Posted March 2, 2009 Share Posted March 2, 2009 This has been annoying me for weeks, and driving me crazy for the last 24 hours. I have been trying to include a PERL script into my php script (phpBB3), while also passing the query string to modify the output. I've got it working fine for the basic output: $output = `/usr/bin/perl /home/mysite/public_html/cgi-bin/scriptdirectory/index.cgi`; $output3 = shell_exec('/home/mysite/public_html/cgi-bin/scriptdirectory/index.cgi'); but can't pass any variables such as: $output2 = `/usr/bin/perl /home/mysite/public_html/cgi-bin/scriptdirectory/index.cgi?o=list&s=mystyle14`; I'm at my wits' end...can anyone shed some light on this for me? Link to comment https://forums.phpfreaks.com/topic/147632-solved-including-a-perl-script-in-my-php-with-passed-variables-egad/ Share on other sites More sharing options...
trq Posted March 2, 2009 Share Posted March 2, 2009 Querystrings are part of http, and are not how arguments are generally passed to a perl script. Have you tried calling this script via a url? eg; $output = file_get_contents('http://yoursite.com/cgi-bin/scriptdirectory/index.cgi?o=list&s=mystyle14'); Link to comment https://forums.phpfreaks.com/topic/147632-solved-including-a-perl-script-in-my-php-with-passed-variables-egad/#findComment-775017 Share on other sites More sharing options...
Jackanape Posted March 3, 2009 Author Share Posted March 3, 2009 WOW! Mind-boggling, indeed! The file_get_contents() does the trick, splendidly, and may I say, after spending days looking for the solution to this problem, this was the FIRST mention of that function I came across. I'm not sure exactly how it works, or why, and eventually, would like to find out how it could work with shell_exec(), but this is exactly what I needed! Here's how I ended up including it, for the curious who may come along in the future (remember the template is for phpBB3): $output = file_get_contents('http://www.wannatalkpoker.com/cgi-bin/calendar/index.cgi'); $output = ereg_replace( "Content-type: text/html", "", $output ); $template->assign_vars(array( "SCHEDULE" => $output, )); Thanks again! Link to comment https://forums.phpfreaks.com/topic/147632-solved-including-a-perl-script-in-my-php-with-passed-variables-egad/#findComment-775215 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.