• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: [TIPS] url validation function

[TIPS] url validation function 15 years 8 months ago #8251

  • ludo
  • ludo's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
If you want to add a new validation in a form to test if the URL submited is valid or not, just a add the following code into the file /www/components/com_rsform/controller/validation.php
function url($param)
{
    if (!ereg('^^http://([a-zA-Z0-9-]+.)?([a-zA-Z0-9-]+.)?[a-zA-Z0-9-]+\.[a-zA-Z]{2,4}(:[0-9]+)?(/[a-zA-Z0-9-]*)?(.[a-zA-Z0-9]{1,4})?$',$param)){
        return false;
    } else {
        return true;
    }
}
Last Edit: 15 years 8 months ago by ludo.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!