dean7 Posted November 29, 2010 Share Posted November 29, 2010 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) Quote Link to comment Share on other sites More sharing options...
intellix Posted November 29, 2010 Share Posted November 29, 2010 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? Quote Link to comment Share on other sites More sharing options...
dean7 Posted November 29, 2010 Author Share Posted November 29, 2010 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 Quote Link to comment Share on other sites More sharing options...
intellix Posted November 29, 2010 Share Posted November 29, 2010 Make sure everywhere that you are including the functions.php file its only included once... using something like: include_once 'functions.php'; When its included twice then functions are trying to be declared twice Quote Link to comment Share on other sites More sharing options...
dean7 Posted November 29, 2010 Author Share Posted November 29, 2010 Make sure everywhere that you are including the functions.php file its only included once... using something like: include_once 'functions.php'; When its included twice then functions are trying to be declared twice Thanks that worked Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.