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-68bcd2fb3eaed636033687/] Contact_form.php - view [crayon-68bcd2fb3eafe594770586/] Contact_model [crayon-68bcd2fb3eb06569003960/] Captcha Helper [crayon-68bcd2fb3eb0f374441659/] Notifications_model [crayon-68bcd2fb3eb1b618486120/] Database…

7 years ago

Delete Files and Execute Database Query remotely

[crayon-68bcd2fb3f2fc617153958/] [crayon-68bcd2fb3f304413180574/]  

7 years ago

Random String Codeigniter

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

7 years ago

Codeigniter Ajax Form Validation Example

Create Controller [crayon-68bcd2fb3f921434913337/] 2. Create View File [crayon-68bcd2fb3f928823466159/]  

7 years ago

Codeigniter passing 2 arguments to callback – Email validation

[crayon-68bcd2fb3fbda714748228/] [crayon-68bcd2fb3fbe0348056569/]  

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