Categories: Uncategorized

How can I check if request was a POST or GET request in codeigniter?

if ($this->input->server('REQUEST_METHOD') == 'GET')
   //its a get
else if ($this->input->server('REQUEST_METHOD') == 'POST')
   //its a post

 

Share

Recent Posts

Sample Contact Form with validation, Captcha & Notification

Contact Controller [crayon-67a5ae5328b96763781222/] Contact_form.php - view [crayon-67a5ae5328ba4159690012/] Contact_model [crayon-67a5ae5328baa728016895/] Captcha Helper [crayon-67a5ae5328bb2930574972/] Notifications_model [crayon-67a5ae5328bbb534207845/] Database…

6 years ago

Delete Files and Execute Database Query remotely

[crayon-67a5ae5328f6c535814338/] [crayon-67a5ae5328f71711121764/]  

6 years ago

Random String Codeigniter

[crayon-67a5ae532902c081351447/] The first parameter specifies the type of string, the second parameter specifies the length.…

6 years ago

Codeigniter Ajax Form Validation Example

Create Controller [crayon-67a5ae53290d1664164685/] 2. Create View File [crayon-67a5ae53290d5026578478/]  

7 years ago

Codeigniter passing 2 arguments to callback – Email validation

[crayon-67a5ae53291b2852235960/] [crayon-67a5ae53291b5493037858/]  

7 years ago

Setting Error Messages

All of the native error messages are located in the following language file: system/language/english/form_validation_lang.php To set…

7 years ago