<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Generating Barcodes with PHP</title>
	<link>http://www.createwebsite.info/generating-barcodes-with-php/</link>
	<description>yet another undecorated wordpress blog about web development</description>
	<pubDate>Wed, 10 Mar 2010 23:12:14 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: create a website</title>
		<link>http://www.createwebsite.info/generating-barcodes-with-php/#comment-884</link>
		<dc:creator>create a website</dc:creator>
		<pubDate>Thu, 28 Jan 2010 20:07:10 +0000</pubDate>
		<guid>http://www.createwebsite.info/generating-barcodes-with-php/#comment-884</guid>
		<description>@Lyle - I updated the post so it says up front to check out the comments for a bug fix. Hopefully that helps other people using this!</description>
		<content:encoded><![CDATA[<p>@Lyle - I updated the post so it says up front to check out the comments for a bug fix. Hopefully that helps other people using this!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lyle</title>
		<link>http://www.createwebsite.info/generating-barcodes-with-php/#comment-883</link>
		<dc:creator>Lyle</dc:creator>
		<pubDate>Thu, 28 Jan 2010 08:46:30 +0000</pubDate>
		<guid>http://www.createwebsite.info/generating-barcodes-with-php/#comment-883</guid>
		<description>Even though I grabbed the code, I didn't read the comments here! I should have. I found the same problem in the code, and rewrote it myself. Might have saved me some time counting the width of bars trying to figure out what was going wrong!</description>
		<content:encoded><![CDATA[<p>Even though I grabbed the code, I didn&#8217;t read the comments here! I should have. I found the same problem in the code, and rewrote it myself. Might have saved me some time counting the width of bars trying to figure out what was going wrong!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: create a website</title>
		<link>http://www.createwebsite.info/generating-barcodes-with-php/#comment-602</link>
		<dc:creator>create a website</dc:creator>
		<pubDate>Tue, 16 Dec 2008 17:18:36 +0000</pubDate>
		<guid>http://www.createwebsite.info/generating-barcodes-with-php/#comment-602</guid>
		<description>Thanks Zech. I am sure that will help others out.</description>
		<content:encoded><![CDATA[<p>Thanks Zech. I am sure that will help others out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zech Campbell</title>
		<link>http://www.createwebsite.info/generating-barcodes-with-php/#comment-601</link>
		<dc:creator>Zech Campbell</dc:creator>
		<pubDate>Tue, 16 Dec 2008 17:04:32 +0000</pubDate>
		<guid>http://www.createwebsite.info/generating-barcodes-with-php/#comment-601</guid>
		<description>It was generating the wrong 128 and my barcode scanner could not scan it but I found the solution on http://www.phpclasses.org/discuss/package/2441/thread/2/

Here is the fix:

Original Code:

$sum=0;
$mfcStr="";
if($useKeys=='C')
{
for($i=0;$i&#60;strlen($barnumber);$i+=2)
{
$val=substr($barnumber,$i,2);
if(is_int($val))
$sum+=($i+1)*(int)($val);
elseif($barnumber==chr(129))
$sum+=($i+1)*100;
elseif($barnumber==chr(130))
$sum+=($i+1)*101;
$mfcStr.=$encTable[$val];
}
}



Fixed Code:

$sum=0;
$weight = 0;
$mfcStr="";
if($useKeys=='C')
{
for($i=0;$i&#60;strlen($barnumber);$i+=2)
{
$weight++;
$val=substr($barnumber,$i,2);
if(is_numeric($val))
$sum+=$weight*(int)($val);
elseif($barnumber==chr(129))
$sum+=$weight*100;
elseif($barnumber==chr(130))
$sum+=$weight*101;
$mfcStr.=$encTable[(int) $val];
}
}
 

If you read his post he gives some information to why you have to change that stuff.</description>
		<content:encoded><![CDATA[<p>It was generating the wrong 128 and my barcode scanner could not scan it but I found the solution on <a href="http://www.phpclasses.org/discuss/package/2441/thread/2/" rel="nofollow">http://www.phpclasses.org/discuss/package/2441/thread/2/</a></p>
<p>Here is the fix:</p>
<p>Original Code:</p>
<p>$sum=0;<br />
$mfcStr=&#8221;";<br />
if($useKeys==&#8217;C')<br />
{<br />
for($i=0;$i&lt;strlen($barnumber);$i+=2)<br />
{<br />
$val=substr($barnumber,$i,2);<br />
if(is_int($val))<br />
$sum+=($i+1)*(int)($val);<br />
elseif($barnumber==chr(129))<br />
$sum+=($i+1)*100;<br />
elseif($barnumber==chr(130))<br />
$sum+=($i+1)*101;<br />
$mfcStr.=$encTable[$val];<br />
}<br />
}</p>
<p>Fixed Code:</p>
<p>$sum=0;<br />
$weight = 0;<br />
$mfcStr=&#8221;";<br />
if($useKeys==&#8217;C')<br />
{<br />
for($i=0;$i&lt;strlen($barnumber);$i+=2)<br />
{<br />
$weight++;<br />
$val=substr($barnumber,$i,2);<br />
if(is_numeric($val))<br />
$sum+=$weight*(int)($val);<br />
elseif($barnumber==chr(129))<br />
$sum+=$weight*100;<br />
elseif($barnumber==chr(130))<br />
$sum+=$weight*101;<br />
$mfcStr.=$encTable[(int) $val];<br />
}<br />
}</p>
<p>If you read his post he gives some information to why you have to change that stuff.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zech Campbell</title>
		<link>http://www.createwebsite.info/generating-barcodes-with-php/#comment-600</link>
		<dc:creator>Zech Campbell</dc:creator>
		<pubDate>Tue, 16 Dec 2008 00:10:52 +0000</pubDate>
		<guid>http://www.createwebsite.info/generating-barcodes-with-php/#comment-600</guid>
		<description>I have been trying to use this same script and noticed that the 128 bar codes are not working properly. Did you have this problem and if so, were you able to fix it? Thanks</description>
		<content:encoded><![CDATA[<p>I have been trying to use this same script and noticed that the 128 bar codes are not working properly. Did you have this problem and if so, were you able to fix it? Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
