Popular recipes by imam ferianto http://code.activestate.com/recipes/users/633541/2014-09-09T09:35:32-07:00ActiveState Code RecipesPrint Directly from web application to POS/EPS thermal printer (PHP)
2014-09-01T14:55:56-07:00imam feriantohttp://code.activestate.com/recipes/users/633541/http://code.activestate.com/recipes/578925-print-directly-from-web-application-to-poseps-ther/
<p style="color: grey">
PHP
recipe 578925
by <a href="/recipes/users/633541/">imam ferianto</a>
(<a href="/recipes/tags/kasir/">kasir</a>, <a href="/recipes/tags/network/">network</a>, <a href="/recipes/tags/over/">over</a>, <a href="/recipes/tags/php/">php</a>, <a href="/recipes/tags/pos/">pos</a>, <a href="/recipes/tags/printer/">printer</a>, <a href="/recipes/tags/tiketing/">tiketing</a>).
Revision 2.
</p>
<p>this php script will printout barcode label directly from the web by phpscript</p>
print qrcode to usb termal RP80 printer from web base app (PHP)
2014-09-09T09:35:32-07:00imam feriantohttp://code.activestate.com/recipes/users/633541/http://code.activestate.com/recipes/578930-print-qrcode-to-usb-termal-rp80-printer-from-web-b/
<p style="color: grey">
PHP
recipe 578930
by <a href="/recipes/users/633541/">imam ferianto</a>
(<a href="/recipes/tags/php/">php</a>, <a href="/recipes/tags/printing/">printing</a>, <a href="/recipes/tags/qrcode/">qrcode</a>).
</p>
<p>this script will print qrcode from php script.
the printer is attached on webserver usb port,
see my other article here:
<a href="http://code.activestate.com/recipes/578925-print-directly-from-web-application-to-poseps-ther/" rel="nofollow">http://code.activestate.com/recipes/578925-print-directly-from-web-application-to-poseps-ther/</a></p>
<p>and python escpos references:
<a href="https://code.google.com/p/python-escpos/wiki/Usage" rel="nofollow">https://code.google.com/p/python-escpos/wiki/Usage</a></p>
php backwards compatibility porting tips (PHP)
2013-02-10T00:40:26-08:00imam feriantohttp://code.activestate.com/recipes/users/633541/http://code.activestate.com/recipes/578452-php-backwards-compatibility-porting-tips/
<p style="color: grey">
PHP
recipe 578452
by <a href="/recipes/users/633541/">imam ferianto</a>
(<a href="/recipes/tags/backwards/">backwards</a>, <a href="/recipes/tags/compatibility/">compatibility</a>, <a href="/recipes/tags/old/">old</a>, <a href="/recipes/tags/php4/">php4</a>, <a href="/recipes/tags/php5/">php5</a>).
</p>
<p>Hello again, on december 2012, I was porting my old php code (php4) to new php 5.4.3.
There are to many errors within code, especially for session, eregi, global variables and others.
This some pieces step for compatibility porting:</p>
<ol>
<li><p>add global variable definiton on some function that need outside variable
<code>
function getuser(){
global $loginid,$password;
}
</code></p></li>
<li><p>replace eregi(/find/,str) with preg_match(//,str)</p></li>
<li><p>add function exists for function that not exists in php5.4.3.
for example:
<code>
if(!function_exists("session_is_registered")){
function session_is_registered($var){
return isset($_SESSION[$var]);
}
}
if(!function_exists("session_register")){
function session_register($var){
$_SESSION[$var]=$_GLOBALS[$var];
}
}
</code></p></li>
</ol>
<p>Ok there is my tips, how about you? </p>
Protect PHP File that must be include (PHP)
2003-06-24T17:41:18-07:00imam feriantohttp://code.activestate.com/recipes/users/633541/http://code.activestate.com/recipes/207176-protect-php-file-that-must-be-include/
<p style="color: grey">
PHP
recipe 207176
by <a href="/recipes/users/633541/">imam ferianto</a>
(<a href="/recipes/tags/security/">security</a>).
</p>
<p>This Section is describe how we can protect php module that can calling in with include function, but is not secure and its have big risk. For the solution is we can make this module file cannot execute or calling when it's not include, the code simple with test file name. Some study case: we hosting in sites that we cannot protection in dir, regulary we add .htacces
in folder /inc/ I was putin .htacces so if we calling <a href="http://localhost/inc/" rel="nofollow">http://localhost/inc/</a> is displayed forbidden but if I try if we calling <a href="http://localhost/inc/connect-module.php" rel="nofollow">http://localhost/inc/connect-module.php</a> it will be succesfull and maybe some accident will happen here</p>
Making Calendar (PHP)
2003-06-30T14:09:39-07:00imam feriantohttp://code.activestate.com/recipes/users/633541/http://code.activestate.com/recipes/208105-making-calendar/
<p style="color: grey">
PHP
recipe 208105
by <a href="/recipes/users/633541/">imam ferianto</a>
.
</p>
<p>THis section is describe how we can making calendar
but for now I am write in Indonesia date format and
you can modify your self</p>
Making Date Input more interactive Variables for MySQL (PHP)
2003-06-30T14:04:56-07:00imam feriantohttp://code.activestate.com/recipes/users/633541/http://code.activestate.com/recipes/208104-making-date-input-more-interactive-variables-for-m/
<p style="color: grey">
PHP
recipe 208104
by <a href="/recipes/users/633541/">imam ferianto</a>
.
</p>
<p>If we want to store date_column in MySQL we must using
format 'YYYY-MM-DD' but we can build input form for this
tipe. Currenly I making this in Indonesian date but you
can modify your self.</p>
Making Interactive Welcome Text (PHP)
2003-06-30T13:41:18-07:00imam feriantohttp://code.activestate.com/recipes/users/633541/http://code.activestate.com/recipes/208103-making-interactive-welcome-text/
<p style="color: grey">
PHP
recipe 208103
by <a href="/recipes/users/633541/">imam ferianto</a>
.
</p>
<p>In usually we say welcome in our page with simple like "welcome user" adn etc
but I think if we can say like "Hello, good morning user" its more interactive say. It can be done with simple using date() or time function in php.</p>
Displaying Page Processsing Time (PHP)
2003-06-30T14:15:50-07:00imam feriantohttp://code.activestate.com/recipes/users/633541/http://code.activestate.com/recipes/208106-displaying-page-processsing-time/
<p style="color: grey">
PHP
recipe 208106
by <a href="/recipes/users/633541/">imam ferianto</a>
.
</p>
<p>In addition for our page we can displaying information how much
some page processing spend time occurs by measure script time
running. principle is simple with substract time_ending with time_start</p>