Skip to content

Tag: codeigniter

loading a view after an ajax call, CodeIgniter

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…

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…

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 …