a background image

How can I put a background image to my results page in a C++ cgi application?
milalikAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
mouattsConnect With a Mentor Commented:
When you output the body statement simply add the bacjground attribute ie

cout << "<BODY BACKGROUND=\"myimage.jpg\">";

0
 
milalikAuthor Commented:
that doesn't work
0
 
milalikAuthor Commented:
opps gave you the points any ways
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
mouattsCommented:
Well it should. Can you put the rest of you code here
0
 
milalikAuthor Commented:
The code is big. You still want me to paste it here?Is from a project I made.
0
 
mouattsCommented:
Well cut and paste the bit before the body statement to just after it.
0
 
milalikAuthor Commented:
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"];
0
 
mouattsCommented:
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\">";



0
 
milalikAuthor Commented:
okay I'll try it and let you know
0
 
mouattsCommented:
Whoops a double double quote sneeked in there it should read
cout << "<HTML><HEAD></HEAD><BODY BACKGROUND=\"myimage.jpg\">";





0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.