Text Downloadable Files with PHP

Posted on Jun 28, 2013
I needed to create a file which had to be downloaded. The file had to be in plain text and contents from file come from database. Because I didn't had a separate folder for each user I couldn't write the information to a file to the server and put a link in order the user to download it. I even try to other formats like .xls, .doc, .csv and it works really nice.

Code for downloadable file:
<?
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"your_file.txt\"");
echo 'Text for downloadable file';  
?>

FTP Upload with PHP for Beginners

Posted on Jun 27, 2013
To upload a file to ftp you need a html form where you can insert the ftp details, like the ones described above:

server - is the server on which he wanna upload the file.
username - is the user for which he makes the connection to ftp server.
password - is the user password for ftp username.
path to server - is the path on the ftp server which he wanna upload his file.
user file - is the file of the you wanna upload to ftp server.

7 Good Tips for Writing Better CSS

Posted on Jun 26, 2013
Writing your first piece of css code can seem really weird if you're used to working with tables, or just haven't written code before. In this article I want to talk about 7 different ways you can write proper and clean css code as well as streamline the process and ensure you're getting the job done as quickly and efficiently as possible.

© Twiwoo 2023 Cookie Policy