Jump to content

i have trouble w/ the whole require thing


MrRay

Recommended Posts

[code]
<html><body>
<?php
require('top.inc');
require('menu2.inc');
?>


    <div id="main" class="hideMe">
    <span class="content_header"><?php echo "$select_name" ?></span>
        <div class="content_box">



<?php
mysql_connect('localhost', 'asdfasdf', 'asdfasdf');
mysql_select_db('dbname');

$sql = "SELECT item_number, year, materials, dimensions, location, cost, misc
        FROM items
        ORDER BY area, locname";
$res = mysql_query($sql) or die(mysql_error());

$count = 0;
while (list ($i, $y, $m, $d, $l, $c, $misc) = mysql_fetch_row($res)) {
     echo "<div class='pic'><img src='$i'><br class='item'/>$y<br class='item'/>$m<br class='item'/>$d<br class='item'/>$l<br class='item'/>$c<br class='item'/>$misc</div>\n";
     if (++$count % 4 == 0) {
         echo "<br class='item'/>\n";
     }
}
echo "<br/>\n";
?>


        </div>
    </div>


<?php
require('content.inc');
require('footer.inc');
?>
</body></html>
[/code]

what is keeping this from working?
Link to comment
Share on other sites

the parts I am concerned about are where it has

[code]
<?php

require('whatever.inc')

?>
[/code]

and it won't do anything with it. i don't understand why it won't load the parts im telling it to for the page
Link to comment
Share on other sites

i figured it out, for some reason my DOCTYPE in the file top.inc was stopping the page from being loaded, it may have been the part with the <?xml (whatever i put there) ?> tag for formatting and stuff. Im pretty sure it was that actually.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.