Jump to content

Including files not working


dean7

Recommended Posts

Hi all, I've got two scripts for my website which I would like to display on one page, but what i've got is, The Menu on one php file, and the content on a different php file. Ive tryed the include, include_once, require, require_once, but for which ever one I use it just displace a blank page with nothing on it.

 

Both of the files work on there on, but when I include the menu to the content page it just dont show anything. This is what ive tryed:

 

<?php
include ("crewtop.php");
if ($crewstuff->boss == $username || $crewstuff->coowner == $username || $crewstuff->underboss == $username){
?>
<table width='80%' align='center' class='table' cellpadding='0' cellspacing='0' border='1'>
<tr>
<td class='header' colspan='4' align='center'>Current Crew Members</td>
</tr>
<tr>
<td class='omg' align='center' width='25%'>Username</td><td class='omg' align='center' width='25%'>Rep</td><td class='omg' align='center' width='25%'>Rank</td><td class='omg' width='25%' align='center'>Kick</td>
</tr>

 

This seems a easy thing to sort, just I carnt see why it isnt displaying the other file.. Anyone see why?

 

Thanks.

 

(if more code is needed i'll display more)

Link to comment
https://forums.phpfreaks.com/topic/220138-including-files-not-working/
Share on other sites

I don't think there's anything more to it to be honest... if you use require it should pull up an error when it can't find the file and displays a blank page.. have you tried checking your error logs to see what it says about the require?

I've think I've found what could be the problem, just not sure what todo about it, when I show the Errors, I get an Error saying:

 

Fatal error: Cannot redeclare logincheck() (previously declared in /home/www/*******-*****.com/includes/functions.php:67) in /home/www/*******-*****.com/includes/functions.php on line 75

 

But all that is, is my logincheck to make sure the user is logged in..

 

function logincheck(){
if (empty($_SESSION['username'])){
echo "
<SCRIPT LANGUAGE='JavaScript'>
window.location='index.php';

</script>
";
exit();
}} // Line 75

 

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.