Solved

a background image

Posted on 2000-05-05
10
232 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 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
This article will show, step by step, how to integrate R code into a R Sweave document
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

623 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