I am having trouble with PDF download. The file email1-sample.pdf was downloaded from site point for my test while building my site, it worked perfectly while open from browser in local machine. But after I uploaded to remote web host, I could not download it. Here is the link: http://books.chnmates.com/email1-sample.pdf
Can you tell me what I did wrong? This uRL is used as a form action.
Secndly I uploaded a PHP file to my web host & PHP code was not executed at all. The file contains simple html structure with a sinple php code:
<?php echo ‘test’; ?>
What did I do wrong with it?
can you post the code on your remote web host that tries to download the pdf file?
that php should work if you have php enabled on your web host account and if the filename has a .php extension and there are no other errors in the file.
to open a pdf file in the browser you can simply link to it using an <a>. I would also put a link on the web page to Adobe’s website to download Adobe Reader for those that don’t have Adobe Reader on their pc.
I copied and pasted your code to a file on both my local and “real world” web server and it works fine except I get ???'s instead of the chinese characters. The echo ‘test’ worked fine on both servers.
are you sure php is enabled on your server, or maybe those chinese chars is causing a problem if you don’t specify the correct charset in your <head> but I’m only guessing now.
Thanks for reply.
I used <form> is because I did not want to style more elements. The free preview form button is the same as the paypal button, except the form action is different. I will try your way out. If it fixes the PDF download problem. I will style it.
In regarding to the PHP code issue, my charset was always set to utf-8. This is strange as other PHP file worked properly in the same directory of the remote host. I will look further. Thanks a lot.
In regarding my issues, the action attribute in form element for downloading PDF file suddenly worked, I did not do anything.
The second issue of php code not executed:
I changed the file to save as ansi code in disc, then uploaded again, the php code worked. But I need unicode for saving the file in disc, how can I have its php code executed while the php file was saved as unicode in disc?