Re: PHP and Apache configuration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 19, 2009 at 11:28 AM, R B <rbpphp@xxxxxxxxx> wrote:

> Hello,
>
> I need that every time someone access one image file in my server, then
> redirect to a php file.
>
> I make this well with:
>
> Redirect 301 imagefile.jpg scriptfile.php
>
> But i need that the file scriptfile.php can only be accessed by this
> redirect command.
>
> If someone try to access directly from the url
> http://www.mydomain.com/xyz/scriptfile.php, i want to send an error
> access.
>
> I tried with:
>
> <Files scriptfile.php>
> Order allow,deny
> Deny from all
> </Files>
> But with this configuration, the redirect command cant access the
> scriptfile.php
>
> Do you have the solution for this?
>
> thanks.
>

You could use sessions. Start a session and set a redirect true variable of
some sort.


<?php
session_start();

//image script

$_SESSION['redirect'] = true;

//image redirect here.
?>

<?php
//scriptfile.php
if($_SESSION['redirect']){

//do your stuff.
unset($_SESSION['redirect']);

} else {

echo 'error';

}
?>

Get the idea?

-- 
Kyle Terry | www.kyleterry.com

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux