Click to See Complete Forum and Search --> : cant display cgi text in browser


terrakota
08-05-2004, 12:06 AM
hello
im trying to display a simple text in the brower from the <img> tag
please any help focus in c++.

here is the html page that i call
---------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>counter</title>
</head>
<body>
<img src="cgi-bin/counter.exe">
</body>
</html>
----------------------------------------------------------
this should display the 2004 year

heres the c++ source

--------------------------------------------------------------
#include <iostream>
using namespace std;

int main()
{
cout << "content-type: text/plain\n\n";

cout << "2004";

return 0;
}

-------------------------------------------------
the idea is that when i load the html page the 2004 should be displayed

when i run the cgi typing the url of the cgi it runs just fine but
when trying to load it from the <img> tag the text is not displayed
it just shows the picture frame with the red x on it.

please help me to clarify what im doing wrong
and please excuse my poor english

Charles
08-05-2004, 06:19 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Style-Type" content="text/css">
<title>Example</title>
</head>
<body>
<iframe src="cgi-bin/counter.exe"><a href="cgi-bin/counter.exe">Counter</a></iframe>
</body>
</html>

terrakota
08-05-2004, 04:54 PM
great!
thanks a lot