note 52168 added to function.header

From: Date: Fri, 22 Apr 2005 19:04:53 +0000
Subject: note 52168 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-88417@lists.php.net to get a copy of this message
I was looking at this section and I noticed that it didn't mention anything about javascript includes using php files. I tested this code on Gecko browsers (Firefox, Mozilla, Netscape), MSIE and Opera and they all can include the php file with this header: header("Content-type: application/x-javascript"); This would be the code you would use to include it: <script type="text/javascript" src="javascript.php"></script> MSIE doesn't understand the file only if it is called directly in the location bar; it still executes the file when called through html. I believe this header is necessary for legacy browsers, i.e. Netscape 4.x or less. ---- Manual Page -- http://www.php.net/manual/en/function.header.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+52168 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52168&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52168&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52168&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52168&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52168&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+52168&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#88417) next »