rsf 0 Report post Posted January 17, 2007 I'm pretty sure this is a problem with the server, not my code. But I'm open for interpretations.Randomly I'll be uploading php files, and when I try and view them it takes a little longer to load and then asks me if I want to download the php file or not. Of course, I don't want people to download my php files.This just happens sporadically, I won't get it for a few days, and then one day I'll get it several times.Anyone had this problem before, or is there anything I can do with chmod or htaccess to allow people to view the file, but not download it? Share this post Link to post Share on other sites
BuffaloHelp 24 Report post Posted January 17, 2007 Please give an example of URL and perhaps you can post the file as well?PHP is server side ran script. So if it's downloading it's usually because the format was not compliant with PHP scripting--so it's interpreted as other file type. Share this post Link to post Share on other sites
rsf 0 Report post Posted January 18, 2007 Ok thanks. I got the message again when I was writing some new code which I expected to still be buggy. I downloaded it just to see and the file it downloaded didn't have any contents. So I guess it's not a security issue, I just need to not release buggy pages so I don't annoy my users Share this post Link to post Share on other sites
QuickSilva 0 Report post Posted January 18, 2007 This happens to me when the server goes laggy for a few minutes. I write all my PHP scripts in PHP 4, which I believe Trap 17 and Xisto - Web Hosting has. This sometimes happens as well if you have an iframe which keeps refreshing. Example <iframe src="page.php" name="mainframe"></iframe> If there is a propper reason, please tell it here. I would love to know. And until then, I personaly believe it's just the server been laggy. Also if the script uses MySQL this sometimes happens to me. Have a great day! -Tom Share this post Link to post Share on other sites
caos dreamer 0 Report post Posted January 18, 2007 had this on different hosters so i dont think its a serious problem... not very common aswell. i think it happens if the server needs too long to interprete the script and the browser just tries to download the file instead of displaying the phrazed code. shouldn?t happen too often i think (happened 3 times in my life xD) Share this post Link to post Share on other sites
hts 0 Report post Posted January 18, 2007 (edited) it has nothing to do with the fact that the server is "laggy".php is a server-side scripting language, therefore the content of a .php is parsed (interpreted) by the server. You cannot download a php file (the content of it). What you (should) get (called "output" ) is generally html files (but it can be an image, a pdf file etc.). This means that your files are not "seen" by the server as php files. First of all, be sure that your php files start with <?php (or<?) and end with ?> (the only quick tip that came into my mind )... Edited January 18, 2007 by hts (see edit history) Share this post Link to post Share on other sites