how to remove java script from a page content after using file_get_contents?

Discussion in 'PHP' started by ramysarwat, Apr 5, 2010.

  1. #1
    how to remove java script from a page content after using file_get_contents?
     
    ramysarwat, Apr 5, 2010 IP
  2. Imozeb

    Imozeb Peon

    Messages:
    666
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I can't see your code so the best I can tell you is the simplest solution. Put your Javascript in the body section in a div and if once the code is executed use Javascript or PHP to change the divs contents to empty.
     
    Imozeb, Apr 5, 2010 IP
  3. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #3
    jestep, Apr 6, 2010 IP
  4. thecancerus

    thecancerus Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Either use regex or do simple search and replace in the string.
     
    thecancerus, Apr 7, 2010 IP
  5. ps3ubo

    ps3ubo Peon

    Messages:
    204
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    All you do is replace <script and </script> with a fake name like 'hidescript' so then it will not run the commands.

    Just use this:

     
    ps3ubo, Apr 8, 2010 IP