<?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>Aaron Jefferson Villanueva&#039;s Blog Site&#187; PHP</title>
	<atom:link href="http://malebolgia.shadowsonawall.net/category/code-programming/php/feed" rel="self" type="application/rss+xml" />
	<link>http://malebolgia.shadowsonawall.net</link>
	<description>Programming / Designing Blogging from windows to mac.</description>
	<lastBuildDate>Fri, 20 May 2011 12:05:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ZendFramework Library</title>
		<link>http://malebolgia.shadowsonawall.net/code-programming/zendframework-library.html</link>
		<comments>http://malebolgia.shadowsonawall.net/code-programming/zendframework-library.html#comments</comments>
		<pubDate>Tue, 01 Mar 2011 20:49:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding/Programming]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ZendFramework]]></category>
		<category><![CDATA[Library Path]]></category>
		<category><![CDATA[php.ini]]></category>

		<guid isPermaLink="false">http://malebolgia.shadowsonawall.net/?p=493</guid>
		<description><![CDATA[if somehow you encounter this kind of error(mostly this will be encounter by first timers using ZendFramework)   Warning: require_once(Zend/Application.php) [function.require-once]: failed to open stream: No such file or directory... Fatal error: require_once() [function.require]: Failed opening required 'Zend/Application.php'....    you can either include the path library(where you installed Zend Framework your client [...]]]></description>
			<content:encoded><![CDATA[if somehow you encounter this kind of error(mostly this will be encounter by first timers using ZendFramework)  <br /><br /><span style="color: #ff0000;"> Warning: require_once(Zend/Application.php) [function.require-once]: failed to open stream: No such file or directory...<br /> Fatal error: require_once() [function.require]: Failed opening required 'Zend/Application.php'.... </span><br /> <br /><img src="http://malebolgia.shadowsonawall.net/images/zend-library.jpg" alt="Zend Framework Library" align = "right" />  you can either include the path library(where you installed Zend Framework your client path) in your php.ini,
 or manually copy the zend library under your application library folder. <br /><br /> 
for <strong>php.ini</strong> settings


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">include_path <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;.:/Applications/MAMP/bin/php5/lib/php:/usr/local/ZendFrameworkCli/library&quot;</span></pre></div></div>



<br /><br /> where  <span style="color: #003300;">/usr/local/ZendFrameworkCli</span> is the path I installed my ZendFramework ...<span style="color: #003300;">/library</span> is where the zend libraries are located.
]]></content:encoded>
			<wfw:commentRss>http://malebolgia.shadowsonawall.net/code-programming/zendframework-library.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="1" length="" type="" />
		</item>
		<item>
		<title>SF forms with captcha</title>
		<link>http://malebolgia.shadowsonawall.net/code-programming/captcha-with-salesforce.html</link>
		<comments>http://malebolgia.shadowsonawall.net/code-programming/captcha-with-salesforce.html#comments</comments>
		<pubDate>Fri, 28 Jan 2011 05:43:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding/Programming]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[apex]]></category>
		<category><![CDATA[avoid spam]]></category>
		<category><![CDATA[CuRL]]></category>
		<category><![CDATA[reCaptcha]]></category>
		<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[web-to-lead]]></category>

		<guid isPermaLink="false">http://malebolgia.shadowsonawall.net/?p=449</guid>
		<description><![CDATA[Adding captcha with web-to-lead formsThere are times you want to avoid those annoying bots filling your forms and putting garbage into your data with in your salesforce leads, there are  measures to avoid this and if you prefer using captcha, you might want to use reCaptcha. If you know how to code with salesforce [...]]]></description>
			<content:encoded><![CDATA[<span style="color: #993300;"><strong>Adding captcha with web-to-lead forms</strong></span><br /><br />There are times you want to avoid those annoying bots filling your forms and putting garbage into your data with in your salesforce leads, there are  measures to avoid this and if you prefer using <span style="color: #003300;"><strong>captcha</strong></span>, you might want to use reCaptcha. If you know how to code with <em><span style="color: #008000;">salesforce</span></em> <strong><span style="color: #008000;">apex</span></strong> this <a href="http://wiki.developerforce.com/index.php/Adding_CAPTCHA_to_Force.com_Sites" target="_blank">link</a> will already solve your problem. But for those who prefer using the simple web-to-lead form you can use CURL with PHP to reprocess the data being submitted and submit it to salesforce. In this example I'm using <strong>PHP</strong> with <strong>cURL</strong> and <strong>ReCaptcha</strong>. This is just basic PHP coding.
<br /><br /><br/>

<span style="color: #993300;"><strong>The Basic Form</strong></span><br /><br />First is the sf form created by <span style="color: #993366;">Web-to-Lead</span> on App Setup and editing some parts<br /><br />In action form https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8 change this to the php page you want to reprocess the data<br /><br />Some of the fields I used are custom fields for some reason salesforce generate name with <span style="text-decoration: underline;"><span style="color: #f30b1d;">number at the beginning</span></span> which will cause a lot of trouble with <span style="color: #f30b1d;">javascript</span> and <span style="color: #f30b1d;">php</span> when trying to use it with in your code.<br /><br />So you need also to rename some input datafield with name has number at the beginning, in this case 00N40000001oHG5 I change it to From_Link and 00N40000001pyzT for Region <br /><br />Add the recaptcha field at the end of your form before submit.<br /><span style="color: #333333;">&lt;? echo recaptcha_get_html($publickey); ?&gt;
<br />


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;form action=&quot;check-this-first.php&quot; method=&quot;post&quot;  name=&quot;emailForm&quot; id=&quot;test&quot; style=&quot;padding: 0px; margin: 0px;&quot; &gt;
&lt;input type=hidden name=&quot;oid&quot; value=&quot;00D40000000IUAQ&quot;&gt;
&lt;input type=hidden id=&quot;From_Link&quot; maxlength=&quot;255&quot; name=&quot;From_Link&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$cameFrom</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;  /&gt; &lt;!-- came from link  //--&gt;
&lt;input type=hidden id=&quot;Campaign_ID&quot; name=&quot;Campaign_ID&quot; value=&quot;701400000005waD&quot;&gt; &lt;!-- Google Ad Words //--&gt;
&lt;input type=hidden id=&quot;recordType&quot; name=&quot;recordType&quot; value=&quot;0124000000014Ed&quot;&gt; &lt;!-- Google Ad Words //--&gt;
&lt;input type=hidden name=&quot;retURL&quot; value=&quot;http://www.thankyoupage.com/merci-beaucoup&quot;&gt;
  &lt;table&gt;
    &lt;tr&gt;
      &lt;td &gt;First Name: &lt;br /&gt;
      &lt;input  style=&quot;width:200px;&quot; id=&quot;first_name&quot; maxlength=&quot;40&quot; name=&quot;first_name&quot; size=&quot;20&quot; type=&quot;text&quot;/&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td &gt;Last Name: &lt;br /&gt;
      &lt;input  style=&quot;width:200px;&quot; id=&quot;last_name&quot; maxlength=&quot;80&quot; name=&quot;last_name&quot; size=&quot;20&quot; type=&quot;text&quot; /&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td &gt;Email:&lt;br /&gt;
        &lt;input  style=&quot;width:200px;&quot; id=&quot;email&quot; maxlength=&quot;80&quot; name=&quot;email&quot; size=&quot;20&quot; type=&quot;text&quot; /&gt;&lt;/td&gt;
    &lt;/tr&gt;
&nbsp;
     &lt;tr&gt;
      &lt;td &gt;Company:&lt;br /&gt;
      &lt;input  style=&quot;width:200px;&quot; id=&quot;company&quot; maxlength=&quot;40&quot; name=&quot;company&quot; size=&quot;20&quot; type=&quot;text&quot; /&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
&nbsp;
&nbsp;
&nbsp;
    &lt;tr&gt;
      &lt;td &gt;Country: &lt;br /&gt;
        &lt;input  style=&quot;width:200px;&quot; id=&quot;country&quot; maxlength=&quot;40&quot; name=&quot;country&quot; size=&quot;20&quot; type=&quot;text&quot; /&gt;
       &lt;/td&gt;
    &lt;/tr&gt;
     &lt;tr&gt;
      &lt;td &gt;Region: &lt;br /&gt;
&lt;select  id=&quot;Region&quot; name=&quot;Region&quot; title=&quot;Region&quot;&gt;&lt;option value=&quot;North America&quot;&gt;North America&lt;/option&gt;
&lt;option value=&quot;South America&quot;&gt;South America&lt;/option&gt;
&lt;option value=&quot;EMEA&quot;&gt;EMEA&lt;/option&gt;
&lt;option value=&quot;APAC&quot;&gt;APAC&lt;/option&gt;
&lt;/select&gt;&lt;/td&gt;
    &lt;/tr&gt;
&nbsp;
&nbsp;
      &lt;tr&gt;
&nbsp;
      &lt;td align=&quot;left&quot; &gt;
      &lt;span class=&quot;style1 style2&quot;&gt;Verify Code:&lt;br /&gt;
&nbsp;
        &lt;br /&gt;
        &lt;!-- Captcha//--&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?</span>
&nbsp;
<span style="color: #b1b100;">echo</span> recaptcha_get_html<span style="color: #009900;">&#40;</span><span style="color: #000088;">$publickey</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
         <span style="color: #000000; font-weight: bold;">?&gt;</span> 
        &lt;!-- Captcha //--&gt;&lt;/td&gt;
    &lt;/tr&gt;
&nbsp;
    &lt;tr&gt;
&nbsp;
      &lt;td&gt;
      &lt;br /&gt;&lt;br /&gt;
      &lt;input type=&quot;submit&quot; name=&quot;submit&quot;&gt;
         &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
&lt;/form&gt;</pre></td></tr></table></div>




<br /><br /><br/>

<span style="color: #993300;"><strong>Applying the reCaptcha</strong></span> - <strong><span style="color: #fc022f;">STOP SPAM READ BOOKS(Seriously Spammers!) </span></strong><br /><br />Now After submitting the form it will check first if the captcha is right. You may need to put the code below - at the head of your php page where the data will be process first, or you might want to read this first on how to use reCaptcha with PHP <a href="http://code.google.com/apis/recaptcha/docs/php.htm" target="_blank">http://code.google.com/apis/recaptcha/docs/php.html</a>
<br />


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #990000;">ob_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">session_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'recaptcha/recaptchalib.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
         <span style="color: #666666; font-style: italic;">//Recaptcha Settings</span>
       <span style="color: #000088;">$publickey</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;xxxx&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// you got this from the signup page</span>
	   <span style="color: #000088;">$privatekey</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;xxxx&quot;</span><span style="color: #339933;">;</span>
&nbsp;
       <span style="color: #990000;">extract</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
       <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$submit</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>  <span style="color: #666666; font-style: italic;">//if its sumbitted</span>
&nbsp;
        <span style="color: #000088;">$resp</span> <span style="color: #339933;">=</span> recaptcha_check_answer <span style="color: #009900;">&#40;</span><span style="color: #000088;">$privatekey</span><span style="color: #339933;">,</span>
                                <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;REMOTE_ADDR&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
                                <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;recaptcha_challenge_field&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
                                <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;recaptcha_response_field&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$ok</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$resp</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">is_valid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//if captcha is  invalid</span>
			  <span style="color: #000088;">$ok</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>  
			<span style="color: #009900;">&#125;</span>
&nbsp;
	        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ok</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>	
               <span style="color: #666666; font-style: italic;">//Put here the data for sf leads storing</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
			  <span style="color: #666666; font-style: italic;">// Message here that the captcha was invalid </span>
			<span style="color: #009900;">&#125;</span>	
       <span style="color: #009900;">&#125;</span> 
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>



<br /><br /><br/>

<span style="color: #993300;"><strong>Appying cURL</strong></span><br /><br />Now appying Using cURL, to be able to do this - your server should be running cURL library, taking the idea from David Walsh on how to post via cURL method <a href="http://davidwalsh.name/execute-http-post-php-curl" target="_blank">http://davidwalsh.name/execute-http-post-php-curl</a>, notice on $fields array I used the field name 00N40000001oHG5 for $From_link and 00N40000001pyzT for $Region, so once the data are being submitted it will check first in this sample php code before submitting it to salesforce's site.<br /><br />So here is the full listing for submission to <strong>salesforce</strong> site.
<br />


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span> 
&nbsp;
<span style="color: #990000;">ob_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">session_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'recaptcha/recaptchalib.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
         <span style="color: #666666; font-style: italic;">//Recaptcha Settings</span>
       <span style="color: #000088;">$publickey</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;xxxx&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// you got this from the signup page</span>
	   <span style="color: #000088;">$privatekey</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;xxxx&quot;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
	<span style="color: #666666; font-style: italic;">//curl method posting</span>
	<span style="color: #666666; font-style: italic;">//extract data from the post</span>
      <span style="color: #990000;">extract</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$submit</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000088;">$ok</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
		 <span style="color: #000088;">$resp</span> <span style="color: #339933;">=</span> recaptcha_check_answer <span style="color: #009900;">&#40;</span><span style="color: #000088;">$privatekey</span><span style="color: #339933;">,</span>
                                <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;REMOTE_ADDR&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
                                <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;recaptcha_challenge_field&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
                                <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;recaptcha_response_field&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$resp</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">is_valid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			  <span style="color: #000088;">$ok</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ok</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>		
		<span style="color: #666666; font-style: italic;">//set POST variables</span>
		<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8'</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$fields</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
					<span style="color: #0000ff;">'oid'</span><span style="color: #339933;">=&gt;</span>urlencode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$oid</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
					<span style="color: #0000ff;">'Campaign_ID'</span><span style="color: #339933;">=&gt;</span>urlencode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$Campaign_ID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
					<span style="color: #0000ff;">'00N40000001oHG5'</span><span style="color: #339933;">=&gt;</span>urlencode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$From_Link</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
					<span style="color: #0000ff;">'recordType'</span><span style="color: #339933;">=&gt;</span>urlencode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$recordType</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
					<span style="color: #0000ff;">'retURL'</span><span style="color: #339933;">=&gt;</span>urlencode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$retURL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
					<span style="color: #0000ff;">'first_name'</span><span style="color: #339933;">=&gt;</span>urlencode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$first_name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
					<span style="color: #0000ff;">'last_name'</span><span style="color: #339933;">=&gt;</span>urlencode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$last_name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
					<span style="color: #0000ff;">'email'</span><span style="color: #339933;">=&gt;</span>urlencode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
					<span style="color: #0000ff;">'company'</span><span style="color: #339933;">=&gt;</span>urlencode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$company</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
					<span style="color: #0000ff;">'00N40000001pyzT'</span><span style="color: #339933;">=&gt;</span>urlencode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$Region</span><span style="color: #009900;">&#41;</span>
				<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//url-ify the data for the POST</span>
		<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fields</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$fields_string</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$key</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'='</span><span style="color: #339933;">.</span><span style="color: #000088;">$value</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
		<span style="color: #990000;">rtrim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fields_string</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'&amp;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//print_r($fields_string);</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//open connection</span>
		<span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//set the url, number of POST vars, POST data</span>
		<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span>CURLOPT_URL<span style="color: #339933;">,</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span>CURLOPT_POST<span style="color: #339933;">,</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fields</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span>CURLOPT_POSTFIELDS<span style="color: #339933;">,</span><span style="color: #000088;">$fields_string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//execute post</span>
		<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//close connection</span>
		<span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">//if ok</span>
	<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
			  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;h4&gt;Sorry - Invalid Captcha &lt;/h4&gt;&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>	
&nbsp;
&nbsp;
 <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">//if submit.</span>
 <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>



<br /><br /><br/>]]></content:encoded>
			<wfw:commentRss>http://malebolgia.shadowsonawall.net/code-programming/captcha-with-salesforce.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="1" length="" type="" />
		</item>
		<item>
		<title>ZendFramework PublicPath</title>
		<link>http://malebolgia.shadowsonawall.net/code-programming/zendframework-publicpath.html</link>
		<comments>http://malebolgia.shadowsonawall.net/code-programming/zendframework-publicpath.html#comments</comments>
		<pubDate>Fri, 10 Dec 2010 20:35:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding/Programming]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ZendFramework]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[public path]]></category>

		<guid isPermaLink="false">http://malebolgia.shadowsonawall.net/?p=498</guid>
		<description><![CDATA[Solution - in this forum http://stackoverflow.com/questions/2003101/zend-and-htaccess

So I won't forget how to fix this. when I encounter the problem again]]></description>
			<content:encoded><![CDATA[Solution - in this forum <a href="http://stackoverflow.com/questions/2003101/zend-and-htaccess" target="_blank">http://stackoverflow.com/questions/2003101/zend-and-htaccess</a>
<br /><br />
So I won't forget how to fix this. when I encounter the problem again]]></content:encoded>
			<wfw:commentRss>http://malebolgia.shadowsonawall.net/code-programming/zendframework-publicpath.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="1" length="" type="" />
		</item>
		<item>
		<title>Joomla 1.5 Article Trash</title>
		<link>http://malebolgia.shadowsonawall.net/code-programming/php/joomla-1-5-article-trash.html</link>
		<comments>http://malebolgia.shadowsonawall.net/code-programming/php/joomla-1-5-article-trash.html#comments</comments>
		<pubDate>Sun, 05 Dec 2010 05:53:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Joomla 1.5 Component]]></category>
		<category><![CDATA[Joomla 1.5 Core]]></category>

		<guid isPermaLink="false">http://malebolgia.shadowsonawall.net/?p=422</guid>
		<description><![CDATA[While debugging the component I created I noticed that the query was returning some articles I didn't knew existed. I found out that these articles are just trashed. 
The simple way to separate article trash from active articles is to get the state datafield of the table #__content equals to 1.



1
2
3
4
5
6
7
8
9
10
11
$query = &#34;SELECT a.*, n.*, [...]]]></description>
			<content:encoded><![CDATA[While debugging the component I created I noticed that the query was returning some articles I didn't knew existed. I found out that these articles are just trashed. <br /><br />
The simple way to separate article trash from active articles is to get the<span style="color: #ff0000;"><strong> <span style="text-decoration: underline;">state</span></strong></span> datafield of the table <span style="color: #ff6600;"><strong>#__content</strong></span> equals to <strong>1</strong>.
<br /><br />


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT a.*, n.*, t.*, n.link as linkThisPage&quot;</span>
<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span> FROM #__componentnews_news AS n&quot;</span>
<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span> LEFT JOIN #__content AS a ON a.id = n.pr_id&quot;</span>
<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span> LEFT JOIN #__componentnews_types AS t ON t.id = n.type_id&quot;</span>
<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span> WHERE ( a.state = 1 )&quot;</span>
<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span> AND ( a.publish_up = &quot;</span> <span style="color: #339933;">.</span><span style="color: #000088;">$database</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Quote</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$nullDate</span><span style="color: #009900;">&#41;</span> 
<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; OR a.publish_up &lt;= &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$database</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Quote</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$now</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;)&quot;</span>
<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span> AND ( a.publish_down = &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$database</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Quote</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$nullDate</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; OR a.publish_down &gt;= &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$database</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Quote</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$now</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; )&quot;</span>
<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span> ORDER BY <span style="color: #006699; font-weight: bold;">$orderby</span>&quot;</span>
<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span> limit <span style="color: #006699; font-weight: bold;">$skip</span>,&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$count</span><span style="color: #339933;">;</span></pre></td></tr></table></div>



<br />
Where in this <em>query</em> <span style="color: #800000;"><strong>. "\n WHERE ( a.state = 1 )" </strong></span> should do it.
]]></content:encoded>
			<wfw:commentRss>http://malebolgia.shadowsonawall.net/code-programming/php/joomla-1-5-article-trash.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="1" length="" type="" />
		</item>
		<item>
		<title>PNG upload/resize trouble</title>
		<link>http://malebolgia.shadowsonawall.net/code-programming/png-uploadresize-trouble.html</link>
		<comments>http://malebolgia.shadowsonawall.net/code-programming/png-uploadresize-trouble.html#comments</comments>
		<pubDate>Sat, 25 Sep 2010 13:14:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Coding/Programming]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[cakephp component]]></category>
		<category><![CDATA[imagepng]]></category>
		<category><![CDATA[PHP new version]]></category>

		<guid isPermaLink="false">http://malebolgia.shadowsonawall.net/?p=402</guid>
		<description><![CDATA[While updating a component I got from cakePHP (Image Resize/Upload) I found out that it was not for my current version of PHP - it has trouble uploading PNG type image, I'm getting "Warning (2): imagepng() [function.imagepng]: gd-png:  fatal libpng error: zlib error" This error only occur on servers with PHP v5.1.x or newer... [...]]]></description>
			<content:encoded><![CDATA[While updating a component I got from cakePHP (Image Resize/Upload) I found out that it was not for my current version of PHP - it has trouble uploading PNG type image, I'm getting "<span style="color: #ff0000;"><strong>Warning (2): imagepng() [function.imagepng]: gd-png:  fatal libpng error: zlib error</strong></span>" This error only occur on servers with PHP v5.1.x or newer... so the simple solution from the code... 

<br /><br />
from


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">imagepng</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cropped</span><span style="color: #339933;">,</span><span style="color: #000088;">$filename</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">80</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>



to


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">imagepng</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cropped</span><span style="color: #339933;">,</span><span style="color: #000088;">$filename</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>



<br />
The third parameter is for the quality of the image to be uploaded so for png it only supports from 0 - 9, above that it will cause warnings and errors.
]]></content:encoded>
			<wfw:commentRss>http://malebolgia.shadowsonawall.net/code-programming/png-uploadresize-trouble.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="1" length="" type="" />
		</item>
		<item>
		<title>Cake using Multiple Select Checkboxes</title>
		<link>http://malebolgia.shadowsonawall.net/code-programming/cake-using-multiple-select-checkboxes.html</link>
		<comments>http://malebolgia.shadowsonawall.net/code-programming/cake-using-multiple-select-checkboxes.html#comments</comments>
		<pubDate>Thu, 03 Dec 2009 02:26:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Coding/Programming]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[explode function]]></category>
		<category><![CDATA[form helper]]></category>
		<category><![CDATA[implode function]]></category>
		<category><![CDATA[multiple select checkboxes]]></category>

		<guid isPermaLink="false">http://malebolgia.shadowsonawall.net/?p=150</guid>
		<description><![CDATA[A sample on how to use multiple select checkbox within cakephp views and controller.
&#160;

After reviewing the http://api.cakephp.org/file/cake/libs/view/helpers/form.php#method-FormHelperselect 
1.) Inserting to database
-View Decleration Example.


1
2
3
4
5
6
7
8
9
10
11
 &#60;?php 
//add.ctp for example
?&#62;
     &#60;em&#62;How would you describe your job (mark as many as applies):   &#60;/em&#62;
           [...]]]></description>
			<content:encoded><![CDATA[<p>A sample on how to use <span style="color: #333300;"><strong>multiple select checkbox</strong></span> within cakephp views and controller.</p>
<p>&nbsp;</p>

<p>After reviewing the <strong><a href="http://api.cakephp.org/file/cake/libs/view/helpers/form.php#method-FormHelperselect" target = "_blank">http://api.cakephp.org/file/cake/libs/view/helpers/form.php#method-FormHelperselect</a></strong></p> <br />
<p><strong><span style="color: #993300;">1.) Inserting to database</span></strong></p>
<p>-View Decleration Example.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #666666; font-style: italic;">//add.ctp for example</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
     &lt;em&gt;How would you describe your job (mark as many as applies):   &lt;/em&gt;
           <span style="color: #000000; font-weight: bold;">&lt;?php</span>       <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">input</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'describeJob'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span>
                                                    <span style="color: #0000ff;">'div'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span>
                                                    <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'select'</span><span style="color: #339933;">,</span>
                                                    <span style="color: #0000ff;">'multiple'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'checkbox'</span><span style="color: #339933;">,</span>
                                                    <span style="color: #0000ff;">'legend'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'false'</span><span style="color: #339933;">,</span>
                                                    <span style="color: #0000ff;">'options'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Physical'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Physical'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Mental'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Mental'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Stressful'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Stressful'</span><span style="color: #339933;">,</span>  <span style="color: #0000ff;">'Easy-going'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Easy-going'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Secure'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Secure'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Non-secure'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Non-secure'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Exhausting'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Exhausting'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Relaxing'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Relaxing'</span> <span style="color: #009900;">&#41;</span>
                                                      <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>




<p>-On your controller. Use implode php function and add a seperator that you like, for this example I use ","</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #000000; font-weight: bold;">&lt;?php</span> 
 <span style="color: #666666; font-style: italic;">//job_controller @add() function</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Job'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'describeJob'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Job'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'describeJob'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Job</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>



<p><br /> <span style="color: #993300;"><strong>2.) Editing part, Retrieving values of the datafield to mark check on those were choosen before.  <br /><span style="color: #D83E1C;"> -View Decleration Example. In this example I used explode function of php directly in the view, notice the <span style="color: #4B692D;"> <em>"selected"</em> </span> option added in to the $form-&gt;input helper, this will get the values, supposed to be check in that field.</span></strong></span></p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #666666; font-style: italic;">//edit.ctp for example</span>
       <span style="color: #000088;">$piecesJob</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #339933;">,</span>  <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Job'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'describeJob'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
             <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">input</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'describeJob'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span>
                                                    <span style="color: #0000ff;">'div'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span>
                                                    <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'select'</span><span style="color: #339933;">,</span>
                                                    <span style="color: #0000ff;">'multiple'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'checkbox'</span><span style="color: #339933;">,</span>
                                                    <span style="color: #0000ff;">'legend'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'false'</span><span style="color: #339933;">,</span>
                                                    <span style="color: #0000ff;">'options'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Physical'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Physical'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Mental'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Mental'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Stressful'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Stressful'</span><span style="color: #339933;">,</span>  <span style="color: #0000ff;">'Easy-going'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Easy-going'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Secure'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Secure'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Non-secure'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Non-secure'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Exhausting'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Exhausting'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Relaxing'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Relaxing'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                                                    <span style="color: #0000ff;">'selected'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$piecesJob</span>   <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>



<p><strong>That's it</strong> <img src='http://malebolgia.shadowsonawall.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://malebolgia.shadowsonawall.net/code-programming/cake-using-multiple-select-checkboxes.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cake Baking Models &#8211; Cannot see other tables</title>
		<link>http://malebolgia.shadowsonawall.net/code-programming/cake-baking-models-cannot-see-other-tables.html</link>
		<comments>http://malebolgia.shadowsonawall.net/code-programming/cake-baking-models-cannot-see-other-tables.html#comments</comments>
		<pubDate>Sun, 08 Nov 2009 02:57:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Coding/Programming]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[tabke]]></category>

		<guid isPermaLink="false">http://malebolgia.shadowsonawall.net/?p=131</guid>
		<description><![CDATA[
Problem.After I updated the database, I added 1 table; relate it to another table, and go to the command line to bake what I did, after typing "cake bake model" at the command prompt, I found out that the recently added table was not listed.

&#160;
Reason.Cake caches your model schema. Solution.1.) Clear your cache by deleting all files [...]]]></description>
			<content:encoded><![CDATA[
<p><strong><span style="color: #ff0000;">Problem.</span></strong><br />After I updated the database, I added 1 table; relate it to another table, and go to the command line to bake what I did, after typing "<span style="color: #993300;"><em>cake bake model</em></span>" at the command prompt, I found out that the recently added table was not listed.</p>
<p><a href="http://malebolgia.shadowsonawall.net/wp-content/uploads/2009/11/cake-table-large.jpg"><img class="size-full wp-image-130" title="Cake PHP Bake Model Problem" src="http://malebolgia.shadowsonawall.net/wp-content/uploads/2009/11/cake-table-smal.jpg" alt="Cake PHP Bake Model Problem" width="200" height="101" /></a></p>
<p>&nbsp;</p>
<p><strong><span style="color: #800000;">Reason.</span></strong><br />Cake caches your model schema. <br /><br /><strong><span style="color: #99cc00;">Solution.</span></strong><br />1.) <br />Clear your cache by deleting all files in your app's <strong><span style="color: #333300;"><span style="text-decoration: underline;">tmp/cache/models/</span></span></strong> <br /><span style="color: #333300;"><strong><span style="text-decoration: underline;">and tmp/cache/persistent/</span></strong></span><br /><br />2.) <br />Disable caching in your app's config/core.php // make sure to enable back again in production setup</p>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Turn off all caching application-wide.  *  
 */</span>  
Configure<span style="color: #339933;">::</span><span style="color: #004000;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Cache.disable'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>



<p>After doing the solution, I can now successfully bake the new table.</p>
]]></content:encoded>
			<wfw:commentRss>http://malebolgia.shadowsonawall.net/code-programming/cake-baking-models-cannot-see-other-tables.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Work Telephone: Paypal Sandbox</title>
		<link>http://malebolgia.shadowsonawall.net/code-programming/work-telephone-paypal-sandbox.html</link>
		<comments>http://malebolgia.shadowsonawall.net/code-programming/work-telephone-paypal-sandbox.html#comments</comments>
		<pubDate>Fri, 21 Nov 2008 10:10:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding/Programming]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Paypal Sandbox]]></category>
		<category><![CDATA[Phone Number]]></category>

		<guid isPermaLink="false">http://malebolgia.shadowsonawall.net/?p=94</guid>
		<description><![CDATA[Work Telephone: The phone number is not properly formatted. 
&#13; And I'm only trying this for Registering&#160; &#34;Business Account&#34; on sandbox.
&#13; 
&#13; This link would help click here
&#13;

&#13; &#160; Try using this format&#160; xxx yyy zzzz (308 555&#160;1234) to get past the code&#160;and get into the account. Then once in the account, you can update [...]]]></description>
			<content:encoded><![CDATA[<b><span style="color: rgb(153, 51, 0);">Work Telephone: The phone number is not properly formatted. </span></b><br />
&#13; And I'm only trying this for Registering&nbsp; &quot;Business Account&quot; on sandbox.<br />
&#13; <br />
&#13; This link would help <a href="http://www.paypaldeveloper.com/pdn/board/message?board.id=basicpayments&amp;thread.id=1195&amp;view=by_date_ascending&amp;page=9">click here</a><br />
&#13;
<p style="background-color: rgb(192, 192, 192);"><br />
&#13; &nbsp; <span style="font-size: small;"><b><i>Try using this format&nbsp; xxx yyy zzzz (308 555&nbsp;1234) </i></b><i>to get past the code&nbsp;and get into the account. Then once in the account, you can update the account information to the correct phone number through Profile> phone number.</i><br />
&#13; <br />
&#13; &nbsp; Frank I.<br />
&#13; &nbsp; PayPal Certified Developer<br />
&#13; &nbsp; PayPal PayWatch Analyst<br />
&#13; &nbsp; http://www.paypaldeveloper.com<br />
&#13; &nbsp; PayPal, an eBay Company</span><span style="font-size: smaller;"><br />
&#13; <br />
&#13; </span></p>
&#13; <b><span style="color: rgb(153, 51, 0);">The Social Security Number you entered cannot be validated.</span></b><br />
&#13; <br />
&#13; This link would help <a href="http://www.pdncommunity.com/pdn/board/message?board.id=sandbox&amp;message.id=2979">click here</a><br />
&#13;
<p style="background-color: rgb(192, 192, 192);"><br />
&#13; &nbsp; <span style="font-size: small;">A social security number needed to be added. <b>This can be done by you, the number must start with '111'</b>. <br />
&#13; <br />
&#13; &nbsp; Frank I. <br />
&#13; &nbsp; PayPal Certified Developer <br />
&#13; &nbsp; PayPal PayWatch Analyst <br />
&#13; &nbsp; http://www.paypaldeveloper.com <br />
&#13; &nbsp; PayPal, an eBay Company <br />
&#13; <br />
&#13; <br type="_moz" />
&#13; </span></p>]]></content:encoded>
			<wfw:commentRss>http://malebolgia.shadowsonawall.net/code-programming/work-telephone-paypal-sandbox.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CMSMS FrontEnd User Hack&#8230;</title>
		<link>http://malebolgia.shadowsonawall.net/code-programming/cmsms-frontend-user-hack-for-automatic-login.html</link>
		<comments>http://malebolgia.shadowsonawall.net/code-programming/cmsms-frontend-user-hack-for-automatic-login.html#comments</comments>
		<pubDate>Tue, 30 Sep 2008 05:29:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding/Programming]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Automatic Login]]></category>
		<category><![CDATA[CMSMS FrontEnd User]]></category>

		<guid isPermaLink="false">http://malebolgia.shadowsonawall.net/?p=51</guid>
		<description><![CDATA[CMSMS FrontEnd User Hack for Automatic Login 

The following step by step method I did Integrating CMSMS and amember for automatic login
&#13; 
&#13; Current Version of FrontEndUsers plugin is 1.5.2
&#13; CMSMS Version 1.4.1
&#13; 
&#13; For Session - I used&#13;

&#13; &#160;&#160;&#160; $_SESSION['fe_user_logged_in'] //- just passing a non sense string   not important.
&#13; &#160;&#160;&#160; $_SESSION['fe_int_username'] //- [...]]]></description>
			<content:encoded><![CDATA[<strong>CMSMS FrontEnd User Hack for Automatic Login</strong> <br />

The following step by step method I did Integrating CMSMS and amember for automatic login<br />
&#13; <br />
&#13; Current Version of <span style="color: rgb(153, 51, 0);"><b>FrontEndUsers</b></span> plugin is 1.5.2<br />
&#13; <span style="color: rgb(0, 128, 128);"><b>CMSMS</b></span> Version 1.4.1<br />
&#13; <br />
&#13; <b><span style="color: rgb(128, 0, 0);">For Session - I used</span></b><span style="font-size: smaller;">&#13;
<p style="background-color: rgb(192, 192, 192);"><br />
&#13; &nbsp;&nbsp;&nbsp; $_SESSION['fe_user_logged_in'] //- just passing a non sense string <img src='http://malebolgia.shadowsonawall.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  not important.<br />
&#13; &nbsp;&nbsp;&nbsp; $_SESSION['fe_int_username'] //- passing username value<br />
&#13; &nbsp;&nbsp;&nbsp; $_SESSION['fe_int_password'] //- passing password value<br />
&#13; &nbsp;</p>
&#13; <span style="color: rgb(255, 0, 0);"><i><span style="font-size: larger;">Note: I used Custom Session variables, cause on my current project I used 4 different apps to pass this session variables... If you are only integrating cmsms on amember, I advice that you get the session of amember</span><span style="font-size: larger;"> username and password.</span></i></span><span style="color: rgb(0, 128, 128);"><b><span style="font-size: larger;"><br />
&#13; <br />
&#13; CMSMS</span></b></span><span style="font-size: larger;"><br />
&#13; Front End User Login</span><br />
&#13; </span> -----------------------------------------------------------------------------------------------------<br />
&#13; <b>1</b>.)at [<span style="color: rgb(51, 51, 0);">index.php</span>] root of cmsms<br />
&#13; add <b><span style="color: rgb(255, 102, 0);">session_start();</span></b> at the beginning<br />
&#13; <br />
&#13; over modules folder find<br />
&#13; <span style="color: rgb(153, 51, 0);"><i>FrontEndUsers</i></span> folder<br />
&#13; <br />
&#13; <b>2</b>.)Injecting the Sessions<br />
&#13; <br />
&#13; on - [<span style="color: rgb(51, 51, 0);">action.do_login.php</span>]<br />
&#13; <br />
&#13; find (could be) on line 80:<br />
&#13;
<p style="background-color: rgb(192, 192, 192);"><span style="font-size: smaller;">&nbsp;&nbsp;&nbsp;&nbsp; <br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; $this->Audit( 0, $this->Lang('friendlyname'),<br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; $this->Lang('frontenduser_loggedin').&quot;: &quot;.$params['feu_input_username'] );<br />
&#13; <br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; //<br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; // we're logged in<br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; //<br />
&#13; <br />
&#13; </span></p>
&#13; put these following code at bottom of it:&#13;
<p style="background-color: rgb(192, 192, 192);"><span style="font-size: smaller;">&nbsp;&nbsp;&nbsp;&nbsp; <br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; /* Custom Login Session */<br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; $_SESSION['fe_user_logged_in'] = &quot;logged_in&quot;; // store session data<br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; $_SESSION['fe_int_username'] = $params['feu_input_username']; //username<br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; $_SESSION['fe_int_password'] = $params['feu_input_password']; //password<br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; session_write_close();<br />
&#13; <br />
&#13; </span></p>
&#13; <b>3</b>.)Erasing the Session<br />
&#13; <br />
&#13; on - [<span style="color: rgb(51, 51, 0);">action.logout.php</span>]<br />
&#13; <br />
&#13; find (could be) on line 53:<br />
&#13;
<p style="background-color: rgb(192, 192, 192);">&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-size: smaller;"><span style="background-color: rgb(192, 192, 192);"> <br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; $this->SendEvent( 'OnLogout', $parms );<br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; $this->_SendNotificationEmail('OnLogout',$parms);<br />
&#13; <br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; // we're logged out<br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; // redirect somewhere <br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; // todo, add more options here.<br />
&#13; </span></span></p>
&#13; put these following code at bottom of it:<span style="font-size: smaller;">&#13;
<p style="background-color: rgb(192, 192, 192);"><br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; /* Custom Logout Session */<br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; $_SESSION['fe_user_logged_in'] = NULL; // store session data as NULL<br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; $_SESSION['fe_int_username'] = NULL;<br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; $_SESSION['fe_int_password'] = NULL;<br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp; session_write_close();<br />
&#13; &nbsp;</p>
&#13; </span><b>4</b>.)This is not necessary but if you want to custom design or name on your login boxes you can edit the hard code at:<br />
&#13; <br />
&#13; [<span style="color: rgb(51, 51, 0);">function.user_loginform.php</span>]<br />
&#13; <br />
&#13; Like in this case I added some javascript on input boxes and also changed the class style.<br />
&#13;
<p style="background-color: rgb(192, 192, 192);"><span style="font-size: smaller;"><br />
&#13; /*<br />
&#13; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $smarty->assign('input_username', <br />
&#13; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this->CreateInputText( $id, 'feu_input_username',<br />
&#13; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; $username,<br />
&#13; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this->GetPreference('usernamefldlength'),<br />
&#13; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this->GetPreference('max_usernamelength')));<br />
&#13; */&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />
&#13; <br />
&#13; &nbsp;&nbsp;&nbsp; $smarty->assign('input_label', $id );<br />
&#13; &nbsp;&nbsp;&nbsp; $smarty->assign('id_password',$id.'feu_input_password');<br />
&#13; &nbsp;&nbsp;&nbsp; $smarty->assign('prompt_password', $this->Lang('prompt_password'));<br />
&#13; <br />
&#13; &nbsp;&nbsp;&nbsp; $smarty->assign('input_password', '&lt;input type=&quot;password&quot; name = &quot;' .$id.&nbsp; 'feu_input_password&quot; class=&quot;passwordfield&quot; <br />
&#13; <br />
&#13; &nbsp;&nbsp;&nbsp; onfocus=&quot;this.style.backgroundImage=\'none\'&quot; onblur=&quot;if(this.value==\'\'){this.style.backgroundImage=\'url(images/login-password.gif)\'}&quot;  />');<br />
&#13; <br />
&#13; /*<br />
&#13; <br />
&#13; </span></p>
&#13; <br />
&#13; <br />
&#13; <br />
&#13; <br />]]></content:encoded>
			<wfw:commentRss>http://malebolgia.shadowsonawall.net/code-programming/cmsms-frontend-user-hack-for-automatic-login.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joomla 1.5 phpbb bridge bug fixed</title>
		<link>http://malebolgia.shadowsonawall.net/code-programming/joomla-1-5-phpbb-bridge-bug-fixed.html</link>
		<comments>http://malebolgia.shadowsonawall.net/code-programming/joomla-1-5-phpbb-bridge-bug-fixed.html#comments</comments>
		<pubDate>Wed, 06 Aug 2008 09:59:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding/Programming]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[phpbb bridge]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://malebolgia.shadowsonawall.net/?p=92</guid>
		<description><![CDATA[*This happens when you verify the account through mail.
&#13; In /plugins/user/phpbb3.php, replace line 92:
&#13; 
&#13; from
&#13; &#160;&#160;&#160; if(!isset($userid)) {
&#13; 
&#13; to
&#13; &#160;&#160;&#160; if (( ! isset( $userid )) &#124;&#124; ( strlen( $userid ) == 0 )) {&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // it's set, but has no value
&#13; 
&#13; Forum Source
&#13; ]]></description>
			<content:encoded><![CDATA[*This happens when you verify the account through mail.<br />
&#13; In /plugins/user/phpbb3.php, replace line 92:<br />
&#13; <br />
&#13; <b>from</b><br />
&#13; <span style="background-color: rgb(255, 255, 153);"><span style="color: rgb(0, 51, 0);">&nbsp;&nbsp;&nbsp; if(!isset($userid)) {</span></span><br />
&#13; <br />
&#13; <b>to</b><br />
&#13; <span style="color: rgb(0, 51, 0);"><span style="background-color: rgb(255, 255, 153);">&nbsp;&nbsp;&nbsp; if (( ! isset( $userid )) || ( strlen( $userid ) == 0 )) {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // it's set, but has no value</span></span><br />
&#13; <br />
&#13; <a target="_blank" href="http://www.rocketwerx.com/forum/viewtopic.php?f=22&amp;t=807&amp;st=0&amp;sk=t&amp;sd=a&amp;sid=292265e94dfac323c1f1affc7a216be9&amp;start=40">Forum Source</a><br />
&#13; <br />]]></content:encoded>
			<wfw:commentRss>http://malebolgia.shadowsonawall.net/code-programming/joomla-1-5-phpbb-bridge-bug-fixed.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

