Welcome! Log In Create A New Profile

Advanced

Displaying the source code

Posted by MOKIRI 44083033 
Announcements Last Post
Announcement myUnisa availability 21 to 24 March 2019 03/17/2019 02:24PM
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Displaying the source code
February 15, 2012 12:32PM
Im struggling to display the source code of my pages in text format although i used a .txt(dot text) file extention on my link it still displays in html format.
Re: Displaying the source code
February 15, 2012 01:55PM
what URL is displayed when you click on the link?

***Lets go back to my place and I will show you my source code***
Re: Displaying the source code
February 15, 2012 03:02PM
@Mokiri

I also had similar problem and searched the web for clues. Apparently there are some tags you have to include in your code.
Tip: The tags have a opening < > and closing </ >.
Re: Displaying the source code
February 15, 2012 03:55PM
It displays the correct URL e.g. escape.txt but everything in html formal, and thanx for the tip cliff.
Re: Displaying the source code
February 16, 2012 03:32PM
When you click on the link it should be displayed in another browser window so it is in HTML format but because you saved the source as a text file it will show your php code as well. Remember if you view source code from the browser it shows all the html but not the php...does yours do this?

When I click on my link it does not pop-up as a "text file" it its is displayed in another browser window with the contents of the text file...Does this make sense?

Sounds to me like you doing the right thing or im misunderstanding your problem

***Lets go back to my place and I will show you my source code***
Re: Displaying the source code
February 17, 2012 09:06AM
I get your point Imtiyaaz maybe i don't understand the question but in my case the problem is that it displays the HTML format of the source instead of the source code for example when i code a table it displays the table rather than the source code of that table although it is saved in txt format.
Re: Displaying the source code
February 17, 2012 09:56AM
Mokiri,

Follow up on the tip Cliff gave you and youre problem will be solved.

I had exactly your problem, and figured there must be some info on the web, started googling and bobs your uncle smiling smiley

---------------------------------------------------------------------
Live life...
---------------------------------------------------------------------
Re: Displaying the source code
February 17, 2012 10:54AM
Yes, google is your best friendsmile

***Lets go back to my place and I will show you my source code***
Re: Displaying the source code
February 21, 2012 10:53AM
Thanx a lot guys, Google really is a reliable friend smileys with beer
Re: Displaying the source code
February 22, 2012 02:11PM
Guys is there any other useful
resource, I have the same problem
and I can't seem to find help on google sad smiley
Re: Displaying the source code
February 23, 2012 08:46AM
Try different search titles and make sure they related to your problem, do not expect to find a straight answer straight away when you do a research remember google is a search engine and it will display many results relating to your title. jst keep on trying you will find it eventually.
Re: Displaying the source code
February 23, 2012 11:03AM
Thanks Mokiri - I'll keep on searching
Re: Displaying the source code
February 27, 2012 01:26PM
Mac, must the html code also be displayed in the text file
or only the PHP code?
Re: Displaying the source code
February 27, 2012 03:01PM
@45159920 Ntsiki

Your question has been answered here:
http://osprey.unisa.ac.za/phorum/read.php?698,161272
(scroll down a bit, to where I asked the same thing)

---------------------------------------------------------------------
Live life...
---------------------------------------------------------------------
Re: Displaying the source code
February 27, 2012 06:03PM
Thanks Bokkie

I'm struggling to display the html code though,
php displays correctly but the html
tags are interpreted by the browser thus displaying
what's intended by the tags and not the code.
Is there something that I'm doing wrong?
avatar
Mac
Re: Displaying the source code
February 28, 2012 10:29AM
If I do not understand the problem. A text file, saved as file.txt will not be interpreted by the browser, so it will show the PHP and HTML code as is.

Here is a text file with PHP and HTML code, saved as code1.txt
Re: Displaying the source code
February 28, 2012 10:30AM
I had the exact same problem, thats why I also asked if just displaying the php code was sufficient.

But I solved that issue by finding tags that will display all the html code as well as php. Just using google actually gave me a few different ways of doing it!

You just need to be patient and dig a bit, spend some time reading other forums. This will also be a line of help in the IT world out there smiling smiley

---------------------------------------------------------------------
Live life...
---------------------------------------------------------------------
Re: Displaying the source code
February 28, 2012 10:35AM
mmmmm....

Now I am starting to wonder if different browsers and versions thereof display or not display code from a text file differently.... It seems like some of us have issues but found ways to solve it but others are fine.

.....? smiling smiley

---------------------------------------------------------------------
Live life...
---------------------------------------------------------------------
Re: Displaying the source code
February 28, 2012 01:39PM
@Bokkie_
I know what you mean, haha.. The problem
took so much of my time, but it was worth
learning other stuff.

@Mac
@Bokkie
Thanks guys, Mozilla works just fine.
Re: Displaying the source code
February 28, 2012 09:20PM
There are many ways to display text files in general and i used an old html trick to display my coding.
My question is as long as it displays the coding of text in a separate window will that be ok?
Or have i gone over my head.......again LOL
Sorry, you do not have permission to post/reply in this forum.