1 (edited by thanhvanchi 2016-12-08 07:45)

Topic: How To add function event for website.

Hello everyone!
I try to send a mail with some information when user tryes to edit a post and submit post modificated.
I find the following data:
1 - original message -> $cur_post['message']
2 - original subject of the post -> $cur_post['subject']
Now i'm trying (and i didn't find yet) variables for:
1 - post url  ... maybe 'f.redirect_url'? to send the link by mail
2 - username that change the post ... maybe $pun_user['username']?
After i find that i want to send an "hidden to user" mail to administrator/moderator in internet using php mail function when i confirm the submit button on edit.php.
<form id="edit" method="post" action="edit.php?id=<?php echo $id ?>&amp;action=edit" onsubmit="return process_form(this)">
How can i add another function on "submit" event?

edit add.

i've tried for hours sad and i'm in the fog....
i'm running punbb in localhost to perform change to prevent online errors for users...
i made an echo of pun_user['username'] and nothing print..... seems i ain't got a pun_user, but it's impossible (i'm logged with admin profile, i supposed Admin is a particular case of an user).
ok, next step...
i wrote in my code: require FORUM_ROOT.'include/email.php';
but when i test the page an error occourred about finding "email.php" , where i'm wrong?? it couldn't find this filw and i've got it in that path sad
last step (maybe one day i will offer you a beer for the patience)
for post link i must write something like this?
<a href="viewtopic.php?pid=<?php echo $id.'#p'.$id ?>"> link here </a>
maybe i'm stupid but i can't find this error...

Thank You Very much!