Jump to content


Photo

i have trouble w/ the whole require thing


  • Please log in to reply
3 replies to this topic

#1 MrRay

MrRay
  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationOtis, MA

Posted 19 June 2006 - 06:59 PM

<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>

what is keeping this from working?

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 19 June 2006 - 07:06 PM

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

#3 MrRay

MrRay
  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationOtis, MA

Posted 19 June 2006 - 07:09 PM

the parts I am concerned about are where it has

<?php 

require('whatever.inc')

?>

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

#4 MrRay

MrRay
  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationOtis, MA

Posted 21 June 2006 - 02:02 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users