Saturday, April 25, 2020

After Image path pass variable value wordpress

http://localhost/extend05/wp-content/uploads/2019/06/linksys-basic.jpg?pramod=1587816842


function add_jpeg_params($content){

preg_match_all("/https?:\/\/[^\/\s]+\/\S+\.(jpg|jpeg)/", $content, $output_array);

$items_to_replace = array_unique($output_array[0]);
$items_to_replace = array_values($items_to_replace);

for ($j = 0; $j < sizeof($items_to_replace); $j++) {

    $content = str_replace($items_to_replace[$j], $items_to_replace[$j] . '?pramod=' . time(), $content);
}

return $content;
}
add_filter('the_content','add_jpeg_params',10);
add_filter('post_thumbnail_html', 'add_jpeg_params' );

Friday, March 6, 2020

Nexmo send message using PHP

<?php

/* Nexmo send message using PHP  send-sms-api*/

    $ch = curl_init('https://platform.clickatell.com/messages/http/send?apiKey=xxxxxxxxxxx==&to=xxxxxxxxxxxx&content=hello test message');
    curl_setopt($ch, CURLOPT_POST, true);

    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);


 curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);


?>

Monday, February 3, 2020

Page refresh only one time using jquery:

<script type='text/javascript'>

(function()
{
  if( window.localStorage )
  {
    if( !localStorage.getItem('firstLoad') )
    {
      localStorage['firstLoad'] = true;
      window.location.reload();
    } 
    else
      localStorage.removeItem('firstLoad');
  }
})();

</script>

Tuesday, January 21, 2020

CSV data attachment using PHP Mysqli

This summary is not available. Please click here to view the post.

Delete table data using ajax file php Mysqli

<span id="new_select2" style="color:green;text-align:center;font-weight:bold;"></span> // Show div

  onchange="fetch_select2(this.value);"  //Click Function

<script type="text/javascript">
function fetch_select2(val)
{
$.ajax({
type: 'post',
url: 'https://sasnagar.co.in/ezboxes//wp-content/themes/Divi/delete_calender_date.php?del_id=<?php $del_date_id= $row_pack["id"]; echo $del_date_id; ?>',
data: {
 get_option1:val
},
success: function (response) {
 document.getElementById("new_select2").innerHTML=response;
}
});
}
$('#new_select2').delay(5000).fadeOut('slow');
</script>