Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

a background image

Posted on 2000-05-05
10
Medium Priority
?
233 Views
Last Modified: 2013-12-25
How can I put a background image to my results page in a C++ cgi application?
0
Comment
Question by:milalik
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 11

Accepted Solution

by:
mouatts earned 40 total points
ID: 2784635
When you output the body statement simply add the bacjground attribute ie

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

0
 

Author Comment

by:milalik
ID: 2795100
that doesn't work
0
 

Author Comment

by:milalik
ID: 2795109
opps gave you the points any ways
0
Amazon Web Services EC2 Cheat Sheet

AWS EC2 is a core part of AWS’s cloud platform, allowing users to spin up virtual machines for a variety of tasks; however, EC2’s offerings can be overwhelming. Learn the basics with our new AWS cheat sheet – this time on EC2!

 
LVL 11

Expert Comment

by:mouatts
ID: 2795878
Well it should. Can you put the rest of you code here
0
 

Author Comment

by:milalik
ID: 2796969
The code is big. You still want me to paste it here?Is from a project I made.
0
 
LVL 11

Expert Comment

by:mouatts
ID: 2799116
Well cut and paste the bit before the body statement to just after it.
0
 

Author Comment

by:milalik
ID: 2804907
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
 
LVL 11

Expert Comment

by:mouatts
ID: 2806563
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
 

Author Comment

by:milalik
ID: 2807048
okay I'll try it and let you know
0
 
LVL 11

Expert Comment

by:mouatts
ID: 2809072
Whoops a double double quote sneeked in there it should read
cout << "<HTML><HEAD></HEAD><BODY BACKGROUND=\"myimage.jpg\">";





0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question