PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
gaogier
Forum Contributor
Posts: 391 Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:
Post
by gaogier » Tue Feb 07, 2006 9:21 am
this php code is not working
Code: Select all
<?php
include_once ('header.inc');
?>
even if i add the
http://www.runehints.com/header it dont work
but it works if its on the same directory, anyone know a way i can get around this?
malcolmboston
DevNet Resident
Posts: 1826 Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK
Post
by malcolmboston » Tue Feb 07, 2006 9:23 am
ive always used relative filepaths,
for eg
Code: Select all
// directory above
require ('includes/header.php');
//directory below
require ('../header.php');
use require, your script will die if its not found
gaogier
Forum Contributor
Posts: 391 Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:
Post
by gaogier » Tue Feb 07, 2006 9:33 am
ok....none of this is working
malcolmboston
DevNet Resident
Posts: 1826 Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK
Post
by malcolmboston » Tue Feb 07, 2006 9:34 am
try
Code: Select all
error_reporting(E_ALL);
// directory above
require ('includes/header.php');
//directory below
require ('../header.php');
what does it say?
also check file / folder permissions
gaogier
Forum Contributor
Posts: 391 Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:
Post
by gaogier » Tue Feb 07, 2006 9:38 am
nothing, it says nothing, and i dont have a clue why
its like php dosent work on it
malcolmboston
DevNet Resident
Posts: 1826 Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK
Post
by malcolmboston » Tue Feb 07, 2006 9:41 am
in the include file put this
Code: Select all
print "I have succesfully loaded the include file";
does it print?
gaogier
Forum Contributor
Posts: 391 Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:
Post
by gaogier » Tue Feb 07, 2006 9:45 am
you mean dose it show? no
malcolmboston
DevNet Resident
Posts: 1826 Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK
Post
by malcolmboston » Tue Feb 07, 2006 9:49 am
hmm not really to sure where to go from here.....it is highly unlikely to be the case but have a check on 'open_basedir'
also are you absolutely sure that nothing it being executed before this? IE no db calls no session_start(), absolutely nothing
also view source and list whats there
gaogier
Forum Contributor
Posts: 391 Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:
Post
by gaogier » Tue Feb 07, 2006 9:56 am
the php code is there, but it works on another directorys
malcolmboston
DevNet Resident
Posts: 1826 Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK
Post
by malcolmboston » Tue Feb 07, 2006 9:59 am
have you checked file permissions?
gaogier
Forum Contributor
Posts: 391 Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:
Post
by gaogier » Tue Feb 07, 2006 10:00 am
yeap, al the permisions are the same
gaogier
Forum Contributor
Posts: 391 Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:
Post
by gaogier » Tue Feb 07, 2006 10:05 am
ok, all has suddenly started to work, i dont understand why, but atleast its working
got a few errors, as its now in a different place, is there a way i can fix all the errors without having to change the code
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Feb 07, 2006 10:08 am
would hlep to know the errors.
gaogier
Forum Contributor
Posts: 391 Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:
Post
by gaogier » Tue Feb 07, 2006 10:16 am
i think its errors where its not connecting to the databases, Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/gaogier/public_html/footer.inc on line 315
but it still works on the root