RE: [PHP] PHP and CGI
| From: | Daevid Vincent | Date: | Wed, 19 Aug 2009 00:44:55 +0000 |
| Subject: | RE: [PHP] PHP and CGI | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-296944@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: sono-io@fannullone.us [mailto:sono-io@fannullone.us]
> Sent: Tuesday, August 18, 2009 5:10 PM
> To: PHP General List
> Subject: [PHP] PHP and CGI
>
> I've searched high and low for an answer to this.
> Hopefully someone
> here might know. Can PHP be used under a CGI? I tried to put the
> following code on one of my perl shopping cart pages but it doesn't
> work:
>
> <?php
> echo "<select name=\"Year\">";
> for ($year = date("Y") ; $year <= date("Y") + 8 ; $year++) {
> echo "<option value=\"$year\">$year</option>\n";
> }
> echo "</select>";
> ?>
>
> It works fine on a .php page. I know that SSI will
> not work under
> CGI, so maybe it's the same for PHP. Is there anyway to get this to
> work?
Well, if you already have the page coded in Perl, why not just write those 5
lines in perl?!
It's a straight up for loop basically and some print statements. You're not
hitting a database or using anything remotely PHP-esque there.
I'm not so sure you can just mix and match parsers. I recall years ago some
talk of doing this, but I think it's just so rare and really impractical
that it's not worth setting up even if you can do it with some Apache magic.
Stick to one pre-processor language. Either all PHP or all Perl but not
both.
Daevid.
"Some people, when confronted with a problem, think 'I know, I'll use
XML.'"
Now they have two problems.