Sunday, 24 March 2019
Website Login Page HTML
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, 22 March 2019
Insert record in Database
This post will help you to learn the basics of inserting the record in the database using ci framework.
Table Structure
Culumn_Name
|
Data_type
|
Id
|
Auto number(int)
|
Name
|
Varchar(50)
|
Email
|
Varchar(50)
|
Phone
|
Varchar(15)
|
Msg
|
Varchar(255)
|
Configure Database
Goto App (Application in older CI) folder then open Config folder then Database.php file change db parameter as per your configuration.
Database.php
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'username',
'password' => 'password',
'database' => 'db_name',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production') ,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'dsn' => '',
'hostname' => 'localhost',
'username' => 'username',
'password' => 'password',
'database' => 'db_name',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production') ,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
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.
Sunday, 3 March 2019
File upload with new name (PHP)
This post will help you to upload an image file to server with A new name . File name will be database auto increment field value . So no name conflict will be arise.
function SaveSliderImage($file)
{
$stmt = $this->conn->stmt_init();
if ($stmt->prepare("insert into ueks98_si_jsj_os9 (id,id1,id2) values(NULL,?,?)"))
{
//Get File Extension
$tmpstr=strtolower($_FILES[$file]['name']);
$extnsn=end(explode(".",$tmpstr));
function SaveSliderImage($file)
{
$stmt = $this->conn->stmt_init();
if ($stmt->prepare("insert into ueks98_si_jsj_os9 (id,id1,id2) values(NULL,?,?)"))
{
//Get File Extension
$tmpstr=strtolower($_FILES[$file]['name']);
$extnsn=end(explode(".",$tmpstr));
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.
Show file on HTML page using file control
This post will help you to show preview of selected file from html file control because by default HTML file control only show the selected file name. So file preview is best way to show user that whether he is selected right file or not.
HTML
<input type="file" id="bfile" id="bfile" class="form-control" accept="image/x-png,image/jpeg" onChange="readURL(this)">
<br><img id="blah" style="margin:auto;display:block" />
<br><img id="blah" style="margin:auto;display:block" />
JS
function readURL(input) {
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.
Subscribe to:
Posts (Atom)