codeigniter

PHP only displaying first word of string in table

青春壹個敷衍的年華 提交于 2019-12-24 15:59:00
问题 I'm dynamically creating a table from a MySQL query. For some reason, the 'notes' field below is only returning the first word of the string, although when I test it with echo($notes) it shows up just fine. $status is similarly set, and also is fine. What am I missing? I assume it has something to do with prepopulating the text field with the value. I'm using codeigniter. $notes = empty($row["notes"]) ? "None" : $row["notes"]; echo($notes); echo(' <tr class="even"> <td class="status-icons">'.

codeigniter and form submit

空扰寡人 提交于 2019-12-24 15:49:58
问题 I am trying to get used to Codeigniter. I am sorry if that is a trivial or dumb question but I have been struggling to have the "News Section" of Codeigniter's tutorial work. There is this form (from here) <h2><?php echo $title; ?></h2> <?php echo validation_errors(); ?> <?php echo form_open('news/create'); ?> <label for="title">Title</label> <input type="input" name="title" /><br /> <label for="text">Text</label> <textarea name="text"></textarea><br /> <input type="submit" name="submit"

Cookie not working with Login System CodeIgniter

会有一股神秘感。 提交于 2019-12-24 15:48:32
问题 I have implemented a basic login system using CodeIgniter. I am using the sessions library to control access to a members only section. I can log in and view this area no problem. However when I delete my cookies and refresh the members only section page I can still see the content. I am not displaying a login message to the user. I don't know why this is happening. Any ideas? This is my Site.php controller class Site extends CI_Controller{ function _construct(){ parent::_construct(); $this-

Facebook SDK breaking Codeigniter? Blank page

梦想与她 提交于 2019-12-24 15:33:39
问题 I have tested my login script on my localhost with no problems. I have now uploaded it online as can be seen at this link Obviously if you click, you can see that a blank page is displayed and I have no idea why. I did a test of a little bit of content, and removed the Facebook SDK code. //Facebook config (required for library) $fb_config = array( 'appId' => 'REMOVED', 'secret' => 'REMOVED' ); //Load Facebook library $this->load->library('facebook', $fb_config); //SET FACEBOOK USER $fbuser =

Date validation in codeigniter

随声附和 提交于 2019-12-24 15:30:32
问题 I have three select option list for month,day and year <?php echo form_dropdown('dob[month]',$dates['months'],set_value('dob[month]','0'));?> <?php echo form_dropdown('dob[day]',$dates['days'],set_value('dob[day]','0'));?> <?php echo form_dropdown('dob[year]',$dates['years'],set_value('dob[year]','0'));?> To validate if the entered date by the user is valid or not i am using the following rules: $this->form_validation->set_rules('dob','date of birth','valid_dob'); Where valid_dob is a

get td values display as static in codeigniter

耗尽温柔 提交于 2019-12-24 15:30:31
问题 Hi guys i am trying to display the first td values as static so i have keep those values in one array and i try to increase the values and try to display but when i get it is displaying depending on foreach values if i have one record in foreach it is displaying one value and if i have 2 records it is displaying 2 values. But i want to display all td value if i have values in foreach or not also. Here is my code: <tbody> <?php $arr = array(0=>'On Hold',1=>'Asset Incomplete',2=>'SME Discussion

Strange characters when using pound sign

一笑奈何 提交于 2019-12-24 15:27:25
问题 I've already got this line in my header.. <meta http-equiv="content-type" content="text/html; charset=utf-8"> I have an input form and when I enter a pound sign £ it's coming out with a strange character before it. The values are stored in the database and then displayed but the problem seems to be before we even get to the database. If I submit my form and then print_r the $_POST array I get: [field2_title] => £ Question I thought the issue might be with the code igniter $this->input->post(

Codeigniter Form Validation - Is there a way to define multiple different %s when setting error messages?

淺唱寂寞╮ 提交于 2019-12-24 15:17:59
问题 Based on the documentation, %s will be replaced by field name when setting error messages. If you include %s in your error string, it will be replaced with the "human" name you used for your field when you set your rules. Is there a way to have multiple %s in the string and define them differently? 回答1: This is the line in the form validation library that creates the error message: // Build the error message $message = sprintf($line, $this->_translate_fieldname($row['label']), $param); $line

Codeigniter cannot refresh page after session destroy and direct

≡放荡痞女 提交于 2019-12-24 15:11:40
问题 I have a PHP program written on code igniter that needs your help! Have been trying for 3 weeks! I have the htaccess mod rewrite to make http://www.sampleurl.com/controllername instead of http://www.sampleurl.com/index.php/controllername <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0 [PT,L] </IfModule> <IfModule !mod_rewrite.c> # If we don't have mod_rewrite installed, all 404's # can be sent to

How to update existing record using codeIgniter

那年仲夏 提交于 2019-12-24 15:08:52
问题 I have a table like this: id , image , user_id . The user_id is saved from the session. The same user wants to update his profile picture means, how it will update? This Is Controller Function public function save() { $session_data = $this->session->userdata('logged_in'); $uid= $session_data['id']; //print_r($uid);exit; $url = $this->do_upload(); $this->load->model('user_model'); $this->user_model->save($url,$uid); echo '<script>alert("You Have Successfully Uploaded your Profile Picture!");<