Page 1 of 1

Displaying Code In New Window - Help

Posted: Sun Feb 26, 2012 5:37 am
by Henry N
Hi,

How do you create a hyper link that opens in another
window and displays your source code in text format??
The following example doesn't work:

<a href="filename.txt" target="_blank" width="600" height="400"> link </a>

The above code doesn't display the source code
It interprets it even though my filename is .txt (dot txt)

Any help will be much appreciated

Re: Displaying Code In New Window - Help

Posted: Sun Feb 26, 2012 4:23 pm
by social_experiment
Strange; the target="_blank" is the correct method for opening a new window in the browser. Do you have an .htaccess file set up; maybe it is causing certain file types to be processed as .php (i'm guessing your refering to php code here)

Re: Displaying Code In New Window - Help

Posted: Sun Feb 26, 2012 4:51 pm
by litebearer

Re: Displaying Code In New Window - Help

Posted: Mon Feb 27, 2012 3:42 am
by Henry N
@social-exp:
What is an htaccess file? I'm relatively new
in this so please bear with me guy..

@litebearer:
Thanks for the link. But now the text file
should be filename.txt (dot txt) - the examples only deal
with .php (dot php) files

Re: Displaying Code In New Window - Help

Posted: Mon Feb 27, 2012 5:05 am
by social_experiment
http://www.javascriptkit.com/howto/htaccess.shtml
This url will explain about .htaccess