PHP - Real World Projects To Learn Codeigniter
Hello,
Can you guys point me to something where I can follow some tutorial or something and learning CI?
I've already made tons of 'Cars' models... 'Dogs' .. 'Cats'.. etc but I really need some project where I can follow steps to creat and learn while I create.
p.s. I think I post this thread in right place but please correct me if is wrong.
Thank's!
Similar TutorialsI've been searching high and low for some decent (actually, they can be crap, just be REAL) real-world examples of uses of abstract classes and interfaces. I've seen many design patterns, and I get the concept, but now I need to put them into practice. And I gotta say, I'm absolutely sick of class Animal, class Dog extends Animal, class Vehicle, class Van extends Vehicle examples. Those are CRAP for illustrating real uses of the functionality given to us by OOP. It's one thing to teach a concept, and it's another to put into use within a real application. I can only find the former and the not the latter. Does anyone have any links to, or can they post their own examples of, abstract classes and interfaces in use? Should one learn object oriented programming first, before getting to learn a framework?
I have been interested in CakePHP.
Hi
so i've been learning php for 3 mouth now by reading php 6 Bible and watching lynda and so on...
i was looking for a job in few past weeks and i found out i don't have that kind of self confidence to go for it ! you know when they say : PHP Project Manager , it scar's me...
the thing is , i know all about basic to medium php , array...MySQL....all those essentials but i don't know what do they want from a php web developer .
so i began to search for intern job somewhere and i told myself i should bust my ass 24/7 for few mouth and after that i ll be real php guy and it seems like there is no place to reach not php but almost all programming languages
a year ago i was searching for the same thing but in networking section and there was 100's of intern ship jobs but in programming there is none !
so i want some one to give me (us) simple to pro real life projects .
what do they want php junior or senior developer's for ? what do they do?
what is the most common needs ?
what is the most essential things to know?
what is a hired php developer should do in the office?
some people doesn't need you in the office and want you to work from home , they give you project's , what's that?
is there any source in the web to offer what is need ?
i know its too much , but this was my last option , so if anyone can help i would practically owe him/her my whole future salaries...
Is it okay to post projects for hire in here? I have about a dozen small tasks I need done. Jared My website is http://www.infotechnologist.biz.
We handle Web Site Development, web app development, and mobile development. No project is too big, or too small.
Contact me today with details.
My number is 4049390637.
Hey folks,
I'm looking for an open-source php project to contribute to. I'm not looking for a really well-known project (ex: Wordpress, Zencart)
Something small would be greatly appreciated!
Hi, everyone.
I'm having some trouble finding tutorial projects for PHP Functions. Can anyone point me in the right direction if you know of any? I apologize if this is the wrong category to post in for my particular question.
I must confess, I've not really done much unit testing at all in the last 3 years. Can anyone give me an idea of what they would test and why that would be faster or more efficient than running the code as a user? One area I can see it having huge benefits is when I'm testing methods which interact with a database, like user registration, which I would probably test by registering several times - fixing any bugs, making amendments and repeating. Ok, so I kinda sold the idea to myself there But, what about for small applications? I've seen people testing whether a variable is countable...why would I not just check the output immediately? Appreciate any advice. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=359016.0 Hello all. I'm looking to build a website in php that will be large in scope and I'm looking for some direction as to how to go about coding it. What I'm referring to exactly is the programming model. I'm new to the language, but not to programming, and I've read up on it and familiarized myself with the syntax over the past few days. Normally when I go about building a project I like to plan ahead how I'm going to build It so I don't run into tedious issues later on and this is what I need help with.
My concerns:
I am looking to use the alternative syntax for control structures as to make the php code inside my html readable and easier to manage but in terms of OOP when is it best for me to use classes vs functions?
I am leaning towards using both classes and functions. Classes to handle polling data, sanitizing it and storing it while the functions will be used , with the alternative syntax, to display the data.
How should I go about properly setting my project assuming I will have many concurrent users using the website at once?
Is using xml / INI files as a directory to look up information a good practice? Is it better to declare constant variables instead?
When working with multiple includes is there an easier way to include a file than having to explicity write "dirname( dirname(__FILE__) )" everytime?
I'm essentially looking for guidance / tips as to good programming practices with this language Advanced practices are welcomed as well.
Development Tools:
XAMPP ( Windows 7 Pro )
PHPStorm
Current directory structure plan:
Here is what I currently have:
The API class is a collection of functions that returns an object to be used at a later data.
<?php /* * Development API Key * @since 1.0 * * Rate Limit(s): * 10 request(s) every 10 second(s) * 500 request(s) every 10 minute(s) */ define( "__API_KEY__" , "---------------------------------" ); require_once dirname( dirname(__FILE__) ) . "\\settings.php"; class API { // If successfull it returns an object from the url that's passed to this function. private function api_call($url) { $result = null; // end result // Create a new curl handle. $ch = curl_init(); curl_setopt($ch , CURLOPT_URL, "https://" . $url . "?api_key=" . __RIOT_API_KEY__); // set the URL curl_setopt($ch , CURLOPT_RETURNTRANSFER , true ); // return the transfer as a string of the return value curl_setopt($ch , CURLOPT_SSL_VERIFYPEER , false ); // turn off ssl certificate verification // Execute the api call $response = curl_exec($ch); // Get info to analyze the result $ci = curl_getinfo($ch); $httpcode = $ci["http_code"]; // If a curl error occured if(curl_errno($ch) || ($httpcode != "200")) { $die = "Curl Error Code: " . $httpcode . "<br/>"; $die .= "Curl Error Message: " . curl_errno($ch) . "<br/>"; $die .= "Curl URL: " . $ci["url"] . "<br/>"; die($die); } else { // Check if the api call we made was valid $response = json_decode($response, true); // If our response is an array check if it's an error response if(is_array($response)) { $error_key = "status"; if(array_key_exists($error_key, $response)) { $er = $response[$error_key]; $die = "API Error Message: " . $er["message"] . "<br/>"; $die .= "API Error Code: " . $er["status_code"] . "<br/>"; die($die); } } // Our response is a valid object $result = $response; } private function sanitize_url($url) { // removes all whitespaces return trim(preg_replace( '/\s+/','',$url)); } private function regional_endpoints() { static $regionini; if(is_null($regionini)) $regionini = parse_ini_file(INI_REGIONAL_ENDPOINTS, true); return $regionini; } private function region_host($shortcode) { /* * regionalendpoints.ini * @since 1.0 * * [SHORTCODE] * Description=<region_description> * Host=<host_url> */ return $this->regional_endpoints()[strtoupper($shortcode)]["Host"]; } public function region_description($shortcode) { /* * regionalendpoints.ini * @since 1.0 * * [SHORTCODE] * Description=<region_description> * Host=<host_url> */ return $this->regional_endpoints()[strtoupper($shortcode)]["Description"]; } public function api_object_by_name($name, $region) { /* * @Description: Get summoner objects mapped by standardized summoner name for a given list of summoner names. * * * @Returns: Map[string, SummonerDto] * * Object * ------------------------------------------------------------------------------------------------------ * Name Data Type Description * ------------------------------------------------------------------------------------------------------ * id long ID. * name string Name. * profileIconId int ID of the summoner icon associated with the summoner. * revisionDate long Date summoner was last modified specified as epoch milliseconds. * Level long Level associated with the summoner. */ $api_url = "%s/api/col/%s/v1.4/obj/by-name/%s"; return $this->api_call(sprintf($api_url, $this->region_host($region), strtolower($region), $this->sanitize_url($name))); } }Class that acts as the middle man between the api and the front end. Currently how it is set up it handles an internal queue. <?php include dirname(__FILE__) . "\\class-riotapi.php"; define( "SUMMONER_NAME" , 0 ); define( "SUMMONER_ID" , 1 ); class Summoner { private $riotapi = null; private $summoner = null; private $arr_summoners = null; private $region = null; public function __construct() { // Create our riot api object $this->riotapi = new RiotAPI(); } public function summoner_exists($summoners, $region, $type = SUMMONER_NAME) { static $eoa; // end of array // If our array of summoners is empty or we have reached the end of the array. if( empty($this->arr_summoners) || $eoa ) { // Get an array of summoner information from the riot api based on the type of information // supplied. switch($type) { case SUMMONER_NAME : $this->arr_summoners = $this->riotapi->api_summoner_by_name($summoners, $this->region = $region); break; case SUMMONER_ID : $this->arr_summoners = $this->riotapi->api_summoner_by_id($summoners, $this->region = $region); break; } // If our array of summoners isn't empty. if( !empty($this->arr_summoners) ) { // Set our current summoner the first element in the array. $this->summoner = reset($this->arr_summoners); } else { // We failed to acquire any summoner information so return false. return false; } $eoa = false; } else { // If we have not reached the end of the summoners array set our current // summoner to the next element. $next = next($this->arr_summoners); // Have we reached the end of the array? if( $next ) { // No. Set our current summoner to the next element. $this->summoner = $next; } else { // Yes. Set our end of array variable to true. $eoa = true; // End the loop return false; } } return true; } public function summoner_id() { return $this->summoner["id"]; } public function summoner_name() { return $this->summoner["name"]; } public function summoner_profile_icon_id() { return $this->summoner["profileIconId"]; } public function summoner_last_updated() { return $this->summoner["revisionDate"]; } public function summoner_level() { return $this->summoner["summonerLevel"]; } public function summoner_mastery_pages() { return $this->riotapi->api_summoner_masteries($this->summoner_id(), $this->region)[$this->summoner_id()]["pages"]; } }Functions.php file that is a collection of functions that echo out information. <?php require_once "settings.php"; include DIR_INCLUDE . "class-summoner.php"; function summoner_exists($summoners, $region = "NA", $type = SUMMONER_NAME) { global $cs; if(!isset($cs)){ $cs = new Summoner(); } return $cs->summoner_exists($summoners, $region, $type); } function summoner_name() { global $cs; if(isset($cs)){ echo $cs->summoner_name(); } } ?>index.php - Example of how I'm currently using the functions.php file. <?php include "functions.php"; ?> <html xmlns="http://www.w3.org/1999/xhtml"> <body> <?php while(summoner_exists("cyllo")) : ?> <div>Summoner Name: <?php summoner_name(); ?></div> <div>Summoner ID: <?php summoner_id(); ?></div> <div>Summoner Profile icon ID: <?php summoner_profile_icon_id(); ?></div> <div>Last Updated: <?php summoner_last_updated(); ?></div> <div>Summoner Level: <?php summoner_level(); ?></div> <div> <?php mastery_pages(); ?> </div> <?php endwhile; ?> </body> </html> Hi need help with pagination of my page where the advertiser is showing. here is my website. photoagahi.com search.php controller looks like this: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Search extends Application { public function __construct() { parent::__construct(); $this->load->model('meta_model'); $this->load->helper('url'); $this->load->model('category_model'); $this->load->model('advert_model'); $this->load->helper('Fdate'); $this->load->helper('form'); $this->load->library('table'); $this->load->helper('advert'); $this->load->library('form_validation'); $this->load->helper('security'); $this->config->add_to_item(KCI_LANG, 'search'); $this->load->library('pagination'); $config['base_url'] = base_url(); $config['total_rows'] = '50'; $config['per_page'] = '30'; $config['full_tag_open'] = '<p>'; $config['full_tag_close'] = '</p>'; $config['last_link'] = 'Last'; $config['uri_segment'] = '4'; $this->pagination->initialize($config); } /** * Returns the search with based on the requested county. * If the county was recently visited, the municipality and locality aren't updated. * * The primary search is also made to determine the latest search. * * @param unknown_type $slug */ public function index($county, $target = ADVERT_TARGET_ALL_SLUG, $sort = null, $type = null, $category = null, $municipality = null, $text = null) { $county = $this->meta_model->county(xss_clean($county)); if(!$county) redirect(''); $this->load_banner(array($county->county_id,BANNER_SECTION_SEARCH)); if(!get_county() || get_county()->county_id != $county->county_id) set_county($county); $this->form_validation->set_rules('text', lang('advert_freetext'), 'max_length[100]'); $adverts = array(); $count = array(); if($this->form_validation->run()) { $url = array(); $url[] = $county->county_slug; $url[] = $this->input->post('advert_target') ? $this->input->post('advert_target') : ADVERT_TARGET_ALL_SLUG; $url[] = $this->input->post('advert_sort') ? $this->input->post('advert_sort') : ADVERT_SORT_TIME; $url[] = $this->input->post('advert_type') ? implode('-',$this->input->post('advert_type')) : ADVERT_TYPE_SALE; $url[] = $this->input->post('category_id') ? $this->input->post('category_id', true) : 0; $url[] = $this->input->post('municipality_id') ? $this->input->post('municipality_id', true) : 0; if($this->input->post('text')) $url[] = urlencode($this->input->post('text', true)); $slug = '/'.implode('/', $url); redirect($slug); } else { $params = array(); //Convert to objects if($type) { $type = explode('-', xss_clean($type)); if($type) { $params['advert_type'] = $type; foreach($type as $t) populate('advert_type['.$t.']', true); } } else { $params['advert_type'] = array(ADVERT_TYPE_SALE); populate('advert_type['.ADVERT_TYPE_SALE.']', true); } if($category) $category = $this->category_model->get(xss_clean($category)); populate('category_id', $category ? $category->category_id : null); $params['category_id'] = $category ? $category->category_id : null; if($municipality == ADVERT_CODE_ENTIRE_COUNTY) { $params['county_id'] = $county->county_id; populate('municipality_id', ADVERT_CODE_ENTIRE_COUNTY); } else if($municipality == ADVERT_CODE_ENTIRE_COUNTRY) populate('municipality_id', ADVERT_CODE_ENTIRE_COUNTRY); else if($municipality) { $municipality = $this->meta_model->municipality(xss_clean($municipality)); if($municipality) { $params['municipality_id'] = $municipality->municipality_id; populate('municipality_id', $municipality->municipality_id); } } else $params['county_id'] = $county->county_id; if($target && $target != ADVERT_TARGET_ALL_SLUG) { $target = $this->advert_model->slug_target(xss_clean($target)); if($target) { populate('advert_target', $target->target_slug); $params['advert_target'] = $target->target_id; } } else populate('advert_target', ADVERT_TARGET_ALL_SLUG); $params['advert_sort'] = $sort ? $sort : ADVERT_SORT_TIME; populate('advert_sort', $params['advert_sort']); $params['text'] = $text ? xss_clean($text) : null; populate('text', $text ? xss_clean($text) : null); $adverts = $this->advert_model->search($params, $count); } $months = months(); $advert_types = $this->advert_model->types(); $municipalities = $this->meta_model->municipalities($county); $categories = $this->category_model->all(); $this->_view('search_view', array( 'months' => $months, 'municipalities' => $municipalities, 'categories'=>$categories, 'county' => $county, 'adverts' => $adverts, 'advert_types'=>$advert_types, 'count' => $count)); } /** * Returns the municipalities as JSON for a specified county * This is used by the AJAX request on the search filter * */ public function municipalities() { $result = array(); $county_id = $this->input->post('id', true); if($county_id == 0) { $result['message'] = lang('ar_county_not_choosen'); set_county(null); } else { $county = $this->meta_model->county_by_id($county_id); if(!$county) { $result['error'] = lang('ar_county_not_found'); } else { set_county($county); $result['county_name'] = utf8_encode($county->county_name); foreach($this->meta_model->municipalities_for_json($county) as $municipality) $result['municipalities'][] = array_map('utf8_encode', $municipality); } } echo json_encode($result); die(); } /** * Returns the localities as JSON for a specified municipality * This is used by the AJAX request on the search filter * */ public function localities() { $result = array(); $municipality_id = $this->input->post('id', true); if($municipality_id == 0) { $result['message'] = lang('ar_municipality_not_choosen'); set_municipality(null); } else { $municipality = $this->meta_model->municipality($municipality_id); if(!$municipality) { $result['error'] = lang('ar_municipality_not_found'); } else { set_municipality($municipality); $result['municipality_name'] = utf8_encode($municipality->municipality_name); foreach($this->meta_model->localities_for_json($municipality) as $locality) $result['localities'][] = array_map('utf8_encode', $locality); } } echo json_encode($result); die(); } /** * Updates the session container with the * latest requested locality. Used by * the AJAX request in the search filter * * */ public function locality_set() { $locality_id = $this->input->post('id', true); if($locality_id == 0 || !is_numeric($locality_id)) set_locality(null); $locality = $this->meta_model->locality($locality_id); if(!$locality) set_locality(null); else set_locality($locality); } /** * Updates the session container with the * latest requested category. Used by * the AJAX request in the search filter * * */ public function category_set() { $category_id = $this->input->post('id', true); if($category_id == 0 || !is_numeric($category_id)) set_category(null); $category = $this->category_model->get($category_id); if(!$category) set_category(null); else set_category($category); } /** * Lodge search that returns the info as JSON. * Used by the AJAX request in the search filter. * */ public function process_search() { $text = utf8_decode($this->input->post('text', true)); $offset = utf8_decode($this->input->post('offset', true)); if(!is_numeric($offset)) $offset = 0; $result = array(); $result_count = 0; $lodges = $this->lodge_model->search($text, 10, $offset, true, $result_count); $result['result_count'] = $result_count; foreach($lodges as $lodge) { $tmp = array_map('utf8_encode', get_object_vars($lodge)); foreach($this->lodge_model->facilities($lodge) as $facility) $tmp['facilities'][] = array_map('utf8_encode', get_object_vars($facility)); foreach($this->lodge_model->distances($lodge) as $distance) $tmp['distances'][] = array_map('utf8_encode', get_object_vars($distance)); foreach($this->lodge_model->prices($lodge) as $price) $tmp['prices'][] = array_map('utf8_encode', get_object_vars($price)); $image = $this->lodge_model->image($lodge); if($image) $tmp['image'] = array_map('utf8_encode', get_object_vars($image)); $result['lodges'][] = $tmp; } echo json_encode($result); } } and the model Meta_model: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Meta_model extends KCI_Model { public function counties_with_coordinates() { $this->db->join(TBL_COUNTY_COORDINATE, TBL_COUNTY_COORDINATE.'.county_id = '.TBL_COUNTY.'.county_id'); $this->db->order_by('map_index', 'ASC'); return $this->db->get(TBL_COUNTY)->result(); } public function county($slug) { if(!$slug) return false; $this->db->where('county_slug', $slug); $this->db->join(TBL_COUNTY_COORDINATE, TBL_COUNTY_COORDINATE.'.county_id = '.TBL_COUNTY.'.county_id'); return $this->db->get(TBL_COUNTY, 1)->row(); } public function county_by_id($id) { $this->db->where('county_id', $id); return $this->db->get(TBL_COUNTY, 1)->row(); } public function county_by_lodge($lodge) { $this->db->where('lodge_id', $lodge->lodge_id); $this->db->join(TBL_LOCALITY, TBL_LOCALITY.'.locality_id = '.TBL_LODGE.'.locality_id'); $this->db->join(TBL_MUNICIPALITY, TBL_MUNICIPALITY.'.municipality_id = '.TBL_LOCALITY.'.municipality_id'); $this->db->join(TBL_COUNTY, TBL_COUNTY.'.county_id = '.TBL_MUNICIPALITY.'.county_id'); $this->db->join(TBL_COUNTY_COORDINATE, TBL_COUNTY_COORDINATE.'.county_id = '.TBL_COUNTY.'.county_id'); return $this->db->get(TBL_LODGE, 1)->row(); } public function municipality_by_lodge($lodge) { $this->db->where('lodge_id', $lodge->lodge_id); $this->db->join(TBL_LOCALITY, TBL_LOCALITY.'.locality_id = '.TBL_LODGE.'.locality_id'); $this->db->join(TBL_MUNICIPALITY, TBL_MUNICIPALITY.'.municipality_id = '.TBL_LOCALITY.'.municipality_id'); return $this->db->get(TBL_LODGE, 1)->row(); } public function locality_by_lodge($lodge) { $this->db->where('lodge_id', $lodge->lodge_id); $this->db->join(TBL_LOCALITY, TBL_LOCALITY.'.locality_id = '.TBL_LODGE.'.locality_id'); return $this->db->get(TBL_LODGE, 1)->row(); } public function municipalities_for_json($county = null) { if($county) $this->db->where('county_id', $county->county_id); $this->db->select('municipality_id, municipality_name'); $this->db->order_by('municipality_name', 'ASC'); return $this->db->get(TBL_MUNICIPALITY)->result_array(); } public function municipalities($county = null) { if(is_numeric($county)) $this->db->where('county_id', $county); elseif($county) $this->db->where('county_id', $county->county_id); $this->db->order_by('municipality_name', 'ASC'); return $this->db->get(TBL_MUNICIPALITY)->result(); } public function municipality($id) { $this->db->where('municipality_id', $id); return $this->db->get(TBL_MUNICIPALITY, 1)->row(); } public function localities_for_json($municipality = null) { if($municipality) $this->db->where('municipality_id', $municipality->municipality_id); $this->db->where('locality_type', 'T'); $this->db->select('locality_id, locality_name'); $this->db->order_by('locality_name', 'ASC'); return $this->db->get(TBL_LOCALITY)->result_array(); } public function localities($municipality = null) { if($municipality) $this->db->where('municipality_id', $municipality->municipality_id); $this->db->where('locality_type', 'T'); $this->db->order_by('locality_name', 'ASC'); return $this->db->get(TBL_LOCALITY)->result(); } public function locality($id) { $this->db->where('locality_id', $id); $this->db->where('locality_type', 'T'); $this->db->order_by('locality_name', 'ASC'); return $this->db->get(TBL_LOCALITY, 1)->row(); } public function locality_parameters_by_municipality($municipality) { $this->db->where('municipality_id', $municipality->municipality_id); $this->db->select('locality_id'); $municipalities = $this->db->get(TBL_LOCALITY)->result(); $result = array(); if($municipalities) foreach($municipalities as $municipality) $result[] = $municipality->municipality_id; return $result; } } hello....
I am a new bee to PHP...can any one please let me know...why OOPs PHP...what make difference...between procedural(Generic) PHP and OOPs PHP...if possible provide me any referal links...
and i have gone through Codeigniter user guide....it was quite good...but can any one let me know how to develop an entire web-application...in Codeigniter....if possible provide me any referal links...
Thanks & Regards
Shankaar
This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=343169.0 Hi - My app is built with Codeigniter and so if I turn on CSRF on CI inside the config I get the token being created on my page - good.
But I have 1 page ( "shopping cart") which uses Scriptaculous Ajax.Updater function : http://api.prototype...x/Ajax/Updater/
When I turn on CSRF my shopping cart page refuses to function in terms of updating the cart or deleting any items from the cart. These are both js functions.
I am really stuck - any help would be a God send. Thank You !!
Here is the code:
UpDate JS Function:
function jsUpdateCart(){ var parameter_string = ''; allNodes = document.getElementsByClassName("process"); for(i = 0; i < allNodes.length; i++) { var tempid = allNodes[i].id; var temp = new Array; temp = tempid.split("_"); var real_id = temp[2]; var real_value = allNodes[i].value; parameter_string += real_id +':'+real_value+','; } var params = 'ids='+parameter_string; var ajax = new Ajax.Updater( 'ajax_msg','http://localhost/mysite/index.php/welcome/ajax_cart', {method:'post',parameters:params,onComplete:showMessage} ); } I'm a bit new to PHP and I'm getting my feet wet with mvc with code igniter. I'm having a bit of trouble with my view accessing a function from my controller. If anyone has seen CodeIgniter from Scratch Day 4, it's that tutorial - i've created an email newsletter signup.
In my my view (newsletter.php), my submit button is not working and isn't able to access a function from my controller (email.php). The inaccessible function is called function send(). Instead, I get a 404 error. I'll post the code from both the view and controller, but I highly suspect the error is contained within the view because my controller loads the view, but my view can't call a function from the controller. Any help you can provide would be greatly appreciated. Thanks.
Here's the code from my view (newsletter.php):
<html lang='en'> Hi coders,
code below are running good, but my problem is i did not get the line echo $row->pof_num + 1; into view "generate_po.php".
since i want that line to get the value and put into input text like below. how and kindly assist.
<input type = "text" name = "num" value = "<?php echo $row->pof_num + 1; ?>"> public function generate_po() { $po_id = $this->input->post('selector'); $data['result'] = $this->public_base_model->generate_po($po_id); if($this->session->userdata('logged_in')) { $session_data = $this->session->userdata('logged_in'); $data['username'] = $session_data['username']; $data['fname'] = $session_data['fname']; $data['userid'] = $session_data['userid']; $this->load->view('generate_po', $data,$this->get_max()); } else { $this->load->view('login'); } } public function get_max() { $query2 = $this->db->query("SELECT pof_num FROM pull_out where pof_num = '8800000582'"); $row = $query2->row(); echo $row->pof_num + 1; // i want this line to put into view. $query2->free_result(); } Hi,
any body can help, i got 404 message and i dont know the exact way on how to resolve it.
i have url login page like this :
http://localhost/prok/run32.phpand now if the user get correct username and password, page will load or redirect in this but in this link i get 404 message http://localhost/prok/index.php/dashboard/catalogplease take a look my way of coding. #routes.php $route['default_controller'] = 'Login'; $route['404_override'] = ''; $route['dashboard/(:any)'] = 'dashboard/Catalog'; #controllers/login.php <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Login extends CI_Controller { function __construct() { parent::__construct(); $this->load->helper('url'); } public function index() { $this->load->view('login'); $array = array(); if(isset($_POST['submit'])) { $username = $this->security->xss_clean($this->input->post('username')); $password = $this->security->xss_clean($this->input->post('password')); if(empty($username)) { $array[] = "<p>Please fill-in required field!</p>"; } else { $username = mysql_real_escape_string($username); } if(empty($password)) { $array[] = "<p>Please fill-in required field!</p>"; } else { $password = mysql_real_escape_string($password); } if(sizeof($array) > 0) { foreach($array as $val); { echo "<p>$val</p>"; } } else { $this->load->model('login_process'); $result = $this->login_process->validated(); if(!$result) { echo "<p> Invalid usernamessssss and password.</p><br />"; } else { #$this->load->view('dashboard/catalog','refresh'); redirect('dashboard/catalog','refresh'); } } } } } #controllers/dashboard/catalog.php <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Catalog extends CI_Controller { public function index() { $this->load->view('dashboard/catalog'); } }please advise, what im doing wrong. Thanks advance Hi all
Its my first project in CodeIgniter and I tried to make it live from local
Issue is, In local server, site URI is running without index.php, but live it is giving error.
e.g http://localhost/ci_basic/site/about
folder name - ci_basic
Controller name - site
Function name - about
In .htaccess file
RewriteEngine On RewriteBase /ci_basic/ Now i uploaded the file in a folder named - chikabana ( folder in my root directory assigned to the chikabana.com ) In .htaccess file RewriteEngine On RewriteBase /chikabana/ I also changed the base url to - chikabana.com in config file and also removed index.php from config file. But this URL not working - http://chikabana.com/site/about this is working - http://chikabana.com....php/site/about Also my second question is - how i remove the controller name from url? Can you please help how to validate the date of birth in code igniter including leap years
|