Jump to content


Does a 404 error occur when a script tries to include a file that can't be found?

  • Please log in to reply
2 replies to this topic

#1 Gonwee

  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 04 April 2006 - 04:49 PM

Does a 404 error happen if a script tries to include a file that doesn't exist. If it does how how do i find out about it.

I keep getting 404 error reports(i set my 404 page to email me) and i haven't tried viewing any page that doesn't exist(and i know no one visits my site)

And i don't know what page the 404 error is coming from, i've got the $_SERVER['HTTP_REFERER'] variable, but that doesn't seem to work.

#2 shortj75

  • Members
  • PipPipPip
  • Advanced Member
  • 118 posts
  • LocationPort Huron,mi

Posted 04 April 2006 - 05:32 PM

if you use the include() function with a page that doesnt exist nothing happen you wont get error 404 if you are getting that error it is because it cant find the main page now if you are useing frame or iframe and the page is missing then yes you will get the error 404 in the frame or i frame
The Short One

hopfully this helps if it doesn't sorry
i won't write the code for you!!! you don't learn that way

#3 neylitalo

  • Staff Alumni
  • Advanced Member
  • 1,854 posts
  • LocationMichigan, USA

Posted 04 April 2006 - 07:06 PM

A 404 is thrown by the web server when a client (your browser) requests a file from the server that does not exist. When you're using include(), that's not a client request; rather, it's the server requesting a file. If you try to include() a file that doesn't exist, it'll throw a PHP warning.

[a href=\"http://www.php.net/manual/en/function.include.php\" target=\"_blank\"]http://www.php.net/manual/en/function.include.php[/a]

http://nealylitalo.net - My personal website, and home of The Netizen's Journal.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users