PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 13th, 2000, 07:34 PM
Greedo Greedo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 2 Greedo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'd like to add a feature to my 404 script to get the url that caused the error. I already have the URL of the refering page, but is it possible to determine the incorrect URL that was used to cause the error?

Thanks in advance,

Greedo

Reply With Quote
  #2  
Old March 15th, 2000, 05:08 PM
CodeDuck CodeDuck is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 1999
Location: Hannover, Germany
Posts: 17 CodeDuck User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

it think it depends on the used server. I can get all the needed information via apache.

try

phpinfo();

the function shows you the servergenerated variables.

CodeDuck =8

Hope this helps you.

Reply With Quote
  #3  
Old March 20th, 2000, 06:28 AM
kaasgaard kaasgaard is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: Aalborg, Denmark
Posts: 36 kaasgaard User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
Send a message via ICQ to kaasgaard
If you use Apache as your webserver it's pretty straight forward.

1) Make sure your 404 page is allowed to execute php-scripts (check your srm.conf file (eg. /etc/httpd/conf/srm.conf) set it to eg. /missing.php3 . Then you make DOCUMENT_ROOT/missing.php3 your 404 page)

2) The requested url can then be found with the command:
getenv("REQUEST_URI");

Hope this helps you a bit

// Martin

Reply With Quote
  #4  
Old March 20th, 2000, 06:48 AM
Greedo Greedo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 2 Greedo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Right now I have the error redirection set using ErrorDocument 404 in the .htaccess file, so the script always thinks the REQUEST_URI is its own path (because you are redirected to it with a new REQUEST_URI). I'll see about trying your solution. Thanks for your help.

Greedo

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Getting 404 Info

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap