Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8

Thread: Code as Text

  1. #1
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    i am having a problem of displaying code on the page as text (never done it before)

    i tried the <code></code> tags + using &lt; etc. but they didn't work

    it is in a .php document by the way just in case that matters
    JR

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    is that the only way to do it? seems a bit complicated for such a simple thing...

    all i want to do is display some html code for a 'link to us' section
    JR

  5. #4
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    1. Put it in a <pre> block (or a textarea which is easier to copy)
    2. Convert < to > to entities
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  6. #5
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    thanks
    JR

  7. #6
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    the pre way didn't work in my .php document but it did in a .html file with nothing in it

    i am just doing it like here with the <b></b> tags until i find a solution
    JR

  8. #7
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    The best way to display code is using the <XMP> tag, which is made for displaying code "examples". It ignores everything, including html tags in between the <XMP> tags.

  9. #8
    Senior Member assassingod's Avatar
    Join Date
    Nov 2002
    Posts
    112
    Member #
    307
    The only bad thing about <XMP> is you can barely read it and it adds <br /> tags to the top and bottom of your code (iirc anyway)
    assassingod - vB.org Moderator :ichatsmile:


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:00 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com