944,054 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 3522
  • PHP RSS
You are currently viewing page 1 of this multi-page discussion thread
Jun 29th, 2007
0

PHP downloading?

Expand Post »
Hey how is everybody doing today?
I am a noob in php (i actually just wrote my first php script yesterday) but I am running into a problem. I have a .php file and when I go to it on firefox it tries to either open with a program or save (it is acting like it is a downloadable file or something). IE opens the page fine though, it is a little weird because the whole time I have had problems with IE but not FF. I dont know whether this should be in browser or php so ill just post in both!
thank you for your help!!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
zachisevil is offline Offline
13 posts
since Jun 2007
Jun 29th, 2007
0

Re: PHP downloading?

What exactly is your php file doing?
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Jun 29th, 2007
0

Re: PHP downloading?

http://arbortreeland.com/index2.php

when I go to it in firefox it tries to download the file (you know like if you click on a direct link to an .mp3 file or something it prompts you to open or save).
If I choose to open it in firefox it just opens a blank page and prompts to dl again.
BUT if I use IE it works fine. this does this on all the computers I tried it on so it is not system specific.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
zachisevil is offline Offline
13 posts
since Jun 2007
Jun 29th, 2007
0

Re: PHP downloading?

I tested it with firefox on my linux box and it prompts for the open or save option.

How peculiar. Are you using firefox 2.0 out of interest?
Last edited by iamthwee; Jun 29th, 2007 at 4:05 pm.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Jun 29th, 2007
0

Re: PHP downloading?

yeap
Reputation Points: 10
Solved Threads: 0
Newbie Poster
zachisevil is offline Offline
13 posts
since Jun 2007
Jun 29th, 2007
0

Re: PHP downloading?

It's not liking something in your code. Hmm. I wonder.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Jun 29th, 2007
0

Re: PHP downloading?

i could paste the code here, but I dont know if you guys would want to debug it for me. Just in case though. NOTE: I dont actually have any php in there, just javascript. I also removed the body content. It works fine if i save it as .html, but it wont preload the images unless it has a .php extension.
PHP Syntax (Toggle Plain Text)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2.  
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <script type="text/javascript">
  6. // configure here:
  7. var preload = new Array('atlpics/coral6.jpg', 'atlpics/coral7.jpg', 'atlpics/coral8.jpg' ,'atlpics/coral23.jpg' ,'coral39.jpg' ,'atlpics/coral73.jpg' ,'atlpics/coral97.jpg' ,'atlpics/csid2.jpg' ,'atlpics/csid3.jpg' ,'atlpics/csid4.jpg' ,'atlpics/disaster.jpg' ,'atlpics/disaster2.jpg' ,'atlpics/hitw2.jpg' ,'atlpics/jsima.jpg' ,'atlpics/jsima2.jpg' ,'atlpics/npbcsid.jpg' ,'atlpics/npbcid2.jpg' ,'atlpics/npbcid3.jpg' ,'atlpics/swfmd.jpg' ,'atlpics/swfmd2.jpg' ,'atlpics/swfmd3.jpg');
  8.  
  9. var loader = new Array();
  10. for(var i = 0; i < preload.length; i++){
  11. loader[i] = new Image();
  12. loader[i].src = preload[i];
  13. }
  14. </script>
  15.  
  16.  
  17.  
  18.  
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  20. <title>ATL Disaster Recovery</title>
  21. <script language="javascript">AC_FL_RunContent = 0;</script>
  22. <script src="AC_RunActiveContent.js" language="javascript"></script>
  23. </head>
  24. <body>
  25. </body>
  26. </html>
Reputation Points: 10
Solved Threads: 0
Newbie Poster
zachisevil is offline Offline
13 posts
since Jun 2007
Jun 30th, 2007
0

Re: PHP downloading?

When you send a HTTP Request to the URL, you get the HTTP Response Headers:

PHP Syntax (Toggle Plain Text)
  1. HTTP/1.1 200 OK
  2. Server: Microsoft-IIS/5.0
  3. X-Powered-By: ASP.NET
  4. Date: Sat, 30 Jun 2007 14:28:56 GMT
  5. Content-Type: application/octet-stream
  6. Accept-Ranges: bytes
  7. Last-Modified: Fri, 29 Jun 2007 12:53:49 GMT
  8. ETag: "1077a4894cbac71:3202"
  9. Content-Length: 7111

Notice:

Content-Type: application/octet-stream
Accept-Ranges: bytes

It does not look like your server is not sending out the correct response headers. Its treats the PHP files as a download.

Is PHP even set up on the server? Have you tried other PHP scripts successfully?
Moderator
Reputation Points: 457
Solved Threads: 101
Nearly a Posting Virtuoso
digital-ether is offline Offline
1,250 posts
since Sep 2005
Jun 30th, 2007
0

Re: PHP downloading?

guyz..i juz dont wanna create another thread.. bt, juz wanna say.. m searching for a php scripter/develoter to get help with or hav instant chat .. m interestied in scripting..(learning)
Last edited by paksender; Jun 30th, 2007 at 12:29 pm.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
paksender is offline Offline
2 posts
since Jun 2007
Jun 30th, 2007
0

Re: PHP downloading?

thank you so much for helping me paksender....

digital ether: That could quite possible be it.. I was on a windows server and I just switched it to unix but I dont know if it is completely switched right now. But the thing is it works on Internet Explorer so it is confusing.
and what do you mean set up php on the server... I am paying a hosting site and they should do that right? if IE works it should be fine though.....
Reputation Points: 10
Solved Threads: 0
Newbie Poster
zachisevil is offline Offline
13 posts
since Jun 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: help me
Next Thread in PHP Forum Timeline: PDF and editing in script





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC