What is causing this error message when using search module?
You are declaring my_form function in two places somewhere in your block / view / Node where you are using php as filter. That is causing above issue.

Since you see above issue only in search page it should be an issue with blocks that are enabled in search page or search content...

Search in your database with keywords my_form using phpmyadmin or some other tool on all tables that will give you an idea from where the php code is getting executed !