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.
 
 
Start new topic
Replies (1 - 4)
heyo-captain-jac...
post Aug 16 2009, 02:22 AM
Post #2


/人◕‿‿◕人\
*******

Group: Official Member
Posts: 8,283
Joined: Dec 2007
Member No: 602,927



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
post Aug 16 2009, 02:24 AM
Post #3


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

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



This is the line, for those who are morons:
CODE
onfocus=\"this.select();\"><?include('FILENAME.php'); ?></textarea>"
 
Mikeplyts
post Aug 16 2009, 03:11 AM
Post #4


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

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



D'OH! Never mind, I figured it out. Please close this topic. Thanks. _smile.gif
 
jiyong
post Aug 16 2009, 03:17 AM
Post #5


사랑해 ~ 我愛你 ♥
*****

Group: Design Staff
Posts: 825
Joined: Jan 2007
Member No: 492,587



Topic closed and moved.
 

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