|
|
|
|
![]() ![]() |
Jan 17 2007, 11:09 PM
Post
#1
|
|
|
Member [Level 2] ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 84 Joined: 24-November 06 Member No.: 33,967 |
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? |
|
|
|
Jan 17 2007, 11:51 PM
Post
#2
|
|
|
Desperately seeking "any key" to continue... ![]() Group: Admin Posts: 3,467 Joined: 23-April 05 From: Trap17 storage box Member No.: 6,042 |
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. |
|
|
|
Jan 18 2007, 12:16 AM
Post
#3
|
|
|
Member [Level 2] ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 84 Joined: 24-November 06 Member No.: 33,967 |
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
|
|
|
|
Jan 18 2007, 03:18 PM
Post
#4
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 181 Joined: 15-January 07 From: Rotherham, UK Member No.: 37,245 |
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 Computing Host has.
This sometimes happens as well if you have an iframe which keeps refreshing. Example CODE <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 |
|
|
|
Jan 18 2007, 03:45 PM
Post
#5
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 71 Joined: 12-January 07 Member No.: 37,047 |
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)
|
|
|
|
Jan 18 2007, 09:00 PM
Post
#6
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 138 Joined: 30-September 06 From: Iasi, Romania Member No.: 30,851 |
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" 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 This post has been edited by hts: Jan 18 2007, 09:01 PM |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 5th September 2008 - 01:28 PM |