Posts

Showing posts from January, 2013

netbeans 7.2.1 can not start after installing python plugin

codeigniter - user Authentication

Parse error on wp-includes/functions.php

error :
Parse error: syntax error, unexpected T_VARIABLE in /home/dewat913/public_html/soft1/wp-includes/functions.php on line 191

solution :
replace functions.php file with the new one.

source : its work for me.

PHP Shorthand If / Else Examples

Basic True / False Declaration $is_admin = ($user['permissions'] == 'admin' ? true : false);
Basic True / False Declaration echo 'Welcome '.($user['is_logged_in'] ? $user['first_name'] : 'Guest').'!';
Conditional Items Message echo 'Your cart contains '.$num_items.' item'.($num_items != 1 ? 's' : '').'.';
Conditional Error Reporting Level error_reporting($WEBSITE_IS_LIVE ? 0 : E_STRICT);
Conditional Basepath echo '<base href="http'.($PAGE_IS_SECURE ? 's' : '').'://mydomain.com" />';
Nested PHP Shorthand echo 'Your score is: '.($score > 10 ? ($age > 10 ? 'Average' : 'Exceptional') : ($age > 10 ? 'Horrible' : 'Average') );
Leap Year Check $is_leap_year = ((($year % 4) == 0) && ((($year % 100) != 0) || (($year %400) == 0)));
Conditional PHP Redirect header('Locat…

How to Solve Port 80 Problems When Running Apache on Windows

Run an administrator command prompt (e.g. Start, search for cmd, right click on it, choose "Run as administrator", approve the UAC prompt if any.
Type net stop HTTP
If there are other running services that depend on the HTTP service, you'll get a list; double check to see if there's anything listed there you can't bear to do without. Or, if you're just stopping HTTP to use port 80 temporarily, make a note of those dependent services that you'll want to restart once you're done with the port. Either way, if it's okay, enter y to continue.
Some dependent services might throw up stop control warnings that cancel the operation; just repeat net stop HTTP until it is stopped (i.e. until it says The HTTP service was stopped successfully.)
Later on, you can restart any of the dependent services, using net start or by using the Services item in Administrative Tools, and the HTTP service will be started again automatically.

source :
- http://msg…

create read more with php on yii framework

using a simple php code strip_tags and substr

$isi = strip_tags(substr($data->description, 0, 200))."...."; echo $isi; echo CHtml::link('View Detail', array('view', 'id'=>$data->id),array('class'=>'btn btn-success btn-small'));
demo : www.lowongankerja.dewatatech.com

set each textbox value with jquery

potongan jquery sintax : $( document ).on( 'click', '#copyall', function( e ) { var allotment = $('#AllotmentToAll').val(); $('#allotment').each( function() { $('.allotment').val(allotment); }); }); potongan sintax php pada framework yii :
echo CHtml::textField('AllotmentToAll','','',array('id'=>'AllotmentToAll')); echo CHtml::button('Copy To All', array('id'=>"copyall")); $totDay = date('t', strtotime('2013-01')); echo "<br />"; echo "<table border=1>"; echo '<tr>'; for($i=1; $i<=$totDay; $i++){ echo '<td>'; echo "2013-01-$i <br />"; echo CHtml::textField('allotment[]', '', array('id'=>"allotment", 'cla…