CGI and PHP?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
spacebiscuit
Forum Contributor
Posts: 390
Joined: Mon Mar 07, 2005 3:20 pm

CGI and PHP?

Post 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.
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: CGI and PHP?

Post 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?
spacebiscuit
Forum Contributor
Posts: 390
Joined: Mon Mar 07, 2005 3:20 pm

Re: CGI and PHP?

Post 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.
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: CGI and PHP?

Post 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?
Post Reply