[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 236
  • Last Modified:

a background image

How can I put a background image to my results page in a C++ cgi application?
0
milalik
Asked:
milalik
  • 5
  • 5
1 Solution
 
mouattsCommented:
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
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
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

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now