Jump to content

Integrate an "include" into html that is already generated by php


kayla2009

Recommended Posts

Am Beginner .. and i tried the whole day to find the mistake on this:

while($h_rec = mysqli_fetch_assoc($abfrage)){
                             echo '<tr class="zeile">';
                                echo '<td class="zelle01"><a href="'
                                      .$h_rec['h_url'].
                                      '">'
                                      .$h_rec['h_name']
                                      .'<div id="sites_frame">'
                                          .'<?php include "sites.php"; ?>'                      
                                     
                                      .'</div>'
                                      .'</a></td>';
                                echo '<td class="zelle02">'.$h_rec['h_lang'].'</td>';
                                echo '<td class="zelle03">'.$h_rec['h_filesize'].'</td>';
                                echo '<td class="zelle04">'.$h_rec['h_expire'].'</td>';
                                echo '<td class="zelle05">'.$h_rec['h_freespeed'].'</td>';
                                echo '<td class="zelle06">'.$h_rec['h_year'].'</td>';
                                echo '<td class="zelle07">'.$h_rec['h_vote'].'</td>';    
                                echo '<td class="zelle08">Add shit</td>';                
                            echo '</tr>';
                            
  the "include "sites.php" simply doesnt work ...  i can see the pop up, that is a by the ID "sites_frame" hidden block .. but he wouldnt show me whatever i have hidden in the include
for testing i just wrote : 

<?php
echo 'test';
 ?>

into the site.php that should be called.

 

please help !!!!                         
                    
                    }

You are echoing the include, don't.  Try this:

                                echo '<tr class="zeile">';
                                      .'<td class="zelle01"><a href="'
                                      .$h_rec['h_url'].
                                      '">'
                                      .$h_rec['h_name']
                                      .'<div id="sites_frame">';
                                       include "sites.php";
                                       echo '</div>'
                                      .'</a></td>';

Also, thats a mess.  You could include all that repeatable code in the include.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.