Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Help needed with showing 404 url in email being sent on generation.
Old 12-14-2007, 09:44 PM Help needed with showing 404 url in email being sent on generation.
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
Okay on a site im doing (calm) i have set up error.php which covers most errors by error.php?type=404 etc.

I have it so it emails with the error code, and i want to show the url which generated the code, but instead of showing what is displayed in the url
http://calm.dansgalaxy.co.uk/igvjrkbnkfbn

for php_self of course it echos error.php and the refer shows blank

So how can i show the url?!!?! gr its bugging me now!
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
 
Register now for full access!
Old 12-14-2007, 10:58 PM Re: Help needed with showing 404 url in email being sent on generation.
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
A browser can be setup to not show the referral URL. The best thing for you to do would be one of these:

1) store the URL which generates the error in a session variable, or
2) redirect and include the originating URL (e.g. error.php?type=404&source=badspot.com/weird-script.php )
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 12-15-2007, 08:51 AM Re: Help needed with showing 404 url in email being sent on generation.
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
Well this is the thing its not redirecting!

as you can see it would show doamin/blfvejib but SHOW error.php?type=404

at the moment im using htacess error doc 404 /error.php?type=404 to do my thing

is there a way i can tell it the offending url throught this??
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 12-15-2007, 09:45 AM Re: Help needed with showing 404 url in email being sent on generation.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
the url in error is sent to the error handling page in $_SERVER['QUERY_STRING'] and takes the form of HTTPResponseCode;RequestedURL

so a Not Found response (404) the querystring would be

Code:
404;http://sitename/folder/page.ext
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-15-2007, 09:55 AM Re: Help needed with showing 404 url in email being sent on generation.
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
Sorry could you say that a bit slower?

so how would i use this to get the offending url? because just tried $_server['query_string'] but that only shows me type=404

so how do i use this?
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 12-15-2007, 10:36 AM Re: Help needed with showing 404 url in email being sent on generation.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Don't set an error type in YOUR querystring and just use the server generated one
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-15-2007, 10:45 AM Re: Help needed with showing 404 url in email being sent on generation.
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
What?

explain?... the error type is set through htaccess so it can identify which method to show so i dont have to have sepereate files for each error...
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Reply     « Reply to Help needed with showing 404 url in email being sent on generation.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.30023 seconds with 12 queries