redirecting

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

Post Reply
enemeth
Forum Commoner
Posts: 66
Joined: Tue Mar 27, 2007 8:55 am

redirecting

Post by enemeth »

Hi there got this error

Warning: main(/checkuser.php): failed to open stream: No such file or directory in /home/www/thetruthdiscovered.com/members/aboutus.php on line 2

now the checkuser.php file is located in the root directory , http://www.thetruthdiscovered.com

how do i indicate the location of the file in my .php file 'checkuser.php' ?

Thank you

Elaine
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

By editing line 2 to point wherever aboutus.php is? :?:
enemeth
Forum Commoner
Posts: 66
Joined: Tue Mar 27, 2007 8:55 am

Post by enemeth »

the checkuser.php is in the main directory ,

not in the members area which is a folder within the main root
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

I hope you're not asking how to reference a file in a higher level folder. I say that only because it's something that any entry level course teaches on day two. Any programmer should be expected to know such basic things like this.

../filename
enemeth
Forum Commoner
Posts: 66
Joined: Tue Mar 27, 2007 8:55 am

Post by enemeth »

yea i am , actually , never took a course , and am learning this as i go along , i created three webpages so far and it is working out great ! i am learning alot as i go along,

i no how to reference other pages , i aint that dumb, but it was just that i was in a higher folder hierachy and it would direct it back to the lower one i thought i was typing something wrong,

mindu ,

thank you for helping

Elaine
nitrino
Forum Newbie
Posts: 10
Joined: Tue Jan 02, 2007 10:22 am
Location: Riga, Latvia

Post by nitrino »

i always use this:

Code: Select all

define('ROOT',$_SERVER['DOCUMENT_ROOT']);
and anywhere...

Code: Select all

include ROOT.'/folder/something.php';
never have a problems with including files.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

You could also use:

Code: Select all

<?php
define('PAGEROOT', dirname(__FILE__) . '/');
?>
Post Reply