Link to home
Start Free TrialLog in
Avatar of milalik
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
Avatar of mouatts
mouatts

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of milalik
milalik

ASKER

that doesn't work
Avatar of milalik

ASKER

opps gave you the points any ways
Well it should. Can you put the rest of you code here
Avatar of milalik

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.
Avatar of milalik

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"];
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\">";



Avatar of milalik

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\">";