Jump to content

Archived

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

MrRay

i have trouble w/ the whole require thing

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?

Share this post


Link to post
Share on other sites
What's it suppose to do? Do you have a test URL where it can be seen in action. What is the script doing?

Ken

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

×

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.