/    Sign up×
Community /Pin to ProfileBookmark

Securing Scripts outside of document root

I have read that it is a good idea to protect your processing scripts outside of the document root. Okay so once you do that how to you submit forms to their processing scripts if they are contained in a directory outside of the document root?

I am playing with the php include and require function to include .inc and .tpl files that are contained in directories that are outside of the documet root into the main webpages that are IN the document root. This is working fine in, but i still I am not sure how to get forms to submit to the proper scripts.

I tried something like this :
<form action=”../scripts/processor.php”>

dont laugh, lol. obviously this didnt work to well plus anyone viewing my source code knows that I am I trying to access files outside of the document root.

i thought about mirroring the externals script directory in the document root and then use and include to call the external processing script, but this seems a bit redundant.

So if any of you wonderful experience programers have any ideas, they would be greatly appreciated.

Oh one more thing I work on a share server through cpanel so I have no direct access to the httpd.config file but i do have access to the .htaccess file

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogNov 12.2009 — The form will have to submit to some file that is accessible via HTTP, i.e. it is within the document root directory tree; there's really no way around that. Any files included/required by that file, however, can be anywhere in the file system as long as it's readable by the main script.
×

Success!

Help @webmaster54880 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...