Inserting PHP script - as code text

Discussion in 'HTML & Website Design' started by TodaysCreators, Sep 22, 2008.

  1. #1
    I want to be able to insert some PHP script into an HTML page - - as code text (I don't want it executing).

    This is the code:
    <code><script src="http://feeds.feedburner.com/museum-tracker/nZZW?format=sigpro" type="text/javascript" ></script ></code>

    I'ce tried the code, tt and pre tags, all to no avail.

    Thanks,
    David Berghouse
     
    TodaysCreators, Sep 22, 2008 IP
  2. DesignSamples

    DesignSamples Banned

    Messages:
    170
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <pre> PHP CODE </pre>

    :)
     
    DesignSamples, Sep 22, 2008 IP
  3. TodaysCreators

    TodaysCreators Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I've already tried the pre tag and it does not work.
    The script executes, rather than displays.

    However, I have subsequently discovered that by using characters entities and replacing the < with & # 60 ; and the > with & # 62 ; I could make the script display without executing.

    Note: remove the spaces within the character entities above, otherwise this post will display the bracket character, rather that its character entity.

    David Berghouse.
     
    TodaysCreators, Sep 22, 2008 IP
  4. skateme

    skateme Peon

    Messages:
    162
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You have to use special characters if you want to display <, >, etc. Google "html numbers" for the HTML numbers on special characters.

    Try this:

    
    &lt;script src=&quot;http://feeds.feedburner.com/museum-tracker/nZZW?format=sigpro&quot; type=&quot;text/javascript&quot; &gt;&lt;/script&gt;
    
    Code (markup):
     
    skateme, Sep 22, 2008 IP
  5. TodaysCreators

    TodaysCreators Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks, I co-incidentally discover this as you were obviously typing your post !
    David Berghouse
     
    TodaysCreators, Sep 22, 2008 IP