Help - Search - Members - Calendar
Full Version: Load a PHP include inside a PHP Query String
Forums > Resource Center > Webmasters' Corner > Webmasters' Corner Resolved Topics
Mikeplyts
Ok, so I was making some adjustments, and I came into a problem.


I want to load a PHP include that I defined inside a textarea, but the problem is that it won't load when I put it into a specified query string. Look:
CODE
<?php
    if ( isset( $_GET['id'] ) ){
        $page = $_GET['id'];
    }
    if ( empty( $id ) || $id == '' || $id == '0' ){
        echo "Content";
    } else if ( $id == '1' ){
        echo "<textarea style=\"width:350px; height:80px; overflow:auto;\" onfocus=\"this.select();\"><?include('FILENAME.php'); ?></textarea>";
    } else if ( $id == '2' ){
        echo "Content";
    } else {
        echo "Error, please go back.";
    }    
?>

Alright, on Line 9, you'll see I used the PHP include code so I could display the contents of another page into that query string. For some reason, it won't load though, and it won't load even without the textarea tags. I tried adding the little php suffix after the "?" on that line, and still nothing. Help! sad.gif


Also, could I include to another page that has another query string withing it, like if I were to replace "FILENAME.php" with "FILENAME.php?id=1"? Thanks.
wwwww
This thread is now a petition to get the code tag changed so it has numbers next to each line. All in favor, say "penis"
Mikeplyts
This is the line, for those who are morons:
CODE
onfocus=\"this.select();\"><?include('FILENAME.php'); ?></textarea>"
Mikeplyts
D'OH! Never mind, I figured it out. Please close this topic. Thanks. _smile.gif
jiyong
Topic closed and moved.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.