1. Printing to the web browser
- Posted by David Mosley <davidmosley at davesjigsaw.com> Feb 19, 2005
- 438 views
Hi I have been trying to get euphoria to print to a web browser using this code.
puts(1, "Content-type: text/html\n\n") puts(1, "<html><head><title>Thank You</title></head>\n") puts(1, "<body bgcolor=\"#FFFFFF\">\n") puts(1,"<br>\n") puts(1, "<a href=\"http://www.RapidEuphoria.com/economy.txt\">") puts(1, "</body></html>\n")
but all I get in the web browser is this: puts(1, "Content-type: text/html\n\n") puts(1, "\n") puts(1, "\n") puts(1," \n") puts(1, "") puts(1, "\n") Does anyone know why this is going on Also I do php right now but would like to use euphoria in my web pages any info on how to use euphoria would be helpfull.Thanks David Mosley davidmosley at davesjigsaw.com
2. Re: Printing to the web browser
- Posted by "Juergen Luethje" <j.lue at gmx.de> Feb 19, 2005
- 428 views
David Mosley wrote: > I have been trying to get euphoria to print to a web browser using this code. Did you already look at %EUDIR%\HTML\cgi.htm (Euphoria 2.5)? Regards, Juergen
3. Re: Printing to the web browser
- Posted by Mario Steele <eumario at trilake.net> Feb 19, 2005
- 430 views
David Mosley wrote: > Does anyone know why this is going on > Also I do php right now but would like to use euphoria in my web pages > any info on how to use euphoria would be helpfull.Thanks > David Mosley > davidmosley at davesjigsaw.com There are several things going on here, at which any could be at fault. The first thing you want to do, is ensure that Apache Handles the extention properly. As most Web Hosts use CPanel, to find out, and rectify this problem, you do the following: 1.) Login to your CPanel 2.) Depending apon the Theme you are using, you should be able to find the icon that has the Apache Feather on it, and says Apache Handlers. If you have any other theme for cPanel, look for Apache Handler as a title. Click on that. 3.) You will see a list of User Defined Handlers, and System Defined Handlers. Above that, you'll see 2 edit feilds with an "Add" button, and below thoes, you'll see a Drop Down (Empty if you have no User Defined Handlers) With a "Delete" Button underneath the "Add" button. In the first edit box, type in '.exu .ex .exw .ecgi'. In the second box type in 'cgi-script'. Both of these should be added without the apostraphies. 4.) Once you have done this, click on the Add button, and after a few moments, it should show up under User Defined Handlers. This will tell Apache that any files with an extention of .exu, .ex, .exw, and .ecgi, are to be considered as CGI Scripts, and executed in the fashion, that most CGI Programs are executed. These include Perl CGI Files, and such. Next, we move on to the problem with your Script. Everything you entered is correct. There's no doubt about that. But, you are missing the classic She-Bang, that is common in Linux Systems. So at the very first line of the source code, add something like this: #!/home/eumario/euphoria/bin/exu This should be the path to where you have the Euphoria Linux Executable stored in. IT MUST BE AN ABSOLUTE PATH, otherwise, it will not find the executable. So it should look like this:
#!/home/eumario/euphoria/bin/exu puts(1, "Content-type: text/html\n\n") puts(1, "<html><head><title>Thank you</title></head>") puts(1, "<body bgcolor=\"#FFFFFF\">\n") puts(1,"<br>\n") puts(1,"") puts(1,"</body></html>\n")
That's another common problem. And finally, if your web host is a Linux server, like most are, you need to access a FTP Client of your choosing, that supports File Property Modifications. The file should have these properties set on it: Owner | Group | Public [x] Read | [x] Read | [x] Read [x] Write | [ ] Write | [ ] Write [x] Execute | [x] Execute | [x] Execute This is considered chmod filename.ext 755, and without this, linux doesn't recognize it as an actual executable file, which will often mess up CGI Scripts. If you have any more questions, or none of this helps, feel free to post again. Mario Steele