Re: question about direct access to url

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

 



Hi,

for 1. check for $_POST var in thankyou.php.
for 2. exclude your system by checking for SERVER _NAME or passing a var 
through query string to authenticate yourself, like 
thankyou.php?who=sudhakar

if($_POST or $_SERVER['SERVER_NAME']=="localhost" or 
$_GET['who']=='sudhakar')
{
//-----processing
}
else
{
echo 'No direct access allowed.'.hyperlink('Click here', 'form.php').' to 
go back';
}

3. in .htacces specify this for 404

ErrorDocument 404 ErrorPages/<error_page>.php

Regards,
Manda Krishna Srikanth
http://www.krishnasrikanth.com

php-objects@xxxxxxxxxxxxxxx wrote on 03/21/2008 05:03:45 AM:

> 
> my question is about displaying a friendly message when someone
> directly types a url in the browser. example i have one file 
> 
> called form.php which processes the information entered in the form
> and lets say the next page is 
> thankyou.php?firstname=david by seeing the url if someone types
> thankyou.php?firstname=smith in the address bar the browser 
> 
> will display smith.
> 
> 1. so if a user enters a url in the browser directly to a specific
> page("thankyou.php") i would like to display a message 
> 
> like = "Direct access to this file is not allowed"
> 
> 2. with the above method assuming even if i type thankyou.php in the
> browser directly, though i own the file i will also get 
> the message "Direct access to this file is not allowed". so i would
> not like to see this message, i guess for this i need to 
> 
> specify my IP address i suppose.
> 
> 3. also if a user by mistake types the wrong url directly in the
> address bar ex= www.website.com/abou.php instead of 
> typing www.website.com/aboutus.php instead of the browser displaying
> File not found or a 404 error message i would like to 
> display a customized page which will still have the same look and feel
> of my website in terms of the layout and i would like 
> 
> to display a message such as = "Page could not be found" Does this
> have to be done from apache perspective or can it be done 
> using php. please suggest the procedure in either case apache OR php.
> 
> please advice.
> 
> thanks.
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you




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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux