Page 1 of 1

[SOLVED] Include_path - How?

Posted: Wed Jun 30, 2004 10:26 am
by nikkelei
Ok, I've got a problem.....

I have a login and password screen. When I try to include a Htm file in my php the server can't read the file. It works fine on my localhost, but when I upload it to the server I get problems. I think that I will have to use "include_path" somehow, but I can't figure out how. You can see the script in question and the errormessage below. Locally I use PHP 4.0.4pl1

Code: Select all

<?php

$username=$HTTP_POST_VARS['username'];
$password=$HTTP_POST_VARS['password'];


$adminusername="Bob";
$adminpassword="1";
echo "$username<br>";
echo "$password<br>";
echo"hello";
$username=strtolower($username);


// check the username and quit if it doesn't match

if ($username !=$adminusername || $password !=$adminpassword) {
		print "Username or password not valid.....Try again!!";
		exit;
	} else {
		include("admin.htm");
		exit;
}

?>
The errormessage I get is as follows:

Warning: main(admin.htm): failed to open stream: No such file or directory in /customers/hanspetur.net/hanspetur.net/httpd.www/Admin_login.php on line 21

Warning: main(): Failed opening 'admin.htm' for inclusion (include_path='.:') in /customers/hanspetur.net/hanspetur.net/httpd.www/Admin_login.php on line 21

Any clue?

Bech100 | Please use

Code: Select all

tags when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Wed Jun 30, 2004 10:34 am
by DaiWelsh
Is the file admin.htm on the server in the same directory as the php script? Does it have the right name, including case. I will take a stab given that your php page is called "Admin_login.php" that the htm might be called "Admin.htm" ? If so that will work on Windoze where file names are not case sensitive but not on Linux where they are. If that does not help, what permissiions are set on the admin.htm, maybe it cannot be opened (doubtful for read though).

HTH,

Dai

You're right....

Posted: Wed Jun 30, 2004 11:43 am
by nikkelei
It works. It was just a case of "case sensitiviness". Thanks!!

Posted: Thu Jul 01, 2004 4:21 pm
by nikkelei
And nice cat by the way......