From: 7stud -- Date: 2008-03-30T18:32:22+09:00 Subject: Re: HTTP GET requests in a Ruby CGI Script Ben Aroia wrote: > I think I've got it. I *think* it was a problem with calling a function > before sending the content-type bit. Darn. I had just worked up a php > script linked to a sql database. Oh-well. The ruby script was a lot more > flexible. Thanks! > Here's another question: Is is it possible to dynamically generate a php > script? Sure. php code is just text, and you can write text to a file in most computer programming languages. Here is a ruby example: File.open("prog1.php", "w") do |file| file.puts("") end > I would like to do the following: > Take their search terms, > Check if the terms are already in the database > if they are -> pull the results from the database and display them > otherwise, pull the results out of google, and put them in the database, > then display them. > Not sure if you could go from a ruby script to a php page and back > again. I think you should be able to execute a php script doing something like this: system("path1 path2") where path1 is the path to php and path2 is the path to prog1.php. -- Posted via http://www.ruby-forum.com/.