Solved

a background image

Posted on 2000-05-05
10
226 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
  • 5
  • 5
10 Comments
 
LVL 11

Accepted Solution

by:
mouatts earned 10 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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 how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

828 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