Posts

Google Adsense alternative for Sri Lankans

Hi, I found difficult to get Adsense to local content .However WP beginner post assist me a lot . http://www.wpbeginner.com/beginners-guide/make-money-online/?utm_source=retargeting&utm_medium=fbads#make-money-with-affiliate-marketing But there are others like amazon. One of good guide : https://www.wpsitecare.com/amazon-affiliate-wordpress/

Url encode decode anchor links with AngularJS PHP

Image
I had following link  in one of rest call which lead to SQL unexpected result due to & symbol. http://localhost/test/getDsv?$top=32&$skip=0&var=HR & Admin&com= Query has only considered  var=HR   only  which leads to unexpected results. My front end is anguler and I can encode the perticulter paramenter with  window . encodeURIComponent() Ref : http://stackoverflow.com/questions/11294107/how-can-i-send-the-ampersand-character-via-ajax To Decode it at PHP side there in nothing to do ,although there are lot of posts ,which indicate decoding. $this->_request['var']; http://stackoverflow.com/questions/11294107/how-can-i-send-the-ampersand-character-via-ajax

ICT AL - Dynamic and Static Web Pages

Image
Copyrights Goes to :https://web.facebook.com/alits.lk/?_rdc=1&_rdr

jQery Serialize Form Explicitly

Image
                                                In order to pass the HTML controls without using submit button. HTML  <div class="col-md-12"><button type="button" id="reject" class="form-control  btn-info " onclick="reject()" >Reject</button></div>                       js                                function reject() {                                                var fromdata=$('#detailform');                             ...

Apache enable MOD_REWRITE for PHP Rest API

Image
Hi Im woarking with follwing expample which illustrate how to create REST Api form genic PHP http://www.tutorialsface.com/2016/02/simple-php-mysql-rest-api-sample-example-tutorial/ However I  need to set MOD_REWRITE for the API folder in Wamp and Follwing steps need to follow to achive it . 1.Go to apache  http.conf in WAMP apache folder ,and open it 2. Make a backup of http.conf   3.  Find the line #LoadModule rewrite_module modules/mod_rewrite.so and uncomment it by removing hash. 4.ADD the rule as below for the APi folder . in my case its MI_API (there will be block like below mapped to WAP ,www folder ,you can edit it as nesosary) <directory C:/wamp/www> Options All   AllowOverride All </directory> Thanks  for : https://webdevdoor.com/php/mod_rewrite-windows-apache-url-rewriting

Oracle Varchar2 DateTime Experassions - yyyy-mm-dd HH24:MI:SS

There is a verchar2 Date Time Filed  in the table which now need to get Results with the given rnage eg : up to 3 days of the past from today. Eg Field DONE_TIME SELECT  * substr(DONE_TIME,0,19) FROM EG_TABLE Convert to date : SELECT  *  TO_DATE(substr(DONE_TIME,0,19),'yyyy-mm-dd HH24:MI:SS') FROM EG_TABLE Reduce From the System Time : SELECT  *  (systimestamp-TO_DATE(substr(substr(DONE_TIME,0,19),0,19), 'yyyy-mm-dd HH24:MI:SS')) FROM EG_TABLE RANGE Comparison  : WHERE trunc(to_number(substr((systimestamp-TO_DATE(substr(substr(DONE_TIME,0,19),0,19), 'yyyy-mm-dd HH24:MI:SS')),1,instr(systimestamp-TO_DATE(substr(substr(DONE_TIME,0,19),0,19), 'yyyy-mm-dd HH24:MI:SS'),' '))))>3

jQuery Ajaz to check if returned data object is empty

Image
In one of my jQuery Ajax Request ,I need to check wehter quary  return  empty results. $ . post ( "php/socialbookmark-post.php" , { bookmarkID : $ ( this ). val ()}, function ( data ) { if ( data != "" ) alert ( data ); });   data !== 'undefined' && data !== '' not worked Properly and Stack OverFlow also not given good answer. I observed, If empty data set  returned , the full block will not executed. http://stackoverflow.com/questions/2589558/jquery-to-check-if-returned-data-object-is-empty But refffering to jQuery I able to come up with solid answer. http://api.jquery.com/jQuery.ajax/ By defult we inherit the sucess method (done ) and if empty data set returned it will go (fail).     $.post("./testURL" function (o) {                                 ...