With the following method, I am able to execute and display a php page:
def phpstuff require 'net/http' url = URI.parse('http://127.0.0.1/phpstuff.php’) req = Net::HTTP::Get.new(url.path) res = Net::HTTP.start(url.host, url.port) {|http| http.request(req) } render_text res.body end
However, let's suppose I want to simply execute a snippet of php code. If I am just running straight out of mongrel, on say port 3000 (not through apache), how can do that? Can I do it in the rhtml somehow?
Also, is there way, from within Rails, to get back a value returned, say, by executing a method in php? Thanks, Ike