Posts

Showing posts with the label PHP

PHP CRUD Application Using Functions - View

Image
From our previous article we went through the way of  entering data to the database using php functions. If your are not familiar with it visit  PHP CRUD Application Using Functions-Insert  to get to know about it. Now lets create the User View in the same file. I have made some changes to the insert form to make it look nice. Code for the new form is given below <div class="row">     <hr> </div> <div class="col-md-2"></div> <div class="col-md-8"> <div class="panel panel-default">   <div class="panel-body">   <h2>Add New User</h2> <form action="" method="POST">   <div class="form-group">     <label for="exampleInputEmail1">Name</label>     <input type="text" class="form-control" id="exampleInputEmail1" placeholder="Name" name="name">   <...

PHP CRUD Application using functions - Insert

Image
Hey Everyone. When developing a website using PHP, it is essential to develop it as a CRUD application.This article will show you how to insert form data into database using php with the help of functions. First we should create our front view and the database to continue further. Creating the front view We should create a project folder in our root folder.Since I am using Wamp server, I'll create it in the www folder. Next we should create a another folder called views to store the view files. Now I have created a php file called Home.php to create the front view. Now my folder structure will be like , Now to create the view I am using Bootstrap to make it interactive. Copy the CDN link from the  Bootstrap Guide  and paste it in between <head> tag. Now I will copy  Form Template  from the CSS in the Bootsrap site and paste it in between <body> tag. <form>   <div class="form-group"> ...

CodeIgniter Directory Structure

Image
This article will give you a detailed description on the codeigniter folder structure which will help you to know the theoretical concepts when developing. Once you download the  codeigniter framework  , you can extract it and save it in your project folder. Now the folder structure will be shown as follows. In here we basically focus on the three main folders (application,system and user_guide) and the index.php file. index.php index.php is the php file where the request is sent to the controller which comes from the web browser. user guide folder User guide folder is considered to be the offline version of documentation. Following diagram contains the CodeIgniter User guide online documentation user_guide folder contains same information which is there in the online documentation system folder All the CodeIgniter functionalities and database connections are stored in system folder. It basically contain all the CodeIgniter libraries....

Google Charts - Pie chart

Image
When you develop a PHP web site for an organization or for a specific requirement, you will need to keep a track of reports. So Google Charts will help you to elaborate the graphical representations in order to get a more clear report . Following example will clearly show you the way of creating a pie chart using google charts. Now the data should be added to database table as below. Then search  Google charts for pie charts  from your web browser. From here by using the given codes you can create either a pie charts or a Donut  chart. Now what you have to do is simply copy the given code in to your text editor and edit the necessary parts to create your pie charts. Now add the sql query with the database connection to select the data in the table. Above image will show you the changes I have made to get the pie chart according to above example. In the head you will have to write the database connection and the sql query ...

Tips in PHP

Image
You may have face lot of issues when using pure php to develop your web application.This article will give you some of the issues you get. Issue 1 : Breaking the date into date,month and day separately. You can split your date into date,month and day separately by using the following code. $current_date="2017-08-27"; list($year,$month,$day) = explode('-', $current_date); In here the date will be broken and assigned to $year,$month and $day separately from "-" sign.Here you have to make sure to give the correct format relevant with variables. Similarly you can break any other strings and assigned to separate variables using this method. To be Continue