Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End echo contents from echo on another page

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #195167
    bearhead
    Participant

    ok, so I have a bit of an odd situation:

    I have three php documents: names.php, project_data.php, and template.php.

    What I’m trying to do is echo the contents of a div in names.php into a div in project_data.php, and then echo that content again into template.php.

    In order echo the contents of a specific div, I’m using this php:

    <?php
    $content = file_get_contents('FILE LOCATION');
    $first_step = explode( '<div id="DIV ID">' , $content );
    $second_step = explode("</div>" , $first_step[1] );
    echo $second_step[0];
    ?>
    

    The content from names.php is being successfully echoed into project_data.php. The issue is that when I try to echo that content from project_data.php into template.php, the literal php code gets echoed out instead of the content.

    Its like when I’m looking at template.php, the php in project_data.php isn’t running and it’s just being treated like a text string or something? Maybe

    explode()
    

    has something to do with it?

    #195170
    Tom
    Participant

    It’s really hard to diagnose without seeing the rest of the code.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.