<script> if (document.documentElement.clientWidth > 940) { document.write(‘<img class=”<?php echo “ligncenter size-full “.$imgInfo[$randno][id];?>” src=”<?php echo $imgInfo[$randno][src];?>” title=”<?php echo $imgInfo[$randno][title];?>” alt=”<?php echo $imgInfo[$randno][alt];?>” />’); } </script>
Read MoreCodeIgniter
How to call two or more ajax request parallely in php
<script> $(document).ready(function() { $(document).on(“click”, “._SP12_MR11″, function() { var datastring = {‘DSUC’:SMJX_SMR_SUC,’SRCON’:SMJX_SRCH_ON, ‘LCNT’:SMJX_SMR_LST_CNT,}; $.when( $.ajax({ url:'<?php echo base_url().”search-ax-shwmre-st”;?>’, type: ‘POST’, …
Read MoreIn Show more on click show more button script like this-works
<script> $(document).ready(function() { $(document).on(“click”, “._SP12_SHOWMORE”, function() { var SMJX_SRCH_DPERPG = 5; var SMJX_SMR_SUC = $(“._SP12_SHOWMORE”).attr(‘data-srch-uc’); var SMJX_SMR_LST_CNT = $(“._SP12_SHOWMORE”).attr(‘data-lstcnt’); var SMJX_SRCH_ON …
Read MoreHow to call ajax request one after another in php
<script> $(document).ready(function() { $(document).on(“click”, “._SP12_SHOWMORE”, function() { var datastring = {‘SRCON’:SMJX_ON, ‘LCNT’:SMJX_LST_CNT,}; // FIRST AJAX REQUEST:: $.ajax({ url:'<?php echo base_url().”search-rd”;?>’, type: …
Read MoreHow to check if the request is an AJAX request with PHP
if (!empty($_SERVER[‘HTTP_X_REQUESTED_WITH’]) && strtolower($_SERVER[‘HTTP_X_REQUESTED_WITH’]) == ‘xmlhttprequest’ ) { // This is ajax request. // write your code here. }
Read Morepagination with scroll using ajax
HTML PAGE IS HERE: IN CODEIGNITER:: <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”utf-8″> <title>Show More Testing</title> <style type=”text/css”> ::selection{ background-color: #E13300; color: white; } ::moz-selection{ …
Read Morecount duplicate values in array in php
<?php $name= array(“raj”,”dinesh”,”mota”,”kunal”,”sam”,”kunal”,”raj”,”raj”); $res = array_count_values($name); print_r($res); It shows no. of duplicates found against. like: raj => 3 kunal => 2 dinesh => 1 etc …
Read MoreCodeigniter – no input file specified
Change in .htaccess file: RewriteRule ^(.*)$ index.php/$1 [L] to RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
Read MoreHow to make slug removing whitespaces in php
$data = “new & item @ send to & be”; $data_slug = trim($data); //$search = array(‘/’,’\\’,’:’,’;’,’!’,’@’,’#’,’$’,’%’,’^’,’*’,'(‘,’)’,’_’,’+’,’=’,’|’,'{‘,’}’,'[‘,’]’,'”‘,”‘”,'<‘,’>’,’,’,’?’,’~’,’`’,’&’,’ ‘,’.’); $search = array(‘/’,’\\’,’:’,’;’,’!’,’@’,’#’,’$’,’%’,’^’,’*’,'(‘,’)’,’_’,’+’,’=’,’|’,'{‘,’}’,'[‘,’]’,'”‘,”‘”,'<‘,’>’,’,’,’?’,’~’,’`’,’&’,’.’); $data_slug = str_replace($search, ” “, …
Read Morehow to make an unique array from duplicate value containing array
<?php $allphone = array( ‘11111’, ‘22222’, ‘33333’, ‘44444’, ‘55555’, ‘55555’, ‘66666’, ‘+66666’, ‘77777’, ‘88888’, ‘99999’, ‘00000’); echo “Duplicate value Array: “; echo “<br>”; print_r($allphone); echo …
Read More