Limitation: Cannot include images in the post. Will be upgraded in the future. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //NEED DEVELOPER INPUTS (YOUR WORDPRESS MYSQL DATABASE LOGINS: Connect to MySQL database// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $username = "yourmysqlusername"; $password = "yourmysqlpassword"; $hostname = "yourmysqlhostname"; $database = "yourmysqldatabasename"; $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); //select a database to work with $selected = mysql_select_db($database,$dbhandle) or die("Could not select $database"); ////////////////////////////////////////////////////// //Step 2 Get GET Request and Sanitize inputs/// ////////////////////////////////////////////////////// $posttitle=trim($_GET['title']); $posttitle = mysql_real_escape_string(stripslashes($posttitle)); //////////////////////////////////////// //Step 3 Query MySQL database/// /////////////////////////////////////// $result = mysql_query("SELECT `post_content` FROM `wp_posts` WHERE `post_title`='$posttitle' AND `post_status`='publish'") or die(mysql_error()); $row = mysql_fetch_array($result) or die("Invalid query: " . mysql_error()); $content = $row['post_content']; $content= strip_tags($content); /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Step 4. NEED DEVELOPER INPUTS (YOUR CORRECT DOMAIN NAME: Assign post content to PHP variable// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $message = "Post title: $posttitle Author: WWW.REPLACETHISWITHYOURDOMAINNAME.COM $content Copyright © 2009 WWW.REPLACETHISWITHYOURDOMAINNAME.COM"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Step 5. NEED DEVELOPER INPUTS (CORRECT PATH TO YOUR ROOT DIRECTORY: Integrate R&OS PDF Creator Class/// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// include ('/home/www/php-developer.org/class.ezpdf.php'); $pdf =& new Cezpdf(); $pdf->selectFont('/home/www/php-developer.org/fonts/Courier.afm'); //THIS IS OPTIONAL//////////////////////////// //$pdf->ezImage('PATH TO YOUR IMAGE');// /////////////////////////////////////////////////// $pdf->ezText($message,11); //////////////////////////////////////////////// //Step 6. Stream PDF to users browser/// /////////////////////////////////////////////// $pdf->ezStream(); //close the connection mysql_close($dbhandle); ?>