Link to home
Start Free TrialLog in
Avatar of blaaze
blaaze

asked on

default background for image

hi am using cpanel
i need to tweak my site
if anyone opens a text file on my host
http://www.abc.com/a.txt
then it must load a background image by default
Avatar of HainKurt
HainKurt
Flag of Canada image

I could not get what you are trying to do... need more explanation...

Avatar of blaaze
blaaze

ASKER

see we have files on our host, all our files are .txt files only

when ever user tries to open a text file, it should open text file and it should also display a background image behind the text, and note the url should not be changed, it should be as same as a text file's url
what I am thinking is this...

user clicks a.txt
on server it cannot find it, and page is transferred to your custom error page say txt.asp (url stays as a.txt)
thir txt.asp does this

<html>
<head>a.txt</head>
<body background="someimage.jpg">
<pre>
<%= getFile(fname) %>
</pre>
</body>
</html>

where fname will be a.txt (you can get it from request url) and getFile is a function which reads a.txt from your server and returns content...
Avatar of blaaze

ASKER

can you give the working code if possible
and try to give in php if possible
I am not expert on PHP / Apache...

you need to set your web server to handle txt file and redirect to a txt.php page
you need a function getFile(fName) to read fname file and return the content
you need another function to extract a.txt from current request url, www.domain.com/a.txt (this part is easy)

after these pieces put together you will have what you want...
Avatar of blaaze

ASKER

anyone else want to help in php can help me now, its very urgent
ASKER CERTIFIED SOLUTION
Avatar of Dean OBrien
Dean OBrien
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of blaaze

ASKER

the server must be configured to open the text file with an image
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.