Log In · Register

 
Load a PHP include inside a PHP Query String, help?
Mikeplyts
post Aug 16 2009, 02:20 AM
Post #1


Mel Blanc was allergic to carrots.
*******

Group: Official Designer
Posts: 6,371
Joined: Aug 2008
Member No: 676,291



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.
 

Posts in this topic


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: