I’m trying my luck here. I am currently developing a website wherein people should be able to send a message and add a user as a friend from that person’s profile page. I have a button, namely [Add as friend] using the basic <button></button> clauses. What would be the best workaround to do this?
For example, I’d like the SQL statment: INSERT into friends (uid, fid, isapproved) VALUES ('1', '2', '1') when the [Add this friend] button is clicked.
I’m working with just php and MySQL for now. Any suggestion would be more than welcome. Thanks, guys.
If you are not using AJAX, something like this should be enough.
addfriend.tpl.php file
action_addfriend.php file