How to create relationship from webtocontact registration form?

I have module Meetings and several meetings in it. And i have webtocontacts form for registration to every meeting. And i need the next thing : if a person registred to one meeting the system should create relationship between this contact and the meeting (and show it in a subpanel). And this way with every meeting and registration. I understand that should do it via logic hooks, but can’t get it exactly. Help please!