Posts

Showing posts from 2022

How to Insert Data in Database using PHP OOPS Classes and Objects

Image
Insert Data into database using classes and object. Create database and table into you localhost server ( phpmyadmin ) Add fields that you require to insert, i'm doing here users related information name, email, contact, gender, education, address. When you done with table we can work on next step. Create a form inside users.php file where we can get information from user to insert into database. Full Name : Email : Contact no. : Gender : Male   Female Education : Select 10th 12th Graduate Post Graduate Address :   Lets create database connection and class inside functions.php for insert operation and function for insert data into database using mysqli_query. define('DB_HOST','localhost'); define('DB_USER','root'); define('DB_PASS',''); define('DB_NAME','demo'); class dbcon { public $con; public function __construct() { $this->con = mysqli_connect(DB_HOST,DB_USER,DB_P

Step by Step Process For Wordpress Installation on Localhost using Xampp Server

Image
Step by Step Process For Wordpress Installation on Localhost using Xampp Server First download the fresh wordpress zip file by clicking here . and download xampp if you don't have according to your system configuration 32/64 bit by clicking here . After download go to xampp's htdocs folder and create folder with any name and extract your downloaded wordpress zip file there. Go to your favorite browser and run your localhost and go to phpMyAdmin and create new database by clicking on new link on left sidebar with any name and use that database name during installation of wordpress. And for full step follow the given video. If you have any question and error during installation comment me. I will help you to resolve it.

How To Create Your Own Custom Widgets Wordpress

How To Create Your Own Custom Widgets Wordpress Wordpress provide a functionality to create your own custom widgets for this we have function that initilize your widget widgets_init . By using this function you can initilize your custom widget and call them by using dynamic_sidebar('customsidebarwidget') . Let create our own widget function custom_sidebar_widget(){ register_sidebar(array( 'name' => __('Custom Sidebar Widget', 'customsidebarwidget'), 'id' => 'customsidebarwidget', 'description'=> __('Your description about your widget', 'customsidebarwidget'), )); } add_action( 'widgets_init', 'custom_sidebar_widget' ); custom_sidebar_widget it's name of function that you used with widgets_init in Hook i.e. add_action( 'widgets_init', 'custom_sidebar_widget' ) . and inside this function you can describe your widget detail inside re