From: Jano Svitok Date: 2007-07-12T23:23:29+09:00 Subject: Re: Ruby and PHP code in html-page On 7/12/07, Vadim Shevchenko wrote: > For example I have such html-page: > > test.html > ========== > > > > <% > puts 'hello' > %> > >
> > > phpinfo(); > > ?> > > > > =========== > > Main web-server script-language is Ruby. > I want to include PHP-code. > > Is it posiible? It is possible if you run the code first through ERB and then through PHP or vice versa. How slow it will be depends on your deployment type - i.e. whether do you run PHP and/or Ruby as CGI, mod_ruby, using mongrel etc. If mod_php allows you to define a post_request filter, that might help. Or you could create a subrequest to php, and than process its output. I see a maintainability problem here - two languages intermixed. The easier way would be to separate all the php or ruby stuff to a separate webservice/subpage, and include its output to the main page. ...and if you want to really inter-mix ruby and php, that would be a nightmare ;-) as in: <% 1..2.each do |i| %> <% end %> J.