It's hard to say what you're doing wrong without any code.
Another thing you might consider is to place your php script outside your www folder. That way, nobody can access it from the web using http protocol.
You can then include() the script into your documents.
For this to work, change include_path in your php.ini file to the directory where you placed the php scripts.
Richie.
geocities.com/akindele/