question about direct access to url

This is a discussion on "question about direct access to url" within the PHP Forum section. This forum, and the thread "question about direct access to url are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Mar 20th, 2008, 22:32
Junior Member
Join Date: Dec 2007
Location: auckland
Age: 33
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
question about direct access to url

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Mar 20th, 2008, 22:46
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,265
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: question about direct access to url

you would probably want the forum to be POST. POST data is much harder to forge then GET data. (But it still isn't entirely secure)
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Mar 20th, 2008, 23:08
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: question about direct access to url

The message can easily be done in PHP! Not from the apache server.
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Mar 20th, 2008, 23:12
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,265
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: question about direct access to url

make the file 404.shtml and save it in your site root for a customized page not found message.
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Referrer spam - htaccess question - stopping access to domain alankeys Web Page Design 0 Mar 6th, 2008 07:14
How do I direct which frames random images are assigned to? jydeda JavaScript Forum 0 Jan 17th, 2008 19:52
301 folder direct help marcogolfo Web Page Design 3 Nov 14th, 2006 21:54


All times are GMT. The time now is 21:00.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42