Contact Info

prepare($q); $stmt->bind_param('s', $nickName); $stmt->execute(); $result = $stmt->get_result(); if($result->num_rows === 0) { // name is available //echo ('No nickname found in our system.'); // no one with that nickname in the db } else { while($row = $result->fetch_assoc()) { $idTakenByMmemberID = $row['memberID']; // echo "
idTaken = ".$idTakenByMmemberID ; //['memberID'] } } } if (!empty($idTakenByMmemberID) && isset($idTakenByMmemberID)) { //if there is some memberID coming back //echo ('A'); // it's taken if ($idTakenByMmemberID != $memberID) {//if it is not the existing member //echo ('B'); // by the current owner $errors[] = "The nickname you entered has already been taken. Please enter another nickname."; } } //find out if email address is being changed //get what the email address WAS $q = "SELECT email FROM Members WHERE memberID = ?"; $stmt = $conn->prepare($q); $stmt->bind_param('i', $memberID); $stmt->execute(); $result = $stmt->get_result(); if ($row = $result->fetch_assoc()) { $emailCurrent = $row['email']; // echo "
emailCurrent = $emailCurrent -"; } // initialize $sameNoChangingTheEmail = false; $okay2goEmailUnique = false; //check to see if there are duplicate member records //find by the email they want to use $q = "SELECT memberID FROM Members WHERE email = ?"; $stmt = $conn->prepare($q); $stmt->bind_param('s', $email); $stmt->execute(); $result = $stmt->get_result(); if ($row = $result->fetch_assoc()) { // there already is this email in the db $memberIDfound = $row['memberID']; //email address was found... (MAYBE THEY OWN IT) //First see if new email is different from current if ($emailCurrent == $email) { // they own it $sameNoChangingTheEmail = True; } else { // new email address is not available $errors[] = "The email address you've entered is already in our database. This may indicate that you have already created a duplicate account with this email address.

Our team is already on it... and your email address should be fixed soon. If the email is not fixed within 2 business days, Contact us and we will be happy to consolidate your multiple accounts."; //NOTIFY us - they are trying to change an email to one that is already in the database $toAddress = "bpsupport@betterphoto.com"; $toName = "BetterPhoto Support"; $subject = "FYI - already in db - Contact Us Page - email address: " . $email; $message = "One is trying to change " . $emailCurrent . " to: " . $email . ", which already belongs to another account. Make sure nothing fishy is going on. "; mailerThatRocks($toAddress, $subject, $message, $toName, "bpsupport@betterphoto.com"); } } else { //if none found by what they are entering... the new email address is available $okay2goEmailUnique = True; } // if everything input is good... if (empty($errors)) { // do the processing /* run it through escape ++++++++++== email= Replace(Replace(email,"|",""),"'","") companyName= Replace(Replace(companyName,"|",""),"'","") address1= Replace(Replace(address1,"|",""),"'","") address2= Replace(Replace(address2,"|",""),"'","") city= Replace(Replace(city,"|",""),"'","") state= Replace(Replace(state,"|",""),"'","") ZIPCode= Replace(Replace(ZIPCode,"|",""),"'","") country= Replace(Replace(country,"|",""),"'","") phone= Replace(Replace(phone,"|",""),"'","") firstName= Replace(Replace(firstName,"|",""),"'","") miName= Replace(Replace(miName,"|",""),"'","") lastName= Replace(Replace(lastName,"|",""),"'","") */ //new email is available or email is not being changed (other stuff is) if ($okay2goEmailUnique == True || $sameNoChangingTheEmail == True) { $q = "UPDATE Members SET email = ?, phone = ?, companyName = ?, address1 = ?, address2 = ?, city = ?, state = ?, ZIPCode = ?, country = ?, firstName = ?, miName = ?, lastName = ?, nickName = ?, postAddress = ?, postPhone = ?, displayContactForm = ? WHERE memberID = " . $memberID; $stmt = $conn->prepare($q); $stmt->bind_param('ssssssssssssssss', $email, $phone, $companyName, $address1, $address2, $city, $state, $ZIPCode, $country, $firstName, $miName, $lastName, $nickName, $postAddress, $postPhone, $displayContactForm); $stmt->execute(); if($stmt->affected_rows === 0) { exit('

No rows updated'); } else { // if it ran okay echo '

'; // go get them from the database (to make sure we get updated info) $q = "SELECT firstName, miName, lastName, email, address1, address2, city, state, ZIPCode, country, phone, companyName, postAddress, postPhone, nickName, displayContactForm FROM Members WHERE memberID = ".$memAuth; $r = mysqli_query($conn, $q); $results2 = mysqli_fetch_assoc($r); $emailCA1 = $results2['email']; $firstNameCA1 = $results2['firstName']; $miNameCA1 = $results2['miName']; $lastNameCA1 = $results2['lastName']; $address1CA1 = $results2['address1']; $address2CA1 = $results2['address2']; $cityCA1 = $results2['city']; $stateCA1 = $results2['state']; $zipCodeCA1 = $results2['ZIPCode']; $countryCA1 = $results2['country']; $phoneCA1 = $results2['phone']; $companyNameCA1 = $results2['companyName']; $nickName = $results2['nickName']; $postAddress = $results2['postAddress']; $postPhone = $results2['postPhone']; $displayContactForm = $results2['displayContactForm']; } } //ok to go email is unique or not being changed //WHAT IF EMAIL IS BEING CHANGED. ++++++++++ above make into bootstrap success message //NOTIFY us they are changing email //if new email is available, email is different if ($sameNoChangingTheEmail == false) { //send us a "email has been changed" notification $toAddress = "bpSupport@BetterPhoto.com"; $toName = "BetterPhoto Support"; $subject = "Important - email has been changed from: " . $emailCurrent . " to: " . $email . "--reset emailStatus too"; $message = "Look up " . $emailCurrent . " and " . $email . " at Drip, and consolidate to this new email address: " . $email . " ----- ALSO: important... make sure their emailStatus is set to 'GLD'"; mailerThatRocks($toAddress, $subject, $message, $toName); } //send the "success" auto-notification //respond to old email address, just in case $toAddress = $email; // if new email is available, email is different if ($sameNoChangingTheEmail == false) { $toAddress.= ",".$emailCurrent; // BetterPhoto Subscriber - Previous Address" //also send to old email address } $toName = "BetterPhoto Member"; // during testing ++++++MAIL++++ go to me //$toAddress = "jimtestin@ProductiveAndHappy.com"; $subject = "Contact Info Changed at BetterPhoto.com"; $message = "Hi there, \n\nJust confirming that your contact info has been changed. \n\nIf you have any questions, email us about it. \n\nThanks! \n\n"; $message .= Application("email_customerSupport"); mailerThatRocks($toAddress, $subject, $message, $toName); } else { // show the errors echo ''; } // if no errors, post; if errors, show them } // if POSTING this from // if thens for form below if ($postAddress == "No") { $hideAddressChecked = " checked"; } else { $hideAddressChecked = ""; } if ($postPhone == "No") { $hidePhoneChecked = " checked"; } else { $hidePhoneChecked = ""; } if ($displayContactForm == 1) { $displayContactFormChecked = " checked"; } else { $displayContactFormChecked = ""; } print <<
Use these fields to update your contact information.

If all you need to do is update your email address, use this Change of Address page.

Note: if you would like to keep your address or telephone number from displaying, do NOT delete them here. Instead, click the "Hide" checkbox.

  First Name:  MI: Last Name:   Company Name:     Check this box to hide your address. Address:  Address Line 2:   City, State:         Zip/Postal Code:  Country:    Check this box to hide your phone number. Phone Number:   Email Address:     

Gallery Nickname

You can give yourself a unique nickname for quick access to your gallery. This can be up to 30 typical alphanumeric characters.

A nickname allows you to use a short URL to direct people to your gallery. Note: remember to place a question mark before your nickname when using it.   Nickname:    

Contact Form Activation

You can choose whether or not to receive emails through the contact form of your (free or Classic) Photo Gallery.

  Contact Form Activated:      
END; } // end if MEMBER AUTH CHECK else { echo ''; } ?>