Thursday, 28 July 2022
PHP Date Manipulation
Convert Date in dd/mm/yyyy (28-07-2022) format coming from database.
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Monday, 11 July 2022
Google Recaptcha Integration | PHP , ASP.NET C# , Codeiginater 4
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Wednesday, 6 July 2022
Google Captcha Integration in Codeiginater 4
Step 1 :
Signup to Google Recaptcha and get the public and private key.
Step 2 :
Make a Model named CaptchaResponse in Model folder and add the given code below.
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Monday, 4 July 2022
Delete from database in Codeiginater 4
Function
public function DelContact($field,$val)
{
$db = new ContactModel();
$db->where($field,$val)->delete();
return redirect()->to(site_url('admin/contact'));
}
Calling
<a href="<?php echo
site_url('admin/DelContact/ID/123'); ?>" onclick="return
confirm('Are you sure to delete this record')">
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Saturday, 2 July 2022
Get Data through Model in Codeigniter 4
Table Structure
Model
<?php
namespace App\Models;
use CodeIgniter\Model;
class ContactModel extends Model
{
protected $table='holywebcontact';
protected $primaryKey = 'ID';
protected $allowedFields = ['ID', 'Name', 'Phone', 'Message', 'CreatedDate'];
}
Controller
<?php
namespace App\Controllers;
use App\Models\ContactModel;
class Home extends BaseController
{
public function dataread()
{
$data['title'] = 'DB Get Demo';
$crudModel = new ContactModel();
$data['user_data'] = $crudModel->findAll();
return view('tmp2', $data);
}
}
$data["model"]=$album->where('AlbumID', $aid)->findAll();
Get All record with ouder by clause
$data=$GalleryModel->orderBy('ID', 'DESC')->findAll();
View
<?php
foreach ($model as $item)
{
echo $item["ID"] . "," . $item['Name'] . "<br>";
}
?>
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Friday, 1 July 2022
Record Save Using Entity Framework
Read Basics of Entity Framework on my previous post for understand this example.
Date Save Code
dbConnection db = new dbConnection();
db.Bill.Add(data);
db.SaveChanges();
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.

