This tutorial is intended to introduce you to the CodeIgniter framework and the basic principles of MVC architecture. It will show you how a basic CodeIgniter application is constructed in step-by-step fashion.
Showing posts with label Codeigniter. Show all posts
Showing posts with label Codeigniter. Show all posts
How to display records using database in php using codeigniter framework ?
This tutorial is intended to introduce you to the CodeIgniter framework and the basic principles of MVC architecture. It will show you how a basic CodeIgniter application is constructed in step-by-step fashion.
Codeigniter Tutorial 2: How do i get the select tag value with codeigniter?
How to get a selected option value in your controller in codeigniter Here are steps
company.php in view
<form action="" method="POST">
<select name="company" class="form control">
<option value="1">Employee </option>
<option value="2">HR</option>
<option value="3">Student</option>
</select>
<input type="submit" name="submit" value="Post it">
</form>
or Display from database field list
$cmp_values = $this->db->query("SELECT * from company");
<select name="company" aria-controls="example1" class="form-control" required>
<option value="">Select</option>
<?php foreach($cmp_values->result_array() as $cmpdet){?>
<option value="<?=$cmpdet['com_id']?>"><?=$cmpdet['com_value']?></option>
<?php }?>
</select>
<select name="company" aria-controls="example1" class="form-control" required>
<option value="">Select</option>
<?php foreach($cmp_values->result_array() as $cmpdet){?>
<option value="<?=$cmpdet['com_id']?>"><?=$cmpdet['com_value']?></option>
<?php }?>
</select>
Then in your controller:
Company.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Company extends CI_Controller {
public function index() {
if( $this->input->post) {
echo $this->input->post('company');
}
$this->load->view('company');
}
}
class Company extends CI_Controller {
public function index() {
if( $this->input->post) {
echo $this->input->post('company');
}
$this->load->view('company');
}
}
Subscribe to:
Posts (Atom)
Popular Posts
-
Login form using php,Ajax and jquery with mysql, Redirect one to another page using ajax with return result. Create a index.php and add t...
-
Add a rich text editor/tinymce editor in activity stream instead of the actual textarea (id= #wats-new-textarea”) copy the file with the ...
-
Skype chat integration to the website its very easy and get more customer and relationship with your client.
-
You already have to WordPress website to set up the Contact form and details will directly into your mail account. 1. click...
-
I have a created GiG in FIVVER, GIG is your service which is you can sell in FIVVER, I got many orders from FIVVER. Now, I become level 2...
-
how to form submit on timer/countdown you can pass time through in javascript CountDown(5,div); function, example 10 second pass CountDown(...
-
Get the value of the using the id, define the route of the laravel with id, looking for passing to route to controller as per following. ...
-
Laravel setup in localhost before we need basic requirement to fulfill laravel works, you will need to make sure your server meets the foll...
-
This tutorial is intended to introduce you to the CodeIgniter framework and the basic principles of MVC architecture. It will show you how...
-
Multi-dimensional array - how to sort array by sub array value using array_multisort() and array_map() function. You can sort array asce...