[Help,please..] PHP

[Help,please..] PHP

Posted by: kelly88
Posted on: 2006-10-29 00:18:00

Hello, I have some basic php questions.
I tried to call a .php file on my .html file with this code:

<?php include 'abc.php';?>

and here what I put on .htaccess:

AddType x-mapp-php4 .html .htm
AddType x-mapp-php4 .php3


it worked on my other site (on different host). Why I couldn't use that on dreamhost? should I use something like this instead?

<?php Include("abc.php"); ?>


Another question, how can I redirect the non-existing files?
Can I just use something like this on .htaccess?

ErrorDocument 402 http://www.abcdef.com/404error
ErrorDocument 404 http://www.abcdef.com/404error
...


Last question, how can I prevent someone to access to a specific folder (directory) other than setting up a password (i.e., by re-directing to another page)?
For example, if someone try to access directory "abc" instead of asking for username & password, he/she will be re-directed to an existing page (i.e., back to homepage)?

Thanks in advance :)






Re: [Help,please..] PHP

Posted by: rlparker
Posted on: 2006-10-29 01:10:00

Wow. Three issues in one thread smile! Might as well, I suppose, as all can be addressed with a single url:

This Dreamhost Wiki Article on .htaccess has the answers to all of your questions!

(Hint 1: look at AddHandler rather than AddType)
(Hint 2: Search the Wiki for other relevant help)
(Hint 3: Google is your friendwink)

--rlparker

Re: [Help,please..] PHP

Posted by: kelly88
Posted on: 2006-10-30 12:04:00

Thanks much, rlparker! :)

Tags: php file