fkdean
11-02-2003, 05:00 PM
Hello,
Does anyone know how to define a PHP varible in SSI??
Like:
<?php $var = "Hello"; ?>
but have that in SSI?
Thanks for any help,
Dean
Here's what I found on Google
If you're trying to get SSI and PHP working together through one .php file, that's impossible in Apache 1.3. You can either have PHP in .php files, or SSI in .php files - you can't mix and match them.
Ignoring the above, it sounds like .php (which may or may not have been associated with mod_php) is being handled by the SSI part of Apache, and since no MIME-type has been defined for .php, your browser doesn't know what to do with it. You'll want to add .php to:
AddType text/html .shtml
But, remember, you can't use PHP and SSI in the same file. It's one or the other. Apache 2.0 purportedly will allow you to do this by setting up filters, but I've yet to experiment with it.
Why would you use SSI if PHP works too?
Website Rob
11-02-2003, 05:04 PM
As SSI was not designed with a language like PHP in mind, I don't believe it can be done.
All you can do is to include PHP files through virtual directive but you can't define PHP variables in SSI
fkdean
11-02-2003, 05:19 PM
lol yea... i told you that :stickout:
John[H4Y]
11-04-2003, 09:27 PM
It would work if you are using PHP through CGI.