Posts

Showing posts from April, 2021

Remove anything from table's column in mysql using query

Image
    If you want to remove anything from your table column values. Suppose in yourtable have column name email and all email values have ,(comma). Example : abc@gmail.com, UPDATE YourTable SET ` email ` = REPLACE(` email `, ',' , '' ) WHERE ` email ` like '%,%' ;  

CI4 (Codeigniter 4) redirect function or method

as per CI 4 use return redirect()->to( 'url' ); if you are using route then use return redirect()->route( 'named_route' );

Cron Job Command

 wget -q -O – your_website/pull_gold_rates.php >/dev/null 2>&1

phpmailer not working in online server

  Two things we have to do for sending mail using GMAIL in online : -  1)Allow less secure app  2)DisplayUnlockCaptcha https://accounts.google.com/b/0/displayunlockcaptcha replace 0 with your logged in user number

File size and file type finding in js(javascript)

Image
    < script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js" > </ script > < form action = "upload.php" enctype = "multipart/form-data" method = "POST" id = "uploadform" > < input id = "openFile" name = "img" type = "file" /> </ form >   <script> $( document ).ready( function ( ) { $( '#openFile' ).on( 'change' , function ( evt ) { console .log( this .files[ 0 ].size); ///File size      var filename=   this .files[ 0 ];      extension = filename.split( '/' ).pop();    // File Type Extension       }); });   </script>    ------------------------------------------------------------------------------- <form id="form1" runat="server"> <input type='file' id="imgInp" /> <img id="blah" src="#" alt="your image...