2
You need to pass it to the function like this:
function saveEvent($eid = null) {
then inside the function check if it set to something else than null like this:
if (eid != null) {
last you need to send $eid to the saveEvent function when you have it. Something like this:
isset($_POST['eid'])?saveEvent(intval($_POST['eid'])):saveEvent();
Something like that :)