Skip to main content

Posts

Showing posts with the label codeigniter

special character like " not showing properly in pdf

I using html2fpdf library to generate a pdf in codeigniter .I have some data in a varchar field like " What are your child’s academic strengths? " which is showing like " What are your child’s academic strengths? " . How I can show it as it is in the database .(I have tried htmlspecialchars_decode , html_entity_decode function but it not worked. )

codeigniter non latin characters ajax call

I have a textarea and a button where i send the text via ajax to the database to post it. However when i post non-latin characters... it wont get them and it returns blank... if the text is in latin characters it works fine... my js code $.ajax({ type: "POST", url: www+"controller/postText", dataType: 'json', data: { input : input.val(), }, success: function(data) { return data; } }); my php code public function postText(){ $input = isset($_POST["input"]) ? trim($_POST["input"]) : ""; echo $input; return false; }

matching outputted Html buttons with outputted Php/MySQL data

public function dcr() { $query = $this->db->query("SELECT * FROM church_repo"); foreach ($query->result() as $row) { $data = array('churchName' => $row->church_name, 'streetAddress' => $row->street_address, 'locationalState' => $row->locational_state, 'locationalZIP' => $row->locational_zip, 'locationalCountry' => $row->locational_country, 'locationalCity' => $row->locational_city, 'overseerAccountId' => $row->overseer_account_id, 'taxExemptionNumber' => $row->tax_exemption_number, 'accountStatus' => $row->status, ); $this->load->view('admin-request', $data); } } I

Do I need to write a custom session class for CodeIgniter?

I cannot seem to get CI's session library to function the way I want it to. Essentially, I am storing 2 different categories of data within the sessions. The data within the 2 categories may contain the same value. Right now my attempt to add a key => value pair to the session is failing, as it is only allowing 1 key => value pair to be associated with the array. It overrides itself each time I do a post. $arr = array( 'favorite_products' => array(), 'viewed_products' => array() ); $arr["favorite_products"][] = $fav_id; $this->session->set_userdata($arr); This is what the array looks when I print_r it: Array ( [favorite_products] => Array ( [4f1066c2b7fff] => 1648406 ) [viewed_products] => Array ( )) Am I doing something wrong, or is this just the way CI's session library works?

Keep form values after page reload - Codeigniter

How can I keep checkboxes selected after the form has been submitted? I found the set_checkbox function in the Codeigniter User Guide, but it doesn't work. Form field code from the User Guide <input type="checkbox" name="mycheck" value="1" <?php echo set_checkbox('mycheck', '1'); ?> /> <input type="checkbox" name="mycheck" value="2" <?php echo set_checkbox('mycheck', '2'); ?> /> I also googled this and found a couple of workarounds, but they were based on previous versions of Codeigniter. And they were based on Form Validation, which isn't necessary for my form, because none of the fields are required. How can I retain the checkbox field value after the form is submitted? UPDATE : This question is not about form validation and errors. I want to retain the checkbox field value AFTER the page is reloaded. Is jquery a possibility?