Posts

image upload using jquery ajax when form submit php

   <td><button type="button" class="send_notification" onclick="sendNotification(<?php echo $row['patient_id']; ?>)">SEND</button></td>  function sendNotification(patient_id) {   $('#modal-content').on('shown.bs.modal', function () {         $("#message").focus();     });        $('#modal-content').modal({         show: true     });          $('.notification_submit').click(function(event){          event.preventDefault();           var message= $('#message').val();                       var file_data = $("#file").prop("files")[0];   // Getting the properties of file from file field     var f...

image upload with multiple fields using jquery ajax in php mysql

  <input id="avatar" type="file" name="avatar" /> <button id="upload" value="Upload" />    $(document).on("click", "#upload", function() { var file_data = $("#avatar").prop("files")[0]; // Getting the properties of file from file field var form_data = new FormData(); // Creating object of FormData class form_data.append("file", file_data) // Appending parameter named file with properties of file_field to form_data form_data.append("user_id", 123) // Adding extra parameters to form_data $.ajax({ url: "/upload_avatar", dataType: 'script', cache: false, contentType: false, processData: false, data: form_data, // Setting the data...

dynamic create multiple ckeditor onclick event using jquery

<!DOCTYPE html> <html> <head> <title>New Ckeditor Instance Dynamically</title> <script type="text/javascript" src="ckeditor_3.5/ckeditor/ckeditor.js"></script> <script type="text/javascript" src="scripts/jquery-1.4.4.js"></script> <script type="text/javascript" src="ckeditor_3.5/ckeditor/adapters/jquery.js"></script> <script type="text/javascript"> $(document).ready(function() { $('.jquery_ckeditor').ckeditor(); }); </script> <script> function newCkeditor(){ $('<div><textarea><\/textarea><\/div>') .appendTo('#body').find('textarea').ckeditor(); } function clicked(){ for ( instance in CKEDITOR.instances ){ alert("ckeditor values : " + CKEDITOR.instances[instance].getData()); } } </script> </head> <body...

remove black background when resize image in php

 /* image resize in php when form submit */ if(isset($_POST['submit'])) {   function resize($width, $height){     include('conn.php');     $root=$_POST['root'];    $category=$_POST['category'];    $sub_category=$_POST['sub-category'];   $product_name=$_POST['product_title'];     $product_specification=mysqli_real_escape_string($con,$_POST['product_description']);     list($w, $h) = getimagesize($_FILES['image']['tmp_name']);   $ratio = max($width/$w, $height/$h);   $h = ceil($height / $ratio);   $x = ($w - $width / $ratio) / 2;   $w = ceil($width / $ratio);   $path= '../product_images/'.$width.'x'.$height.'_'.$_FILES['image']['name'];     $product_title= $_POST['product_title'];   $product_description= $_POST['product_description'];    $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";  $actual_link = dirname($actual_link);   $full_...

cron job command for run php script

php -f /home/username/public_html/doctor/mytest.php

checkbox check and uncheck using jquery

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $('[name="day[1]"]').change(function()       {         if ($(this).is(':checked')) {           $('[name="day_1[1]"]').prop("checked",false);           $('[name="day_2[1]"]').prop("checked",false);           $('[name="day_3[1]"]').prop("checked",false);           $('[name="day_4[1]"]').prop("checked",false);           $('[name="day_5[1]"]').prop("checked",false);           $('[name="day_6[1]"]').prop("checked",false);         }; }); $('[name="day_1[1]"]').change(function()       {     ...

appoinment timing system start time and end time

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <style> select{   width: 100px;    display: block;   margin: 10px; } </style> <script> $(document).ready(function(){     $('#one').change(function() {         $('#two').prop('disabled', this.value == '0');         $('#one1').prop('disabled', this.value == '0');         $('#two1').prop('disabled', this.value == '0');         $("#two option").each(function(){           ...