what is the PROBLEM with this CODE?

Discussion in 'PHP' started by raahatazim, Aug 5, 2007.

  1. #1
    <?php
    $html = '
    <html>
    <head>
    <title>test</title>
    </head>
    <body>
    <p>paragraph</p>
    </body>
    </html>';

    $tidy = tidy_parse_string($html);

    $body = tidy_get_body($tidy);
    echo $body->value;
    ?>
     
    raahatazim, Aug 5, 2007 IP
  2. picobello

    picobello Well-Known Member

    Messages:
    572
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    110
    #2
    What error msg do you geT?
     
    picobello, Aug 5, 2007 IP
  3. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #3
    Tidy functions are only available in PHP5. I presume your web host only supports PHP4?
     
    krt, Aug 5, 2007 IP
  4. raahatazim

    raahatazim Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Krt.....i m using php5
     
    raahatazim, Aug 5, 2007 IP
  5. raahatazim

    raahatazim Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    picobello.......no error message i get.......it doesnt print anything,though it is supposed to print the BODY part
     
    raahatazim, Aug 5, 2007 IP
  6. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #6
    Check phpinfo() for Tidy support
     
    krt, Aug 5, 2007 IP
  7. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Shouldn't the last line just be
     
    matthewrobertbell, Aug 5, 2007 IP
  8. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #8
    matthewrobertbell, $body is an object.

    raahatazim, was that the problem, Tidy not being installed?
     
    krt, Aug 7, 2007 IP