1

I have an issue with changing the mail address by using AJAX. Somehow when I enter an email address it doesn't see the change but it should. It's a place to change mail address. Can you check it?

PHP

<div class="col-xs-12 col-sm-12 col-md-12">
  <div class="icon-email-icon tooltip mrgn-bot">Email</div>
    <input type="text" value="<?php echo $update_['email'];?>" 
           class="profile-textbox pull-right" 
           onchange="saveToDatabase(this.value,'email','<?php echo $getID; ?>');">
  </div>

JS

function saveToDatabase(editableObj,column,id) {
    $(editableObj).css("background","#FFF url(../img/loaderIcon.gif) no-repeat right");
    var result = window.confirm("Are you sure?");
        if(result == true) {
            var str = 'column='+column+'&editval='+editableObj+'&id='+id;
            $.ajax({
                url: "saveedit.php",
                type: "POST",
                data: str,
                success: function(data){
                    $(editableObj).css("background","#FDFDFD");
                    alert("Your Information was successfully changed.");
                }        
            }); 
        }
        else
            return 0;
}
Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Do you have any error messages on the page? In your console maybe? – bassxzero Dec 16 '16 at 19:49
  • If the `@` is only sign that it doesn't allow, then the error must be in your MySql update query. Post your `saveedit.php`. Did you remeber to use prepare statement in your query? – Tonza Dec 16 '16 at 20:00
  • 1
    you're building your own param string by hand, manually, without properly encoding the values. That likely isn't why you're having problems in this specific case, but it can cause problems. – Kevin B Dec 16 '16 at 20:06

0 Answers0