root(717)
-
Read PDF and Word DOC Files Using PHP
element Font font-family font-size font-style font-variant font-weight letter-spacing line-height text-decoration text-align text-indent text-transform white-space word-spacing color Background bg-attachment bg-color bg-image bg-position bg-repeat Box width height border-top border-right border-bottom border-left margin padding max-height min-height max-width min-width outline-color outline-styl..
2011.12.21 -
Send Files via FTP Using PHP
$connection = ftp_connect($server); $login = ftp_login($connection, $ftp_user_name, $ftp_user_pass); if (!$connection || !$login) { die('Connection attempt failed!'); } $upload = ftp_put($connection, $dest, $source, $mode); if (!$upload) { echo 'FTP upload failed!'; } ftp_close($connection);
2011.12.21 -
Force A Secure Page Using PHP
//force redirect to secure page if($_SERVER['SERVER_PORT'] != '443') { header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); exit(); }
2011.12.21 -
Force Secure (SSL) Pages With .htaccess
RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://domain.com/$1 [R,L]
2011.12.21 -
PHP Force Download
// grab the requested file's name $file_name = $_GET['file']; // make sure it's a file before doing anything! if(is_file($file_name)) { /* Do any processing you'd like here: 1. Increment a counter 2. Do something with the DB 3. Check user permissions 4. Anything you want! */ // required for IE if(ini_get('zlib.output_compression')) { ini_set('zlib.output_compression', 'Off'); } // get the file m..
2011.12.21 -
PHP Headers and Popular Mime Types
Atom header('Content-type: application/atom+xml'); CSS copyheader('Content-type: text/css'); Javascript header('Content-type: text/javascript'); JPEG Image header('Content-type: image/jpeg'); JSON header('Content-type: application/json'); PDF header('Content-type: application/pdf'); RSS header('Content-Type: application/rss+xml; charset=ISO-8859-1'); Text (Plain) header('Content-type: text/plain..
2011.12.21