Re: Redirect direct calls to a script?



Daniel wrote:
On Tue, 12 May 2009 23:05:23 -0400, Jerry Stuckle
<jstucklex@xxxxxxxxxxxxx> wrote:

Daniel wrote:
On Sun, 10 May 2009 00:36:17 +0200, "Samuel van Laere"
<info@xxxxxxxxxxx> wrote:

I'm not sure if this a PHP or .htaccess job.
But how can I prevent direct calls with or without parameters?
Well perhaps I can't prevent them, but how could I print a error
or redirect to some other page if someone would call a page directly?

thanks in advance.
Samuel

what do you mean "parameters" - if it is about the fact that some
required parameters are missing from the url, then retrieve the values
with $_REQUEST['param_name'] etc, then do some validation and if does
not click, do whatever it takes - either show some error or redirect;

it is a php stuff.

Daniel
$_REQUEST is not a good thing to use. You never know where the value is coming from. If the form is posted, you should use $_POST. If it's a get request, you should use $_GET.



Why would you need to know where it comes from? Regardless where the
param comes from, the business flow is the same...





Because some hacker can more easily screw up your site. Of course, if security isn't important to you, the by all means, keep using $_REQUEST.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages