0

I used form_validation for validate URL by using this code:

 $this->form_validation->set_rules("edtQuestionURL", "Site URL", "trim|required|url");

But every time I run my code, It returns false.

What is my mistake? I made some change in system/Form_validation.php file (I got them from StackOverflow) but it does not work. Please guide me.

Sparky
  • 98,165
  • 25
  • 199
  • 285
  • 3
    *"I made some change in `system/Form_validation.php` file"* ~ What changes? Restore the original version of the file and see if that works? Regardless, you probably broke it and have shown us nothing that would help answer the question. You should **never** edit the core system files. – Sparky Dec 07 '16 at 23:51

1 Answers1

1

Maybe you can try like this

$this->form_validation->set_rules("edtQuestionURL", "Site URL", "trim|required|valid_url");

or this

$this->form_validation->set_rules("edtQuestionURL", "Site URL", "trim|required|prep_url");
M. AmirQ
  • 61
  • 5