milalik
asked on
a background image
How can I put a background image to my results page in a C++ cgi application?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
opps gave you the points any ways
Well it should. Can you put the rest of you code here
ASKER
The code is big. You still want me to paste it here?Is from a project I made.
Well cut and paste the bit before the body statement to just after it.
ASKER
clock_t startsort,endsort;
double total;
cout << "Content-type: text/html\n\n"; // because we will generate HTML
cout << "<HTML><HEAD></HEAD><BODY> "; // start of the HTML page
Cgi *input = new Cgi();
try
{
input = new Cgi();
}
catch (Cgi::CgiException& e)
{
cerr << "Error while decoding" << endl << "(maybe called from command-line?)." << endl;
// do some other error processing
}
// here: instead of using cin, now you read from the form
// LOOK at the access to input[]: IT MEANS THAT THE VARIABLE NAME IN FORM.HTML IS "town"
string townName = (*input)["town"];
double total;
cout << "Content-type: text/html\n\n"; // because we will generate HTML
cout << "<HTML><HEAD></HEAD><BODY>
Cgi *input = new Cgi();
try
{
input = new Cgi();
}
catch (Cgi::CgiException& e)
{
cerr << "Error while decoding" << endl << "(maybe called from command-line?)." << endl;
// do some other error processing
}
// here: instead of using cin, now you read from the form
// LOOK at the access to input[]: IT MEANS THAT THE VARIABLE NAME IN FORM.HTML IS "town"
string townName = (*input)["town"];
Try this and make sure that the image is in the same directory as the the CGI and if that doesn;t work put it in the root directory. The reason for the difference is that some servers make the CGI containing the directory the Base whilst others leave it at the root or referrer directory.
cout << ""<HTML><HEAD></HEAD><BODY BACKGROUND=\"myimage.jpg\" >";
cout << ""<HTML><HEAD></HEAD><BODY
ASKER
okay I'll try it and let you know
Whoops a double double quote sneeked in there it should read
cout << "<HTML><HEAD></HEAD><BODY BACKGROUND=\"myimage.jpg\" >";
cout << "<HTML><HEAD></HEAD><BODY BACKGROUND=\"myimage.jpg\"
ASKER