FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Random Scripts download...





gerpg
Very occasionally when loading a page it will give you an option to download the page.

Their's no output from the server in my scripts to initiate a download, i am aware that PHP5 has this problem but im wondering is their any way to stop it?

Louis.
coreymanshack
I also would like to know, i've seen this many times.
mathiaus
I think this is when the server is having problems and doesn't know how what to do with things, sending out the wrong headers etc.
As such, nothing you can do but wait for the server to regain control of itself.
(this could of course just be rubbish though!)
coreymanshack
Well if this is true, and you wanted to view sensitive php documents, you could just bog down the server by opening up lots of ports and half asking for data. Then go to a page and download it. This just seems odd.
gerpg
I'll check through all the PHP5 functions list and see if anything is capable of stopping it.

Louis.
jabapyth
The header is "Content-Disposition"

to initiate a "Save File" prompt, use "attachment", eg

Code:
header('Content-Disposition: attachment; filename="savefilename.pdf"');


to prevent it, use "inline".

Code:
header('Content-Disposition: inline"');


**note** that the filename parameter does not need to be the filename of the php file. It can be anything you want (preferably something relating to the content of the file), as it will be the default filename in the "Save File" dialog.

To use the "header" command in php, you must call it before everything else, and call a Content-Type header first:

download.php
Code:
<?php
header("Content-Type: application/pdf");
header('Content-Disposition: attachment; filename="birds.pdf"');

// the rest of my code
?>


To prevent the save dialog, use
Code:
<?php
header("Content-Type: text/html");
header("Content-Disposition: inline");

// the rest of my code
?>
gerpg
jabapyth wrote:
The header is "Content-Disposition"

to initiate a "Save File" prompt, use "attachment", eg

Code:
header('Content-Disposition: attachment; filename="savefilename.pdf"');


to prevent it, use "inline".

Code:
header('Content-Disposition: inline"');


**note** that the filename parameter does not need to be the filename of the php file. It can be anything you want (preferably something relating to the content of the file), as it will be the default filename in the "Save File" dialog.

To use the "header" command in php, you must call it before everything else, and call a Content-Type header first:

download.php
Code:
<?php
header("Content-Type: application/pdf");
header('Content-Disposition: attachment; filename="birds.pdf"');

// the rest of my code
?>


To prevent the save dialog, use
Code:
<?php
header("Content-Type: text/html");
header("Content-Disposition: inline");

// the rest of my code
?>


Thank you, i'll give it a go and see if anyhting happens.

Louis.
kiran_n444
It ALso occus when theres alot of "lag" on either your internet COnnection or the FRIH servers. Also it occurs when U have errors on your page etc.
manav
I also had the same problem thnks for the help dudes
Related topics
Greasemonkey Scripts
Phoenix free PHP scripts
"Forms To Go" create scripts in PHP, ASP and Perl
Two Scripts that I need!
scripts with resale rights - buy them or get them free
Scripts
need php scripts installed - 120 Frih$'s
PodCast Marketing
leech scripts
free download scripts
Layout gap problems with Javascript/PHP Combo
Download database.
Firefox vs IE
Insane
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.