Here you go.

On 6/28/06, J Siegel <[EMAIL PROTECTED]> wrote:
>
> > OK, session vars will do the trick for you, as will checking that
> > $_SERVER['HTTP_REFERER'] is correct.
> >
> > Try http://dev.danen.org/test/access_test.htm (which is VALID) vs.
> > http://portal.danen.org/access_test.htm which is invalid.
> >
> > If that's what you want, I'll post the code.
> >
>
> That is exactly it.  I tried playing around with $_SERVER[...] but I'm
> messing something up.  If it isn't a problem, I'd love to see the php
> code for your sample.
>
> Thank you so much.  Your suggestions were the perfect thing for where
> I am right now.


access_test.htm:
<?php
echo "<br><br><br><br><p align=center>Testing appropriate
access</p><br><br>" ;
echo "<p align=center><a
href=\"http://dev.danen.org/test/access_called.htm\";>Go
to http://dev.danen.org/test/access_called.htm</a></p>" ;
?>

access_called.htm:
<?php
echo "<br><br><br><br>Testing appropriate access - this is the called
function.<br><br><br><br>";
$ref_page = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] :
"";
echo "Referring page: [$ref_page]<br><br><br><br>";
if ( $ref_page != "http://dev.danen.org/test/access_test.htm"; )
{
    echo "Illegal access of this page" ;
    die();
}
echo "OK access - proceeding";
...
?>


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Great things are happening at Yahoo! Groups.  See the new email design.
http://us.click.yahoo.com/TISQkA/hOaOAA/yQLSAA/CefplB/TM
--------------------------------------------------------------------~-> 

The php_mysql group is dedicated to learn more about the PHP/MySQL web database 
possibilities through group learning.  
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php_mysql/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to