Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Web CGI
Web CGI [message #27025] Mon, 21 June 2010 21:04 Go to next message
ikeuchi is currently offline  ikeuchi
Messages: 1
Registered: August 2007
Junior Member
Hi everyone.
I wrote this topic only to demonstrate how easy is to develop WEB CGI with U++.
The code is simple and I really needed it for a project.

Best Regards!



#include <Core/Core.h>
#include <Oracle/Oracle8.h>


using namespace Upp;

CONSOLE_APP_MAIN
{
Oracle8 oracle;
String raw_get = getenv("QUERY_STRING");
String id_code;
id_code = raw_get.Mid(3, 12);
oracle.Open("user/pwd@server:1521/sid", false, NULL);
Sql sql(oracle);
sql.Execute("SELECT ADD_TEXT FROM SOMETABLE WHERE ADD_ENTITY = 'TASK' AND ADD_CODE = '" + id_code + "'");
sql.Fetch();
Cout() << "Content-type: text/html\n\n";
Cout() << "<html><head></head><body>";
Cout() << "<pre style=\"font-family:verdana;size:10\">" + sql[0].ToString() + "</pre>";
Cout() << "</body></html>";
}
Re: Web CGI [message #27032 is a reply to message #27025] Tue, 22 June 2010 09:04 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Yes, it certainly is.
Some time ago I implemented a complete web site engine as native FreeBSD executable with U++. U++ proved to be stable enough as a server platform.
Re: Web CGI [message #27076 is a reply to message #27025] Thu, 24 June 2010 20:13 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
ikeuchi wrote on Mon, 21 June 2010 15:04

Hi everyone.
I wrote this topic only to demonstrate how easy is to develop WEB CGI with U++.
The code is simple and I really needed it for a project.

Best Regards!



#include <Core/Core.h>
#include <Oracle/Oracle8.h>


using namespace Upp;

CONSOLE_APP_MAIN
{
Oracle8 oracle;
String raw_get = getenv("QUERY_STRING");
String id_code;
id_code = raw_get.Mid(3, 12);
oracle.Open("user/pwd@server:1521/sid", false, NULL);
Sql sql(oracle);
sql.Execute("SELECT ADD_TEXT FROM SOMETABLE WHERE ADD_ENTITY = 'TASK' AND ADD_CODE = '" + id_code + "'");
sql.Fetch();
Cout() << "Content-type: text/html\n\n";
Cout() << "<html><head></head><body>";
Cout() << "<pre style=\"font-family:verdana;size:10\">" + sql[0].ToString() + "</pre>";
Cout() << "</body></html>";
}



The only possible problem here is that "oracle.Open" can take quite a long time in certain circumstances.

I am looking forward to somebody trying FastCGI... Smile

Mirek
icon4.gif  Re: Web CGI [message #28343 is a reply to message #27076] Mon, 30 August 2010 09:01 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Mirek

Quote:

I am looking forward to somebody trying FastCGI... Smile

Could it be included in the TODO list?


Best regards
IƱaki
Re: Web CGI [message #28368 is a reply to message #27076] Tue, 31 August 2010 04:57 Go to previous message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
luzr wrote on Thu, 24 June 2010 14:13


I am looking forward to somebody trying FastCGI... Smile


I wrote a SCGIServerClass and posted code in http://www.ultimatepp.org/forum/index.php?t=msg&th=5439& amp;start=0&

I think SCGI is more desirable than FastCGI, but I can see where it would be personal preference.

Jeremy
Previous Topic: [FIXED] X11 GLCtrl broken again ?
Next Topic: navigate does not always work correctly
Goto Forum:
  


Current Time: Tue Apr 16 15:28:05 CEST 2024

Total time taken to generate the page: 0.01137 seconds