<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Diadem Tech Weblogs &#187; PHP/MySQL</title>
	<atom:link href="http://www.diademblogs.com/category/phpmysql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.diademblogs.com</link>
	<description>Our take on web hosting, web development, web marketing and everything in between.</description>
	<lastBuildDate>Sun, 05 Sep 2010 07:27:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Setting up and getting DOMpdf to work in XAMPP on Windows</title>
		<link>http://www.diademblogs.com/phpmysql/setting-up-and-getting-dompdf-to-work-in-xampp-on-windows</link>
		<comments>http://www.diademblogs.com/phpmysql/setting-up-and-getting-dompdf-to-work-in-xampp-on-windows#comments</comments>
		<pubDate>Mon, 23 Nov 2009 12:14:30 +0000</pubDate>
		<dc:creator>amitabh</dc:creator>
				<category><![CDATA[PHP/MySQL]]></category>

		<guid isPermaLink="false">http://www.diademblogs.com/?p=423</guid>
		<description><![CDATA[Setting up the Dompdf (a pdf generation package in php) in XAMPP in windows environment can sometimes be an issue. Here are some modifications to enable DOMPDF on a windows environment. ]]></description>
			<content:encoded><![CDATA[<p>Setting up the Dompdf (a pdf generation package in php) in XAMPP in windows environment can sometimes be an issue.<br />
After we have set up the package in the htdocs and go for testing the examples in the packages , error is encountered which is as follows-</p>
<p><span style="color: rgb(153, 153, 153);" mce_style="color: #999999;">A PHP Error was encountered<br />
Severity: Warning<br />
Message: domdocument::domdocument() expects at least 1 parameter, 0 given<br />
Filename: include/dompdf.cls.php<br />
Line Number: 165<br />
Fatal error: Call to undefined method domdocument::loadHTML() in C:\xampp\htdocs\bambooinvoice\bamboo_system_files\plugins\dompdf\include\dompdf.cls.php on line 284</span></p>
<p><span style="color: rgb(153, 153, 153);" mce_style="color: #999999;"><br />
<span style="color: rgb(0, 0, 0);" mce_style="color: #000000;">The error message is caused due to a conflict between DomDocument and DomXML extentions , so the first thing we did was to disable the domdocument extention in php.ini.<br />
extension = php_domxml.dll</span></span></p>
<p>After restarting the apache and then again running the examples again blank pages were being rendered. The problem was due to the fact that dompdf uses PDFLib by default if it is available in the system and PDFLib is a commercial package which is not available by default in the system but its extention is enabled in php.ini by default in the system.</p>
<p>So what we did was to comment out the PDFLib extension <b>extension=php_pdf.dll</b> in the php.ini file. After the modifications we restarted the apache and then the examples could be run on the XAMPP environment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.diademblogs.com/phpmysql/setting-up-and-getting-dompdf-to-work-in-xampp-on-windows/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Improve Security using php.ini</title>
		<link>http://www.diademblogs.com/phpmysql/improve-security-using-phpini</link>
		<comments>http://www.diademblogs.com/phpmysql/improve-security-using-phpini#comments</comments>
		<pubDate>Wed, 25 Mar 2009 04:57:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP/MySQL]]></category>
		<category><![CDATA[php security]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[Plesk]]></category>

		<guid isPermaLink="false">http://diadem.co.in/blog/?p=49</guid>
		<description><![CDATA[PHP has some vulnerable functions which can be used to break into your server if your scripts are not coded securely. You can setup a list of functions in php.ini using disable_functions directive. This directive allows you to disable certain functions for security reasons. It takes on a comma-delimited list of function names. This disable_functions [...]]]></description>
			<content:encoded><![CDATA[<p>PHP has some vulnerable functions which can be used to break into your server if your scripts are not coded securely. You can setup a list of functions in php.ini using disable_functions directive. This directive allows you to disable certain functions for security reasons. It takes on a comma-delimited list of function names. This <strong>disable_functions</strong> feature is not affected by Safe Mode. This directive must be set in php.ini For example, you cannot set this in httpd.conf</p>
<p>Open php.ini file:</p>
<p>#<code>vi /etc/php.ini</code></p>
<p>Find disable_functions and set new list as follows:</p>
<p><code>disable_functions =exec,passthru,shell_exec,system,proc_open,popen,curl_exec,</code></p>
<p><code>curl_multi_exec,parse_ini_file,show_source </code></p>
<p>Save and close the file. Restart httpd:</p>
<p><code># service httpd restart</code></p>
Note: There is a rating embedded within this post, please visit this post to rate it.
]]></content:encoded>
			<wfw:commentRss>http://www.diademblogs.com/phpmysql/improve-security-using-phpini/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating image thumbnails in php</title>
		<link>http://www.diademblogs.com/phpmysql/creating-image-thumbnails-in-php</link>
		<comments>http://www.diademblogs.com/phpmysql/creating-image-thumbnails-in-php#comments</comments>
		<pubDate>Thu, 19 Mar 2009 04:10:28 +0000</pubDate>
		<dc:creator>mithun</dc:creator>
				<category><![CDATA[PHP/MySQL]]></category>
		<category><![CDATA[dynamic image thumbnails]]></category>
		<category><![CDATA[thumbnail creation]]></category>
		<category><![CDATA[thumbnails in php]]></category>

		<guid isPermaLink="false">http://www.diademblogs.com/?p=473</guid>
		<description><![CDATA[Thumbnail are used by graphic designers and photographers for a small image representation of a larger image. The main advantage of creating thumbnails is that it generates the new image with the proportional dimension of the large image and hence the image resolution and quality remain intact. As the thumbnails are smaller in size they [...]]]></description>
			<content:encoded><![CDATA[<p>Thumbnail are used by graphic designers and photographers for a small image representation of a larger image. The main advantage of creating thumbnails is that it generates the new image with the proportional dimension of the large image and hence the image resolution and quality remain intact. As the thumbnails are smaller in size they load quickly and makes the page render faster as well.</p>
<p>We are using a thumbnail class to make code simpler and easy to use. Image extensions with jpg, gif and png are supported for creating thumbnail using this class.</p>
<p>Three easy steps to create and image thumbnail :</p>
<p><strong>Step 1. </strong>Create a folder and named  as createThumb.  Create a file named thumbnail_Class.php in the createThumb folder and paste the code given below into it.</p>
<blockquote><p>&lt;?<br />
function createThumb($srcname,$destname,$maxwidth,$maxheight)<br />
{<br />
$oldimg = $srcname;<br />
$newimg = $destname;</p>
<p>list($imagewidth,$imageheight,$imagetype)=@getimagesize($oldimg);</p>
<p>$shrinkage = 1;<br />
if ($imagewidth &gt; $maxwidth)<br />
$shrinkage = $maxwidth/$imagewidth;<br />
if($shrinkage !=1)<br />
{<br />
$dest_height = $shrinkage * $imageheight;<br />
$dest_width = $maxwidth;<br />
}<br />
else<br />
{<br />
$dest_height=$imageheight;<br />
$dest_width=$imagewidth;<br />
}<br />
if($dest_height &gt; $maxheight)<br />
{<br />
$shrinkage = $maxheight/$dest_height;<br />
$dest_width = $shrinkage * $dest_width;<br />
$dest_height = $maxheight;<br />
}<br />
if($imagetype==2)<br />
{<br />
$src_img = imagecreatefromjpeg($oldimg);<br />
$dst_img = imagecreatetruecolor($dest_width, $dest_height);<br />
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $dest_width, $dest_height, $imagewidth, $imageheight);<br />
imagejpeg($dst_img, $newimg, 75);<br />
imagedestroy($src_img);<br />
imagedestroy($dst_img);<br />
}</p>
<p>elseif ($imagetype == 3)<br />
{<br />
$src_img = imagecreatefrompng($oldimg);<br />
$dst_img = imagecreatetruecolor($dest_width, $dest_height);<br />
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $dest_width, $dest_height, $imagewidth, $imageheight);<br />
imagepng($dst_img, $newimg, 75);<br />
imagedestroy($src_img);<br />
imagedestroy($dst_img);<br />
}<br />
else<br />
{<br />
$src_img = imagecreatefromgif($oldimg);<br />
$dst_img = imagecreatetruecolor($dest_width, $dest_height);<br />
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $dest_width, $dest_height, $imagewidth, $imageheight);<br />
imagegif($dst_img, $newimg, 75);<br />
imagedestroy($src_img);<br />
imagedestroy($dst_img);<br />
}<br />
}<br />
?&gt;</p></blockquote>
<p><strong>Step 2. </strong> Create a file named index.php with in this folder and paste the code given below inside index.php. This is the file which you need to run from the browser. Place your image (e.g., grapes.jpg) to create thumbnail within the createThumb folder.</p>
<blockquote><p>&lt;?<br />
include(&#8216;thumbnail_Class.php&#8217;);</p>
<p>$filePath    =    &#8216;grapes.jpg&#8217;;<br />
$destPath    =    &#8216;Thumb_grapes.jpg&#8217;;<br />
$maxwidth        =    450;<br />
$maxheight        =    300;<br />
createThumb($filePath,$destPath,$maxwidth,$maxheight);</p>
<p>echo &#8216;Thumbnail Created.&#8217;;<br />
?&gt;</p></blockquote>
<p><strong>Step 3. </strong>Finally, Run the index.php from your browser and if your thumbnail is created successfully then you will get an message &#8220;Thumbnail Created&#8221; and the thumnail image will create in createThumb folder with name Thumb_grapes.jpg.<br />
<span id="more-473"></span></p>
<p>E..g,</p>
<div id="attachment_479" class="wp-caption alignnone" style="width: 810px"><img class="size-full wp-image-479" src="http://www.diademblogs.com/wp-content/uploads/2009/02/grapes.jpg" alt="Large Image" width="800" height="600" /><p class="wp-caption-text">Large Image</p></div>
<div id="attachment_480" class="wp-caption alignnone" style="width: 410px"><img class="size-full wp-image-480" src="http://www.diademblogs.com/wp-content/uploads/2009/02/thumb_grapes.jpg" alt="Thumnail Image" width="400" height="300" /><p class="wp-caption-text">Thumnail Image</p></div>
<p>That&#8217;s it. I hope this piece of code helps you in creating image thumbnails for your website with ease.</p>
Note: There is a rating embedded within this post, please visit this post to rate it.
]]></content:encoded>
			<wfw:commentRss>http://www.diademblogs.com/phpmysql/creating-image-thumbnails-in-php/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
