Page 1 of 1

CGI and PHP?

Posted: Mon Mar 31, 2008 10:37 am
by spacebiscuit
Hi,

I have content to my site that my provider has instructed I display on my site using the following code:

<!--#include virtual="fbn3.cgi?mode=mklnk&movie=/path/video_1.wmv" -->

I believe the above is CGI code although I am not 100% certain.

Is it possible to write this into a PHP variabel, soething like:

$content=<!--#include virtual="fbn3.cgi?mode=mklnk&movie=/path/video_1.wmv" -->;

Thanks in advance,

Rob.

Re: CGI and PHP?

Posted: Mon Mar 31, 2008 11:15 am
by JAB Creations
I'm not clear on what your question is exactly though if you're trying to do an include in PHP like you are in Perl then...

Code: Select all

include("fbn3.cgi?mode=mklnk&movie=/path/video_1.wmv");
You can also do it without the parenthesis I think?

Code: Select all

include"fbn3.cgi?mode=mklnk&movie=/path/video_1.wmv";
Is this what you mean?

Re: CGI and PHP?

Posted: Mon Mar 31, 2008 11:33 am
by spacebiscuit
I think that may work, I basically need to assign whatever is returned by the cgi to a php variable.

Is that possible?

Thanks,

Rob.

Re: CGI and PHP?

Posted: Mon Mar 31, 2008 11:49 am
by JAB Creations
Well you could pass an HTTP query!

In PHP you can read a query like this...
my_file.php?want=candy

Code: Select all

<?php
if ($_GET['want'] == "candy") {$my_var = 'chocolate';
else if ($_GET['want'] == "fruit") {$my_var = 'apple';
 
// Ok so have PHP spit out some HTML to show what we have!
echo '<h3>'.$my_var.'</h3>';
?>
Does this help?