I am forwarding from nodejs to an html file through code:
res.sendFile(__dirname + '/' + fileToServe);
where fileToServe is an html file. I notice that when I do this, the previous code I had in my .htaccess to interpret html files as php files does not work anymore. Therefore, I can't include php files, or php code for that matter. All I need to do is get a session variable from php. I have thought about running the php file via node through something like,
if(fileToServe == 'index.html'){
//php parse
var exec = require("child_process").exec;
app.get('/', function(req, res){exec("php index.php", function (error, stdout, stderr) {res.send(stdout);});});
}
and then get the session variable in the mentioned "index.php," but the problem with that is that the php runs on my server, not on the client, where I need to get the php session variable from, and store.
If I simply change the index.html file name to index.php, and try to do res.sendFile on that, nodejs doesn't understand it, and therefore can't serve the file.
Any ideas greatly appreciated!
thanks,