From dca48724813c36684a35ade584690541b734e525 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 22 Oct 2009 19:39:08 +0000 Subject: [PATCH] Oops use the right POST vars and the right function names --- register_participants_emergencycontact.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/register_participants_emergencycontact.php b/register_participants_emergencycontact.php index 9a63004..1b208ff 100644 --- a/register_participants_emergencycontact.php +++ b/register_participants_emergencycontact.php @@ -81,11 +81,13 @@ echo mysql_error(); else { //first, lets make sure this emergency contact really does belong to them foreach($_POST['ids'] AS $id) - { $q=mysql_query("SELECT * FROM emergencycontact WHERE id='$id' AND registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'"); + { + $q=mysql_query("SELECT * FROM emergencycontact WHERE id='$id' AND registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'"); if(mysql_num_rows($q)==1) { - $e=stripslashes($_POST['email']); - if($_POST['relation']=="Parent" && $e && user_valid_email($e)) { - if($u=user_load_by_username($e)) { + $e=stripslashes($_POST['email'][$id]); + if($_POST['relation'][$id]=="Parent" && $e && user_valid_email($e)) { + echo "Updating parent record..."; + if($u=user_load_by_email($e)) { $u['firstname']=stripslashes($_POST['firstname'][$id]); $u['lastname']=stripslashes($_POST['lastname'][$id]); $u['phonehome']=stripslashes($_POST['phone1'][$id]);