I have an ajax call from javascript to a method in a controller, the method in the controller should be loading a view(like, show a new page on the screen), Although everything seems ok, the new view doesn’t seem to load on the screen. I cannot use header or windows.location because, i am passing an arr…
Tag: codeigniter
Codeigniter: SMTP mail not working
I’m trying to set up a contact form, and I’m struggling to get it working with the SMTP configuration in CI. However I’ve successfully tried with the basic ‘mail’ config. To cut it short, I’m doing …
How to load a controller from another controller in codeigniter?
I want to load a controller from a function in another controller because the library I integrated to my project I don’t want to load it to the controller because I want to keep it clean and related. I tried using modules but I still had to put controller in the url like http://example.com/maincontrolle…
Form validation rules for regex_match
I’m trying to figure out what I’m doing wrong with this validation rule because its saying this error. Validation rule: Error: Severity: Warning Message: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash Answer First, you need to fix your pattern. Your pattern rig…
get the input box ‘name’ using javascript
I am making form in PHP and submitting using javascript. I want to get the name of input box, As normal coding gives the value of the input box, but i need to get name of input box. Without onclick functionality on it. Can it possible that retrieving the name of input box in other javascript function on click…
codeigniter flatten array of query result
I’m using a query in Codeigniter to return the ids of all the rows that belong to a user. This returns Is it possible to return a flat array like ? Answer The CodeIgniter documentation (most particularly, query results) doesn’t list anything that will produce a flat array result (like the PDO::FET…
Perfect way to encrypt & decrypt password, files in PHP?
I did a series of research on this topic, but unfortunately I couldn’t find a perfect way to encrypt and decrypt files in PHP. Which mean what I’m trying to do is find some way to encrypt & decrypt my items without worry of cracker knew my algorithm. If some algorithm that need to secrete &…
Unable to access an error message corresponding to your field name
I have a callback function that check_captcha which sees if $row is ==0 or == 1 (this information is queried from sql). The problem is that I can not call it from $self->form_validation->set_rule(‘captcha’, ‘call_back_check_captcha’) due to the fact that my function takes in a $r…
PHP multipart form data PUT request?
I’m writing a RESTful API. I’m having trouble with uploading images using the different verbs. Consider: I have an object which can be created/modified/deleted/viewed via a post/put/delete/get request to a URL. The request is multi part form when there is a file to upload, or application/xml when …
Codeigniter empty $_POST & $_FILES
I’m using Plupload to manage file uploads for my site. When I configure Plupload to post to the following test file, the records are shown correctly, however when I post to a CI controller, both $…