Best way to generate html code +copy + use for html newsletter???

Discussion in 'PHP' started by 123GoToAndPlay, Jun 28, 2010.

  1. #1
    Hi,

    I am looking for the best way
    - to generate html code from a source file (newsletter_preview.php)
    - display it in a text area
    - hit a button (= copy html code)
    - use for a newsletter

    Any tips?
     
    123GoToAndPlay, Jun 28, 2010 IP
  2. 123GoToAndPlay

    123GoToAndPlay Peon

    Messages:
    669
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    ok php function

    highlight_file

    looks promising. I never used it. will keep you posted

    i do notice echo'ing in a textarea will add
    
    <code><span style="color: #000000">
    ....
    <br /></span>
    </code>
    
    Code (markup):
    how do i remove the added tags??
     
    Last edited: Jun 28, 2010
    123GoToAndPlay, Jun 28, 2010 IP
  3. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #3
    highlight_file() uses span tags to colorize the code, theirfore if you wish to include that within a textarea its not directly possible without retaining the tags produced by highlight_file(), (you could use strip_tags() but that would strip other tags too..)

    However what you could do is use a css to mimic a textareas functionality... (which would mean the code would remain colorized but would only display the code being colorized)
     
    danx10, Jun 28, 2010 IP