background image not loading in newly thrown html page by shell script

I m trying to throw back html page when a file is found.While throwing back html page, the background image is not coming. I am using Apache server.Please suggest how to resolve...
#!/bin/ksh
echo -e "Content-type: text/html\n\n"
echo "<html><head></head><body background=\"/asc/ppp.jpg\">"
echo "<center><h2> The File name with" echo $QUERY_STRING echo "is found </h2> </center>"
echo "</body></html>" exit 0

please suggest something, I googled lots of time but nothing happened...

Please don't bump up the posts - it's against the Forum rules.

Do you call this as a CGI script? Or are you just generating a static HTML file? Does the background image exist? Can the server locate it at the specified path? Does the web server have read access to the file? Could you properly format your code and put it in

```text
 and 
```

tags for readability?

yes I am calling this as a CGI script, this script runs when an html form submit the values using get method, then after submitting this script runs and get the value from form and then html page is created. Background image do exist and web server can read it... but when html page gets created its background image is not coming..

dear vgresh99,
I am a new member in future I would not send such mails sorry for that

So when you call the background image directly in the browser it shows?

Are there any errors/messages when you call your script directly, or in Apaches error_log?

[Wed Apr 29 06:25:06 2009] [error] [client 130.20.144.17] (8)Exec format error: exec of '/home/edi/apache_2.2.4/cgi-bin/ppp.jpg' failed, referer: Domain Acquisition Service-Sedo.com

This error is coming ...its from error logs

On directly accessing the image from browser the image does not appear.

This tells me 2 things:

  1. Your webserver tries to execute your image as if it were a CGI script/executable
  2. Your HTML page looks for the image in /cgi-bin/ppp.jpg, not in /asc/ppp.jpg as you originally posted.

Check if you've put the files in the correct locations, using correct permissions.

I couldnot understand your first point but as far as second point is concerned, I had given /asc/ppp.jpg as an example... actually my html form takes the image from /cgi-bin/ppp.jpg...

The problem is that when the script is running it is throwing a page back to the client as response and in that response the background image is not coming.
Thank you.

Yes, you said that in all your previous posts. And giving an example is nice, except if the original path is, as in your example, part of the problem.

The /cgi-bin path is (Apaches) default path for CGI scripts. Any file in there with the executable bit set is considered a runnable. An image is never runable, but the webserver tries nonetheless and fails, generating a line in the error_log.

Remove the executable bit from the file, move it to an appropriate location (say... /images), adapt your script to use the correct path, and everything should work.

I got your point... now after changing the path I have got the image now in the background...
Thank you