Jump to content

The ultimate ultra phenomenal epic n00b question in 2016 (PHP update user profile)


AzeS

Recommended Posts

Hello im new to this forum as i am to php and like to ask a nooby question for the beginning... ^^
a problem that i have for a longer time eventualy...
a mistyrios nooby problem.... 
i'd like to make shure that all my users on my mistyrios nooby shitty website have the oppertunity to update theyre user profiles... like theyre first name second etc. bla bla bla... 
Noby crying going on here... 
 
Lets keep crying 
Could you PLEAAAAUUUSEEEE HULPE MIAAA (Epic Crying) 
If you help me so that i can manege to keep moving on with my wsite you get an epic pease of stone, yea for real, a stone ! a god damn stone !!!  
isnt that nice ? *-*

First of all the php... 
<?php
 ob_start();
 session_start();
 require_once '../dbconnect.php';

 if( !isset($_SESSION['user']) ) {
  header("Location: ../index.php");
  exit;
 }
 // select loggedin users detail
 $res=mysql_query("SELECT * FROM users WHERE userId=".$_SESSION['user']);
 $userRow=mysql_fetch_array($res);


 if ( isset($POST_['btn-submitb']) ) {
        if (isset($POST_['cpass']) && isset($POST_['npass']) && isset($POST_['ucnpass'])) {
        $email = trim($userRow['email']);
        $upass = trim($_POST['cpass']);
        $email = strip_tags(trim($email));
        $upass = strip_tags(trim($upass));
        $password = hash('sha256', $upass);
        $newpassword = trim($_POST['npass']);
        $newpassword = strip_tags($newpassword);
        $confirmnewpassword = trim($_POST['ucnpass']);
        $confirmnewpassword = strip_tags($confirmnewpassword);
        $result = mysql_query("SELECT userPass FROM users WHERE userEmail='$email'");
        if(!$result)
        {
        $message = "Password change: The username you entered does not exist";
        }
        else if($password!= mysql_result($result, 0))
        {
        $message = "Password change: You entered an incorrect password";
        }
        if($newpassword == $confirmnewpassword)
        $password = hash('sha256', $newpassword);
        $sql=mysql_query("UPDATE users SET userPass='$password' where userEmail='$email'");
        if($sql) {
        $message = "Password change: Congratulations You have successfully changed your password";
        } else {
       $message = "Password change: The new password and confirm new password fields must be the same";
       }
        }
        if (isset($POST_['fname'])) {
          $temp = trim($POST_['fname']);
          $temp = strip_tags($temp);
          $sql=mysql_query("UPDATE users SET fname='$temp' where userEmail='$email'");
        if($sql) {
        $messagefname = "Firstname changed";
        } else {
        $messagefname = "Firstname unchanged";
        }
        }
        if (isset($POST_['lname'])) {
         $temp = trim($POST_['Lname']);
         $temp = strip_tags($temp);
         $sql=mysql_query("UPDATE users SET fname='$temp' where userEmail='$email'");
        if($sql) {
        $messagelname = "Lastname changed";
        } else {
        $messagelname = "Lastname unchanged";
        }
        }
        if (isset($POST_['email'])) {
          $temp = trim($POST_['email']);
          $temp = strip_tags($temp);
          $sql=mysql_query("UPDATE users SET email='$temp' where userEmail='$email'");
        if($sql) {
        $messageemail = "Email changed";
        } else {
        $messageemail = "Email unchanged";
        } 
        }
        if (isset($POST_['street'])) {
          $temp = trim($POST_['street']);
          $temp = strip_tags($temp);
          $sql=mysql_query("UPDATE users SET street='$temp' where userEmail='$email'");
        if($sql) {
        $messagestreet = "Street changed";
        } else {
        $messagestreet = "Street unchanged";
        } 
        }
        if (isset($POST_['snum'])) {
          $temp = trim($POST_['snum']);
          $temp = strip_tags($temp);
          $sql=mysql_query("UPDATE users SET snum='$temp' where userEmail='$email'");
        if($sql) {
        $messagesnum = "Streetnumber changed";
        } else {
        $messagesnum = "Streetnumber unchanged";
        } 
        }
        if (isset($POST_['land'])) {
          $temp = trim($POST_['land']);
          $temp = strip_tags($temp);
          $sql=mysql_query("UPDATE users SET land='$temp' where userEmail='$email'");
        if($sql) {
        $messageland = "Country(State) changed";
        } else {
        $messageland = "Country(State) unchanged";
        } 
        }
        if (isset($POST_['zip'])) {
          $temp = trim($POST_['zip']);
          $temp = strip_tags($temp);
          $sql=mysql_query("UPDATE users SET zip='$temp' where userEmail='$email'");
        if($sql) {
        $messagezip = "Zipcode changed";
        } else {
        $messagezip = "Zipcode unchanged";
        } 
        }
        if (isset($POST_['state'])) {
          $temp = trim($POST_['state']);
          $temp = strip_tags($temp);
          $sql=mysql_query("UPDATE users SET cnt='$temp' where userEmail='$email'");
        if($sql) {
        $messagestate = "Continent changed";
        } else {
        $messagestate = "Continent unchanged";
        } 
        }
        
        
 }


?>

And the html.

<!DOCTYPE html>
<html>
<HEAD>
  <link rel="stylesheet" href="../css/style.css">
  <link rel="stylesheet" href="../css/normalize.css">
  <title>Welcome - <?php echo $userRow['userEmail']; ?></title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  <script>
  var e = 0
  var d = 0
  function myFunction() {
      
      if ( e < 1 /* && d > 0 */) {
        document.getElementById("H1").style.display = "none";
        e = 2

      } else {
        document.getElementById("H1").style.display = "block";
        e = 0
      }
        
  }
  //onmouseout="RedimO()" onmouseover="RedimI()"
  function RedimO() {
    d = 0
    //document.getElementById("H1").style.display = "none";
  }
  function RedimI() {
    d = 1
  }

function checkPass()
{
    //Store the password field objects into variables ...

    var pass1 = document.getElementById('pass1');
    var pass2 = document.getElementById('pass2');
    //Store the Confimation Message Object ...
    var message = document.getElementById('confirmMessage');
    //Set the colors we will be using ...
    var goodColor = "#66cc66";
    var badColor = "#ff6666";
    //Compare the values in the password field 
    //and the confirmation field
    if(pass1.value == pass2.value){
        //The passwords match. 
        //Set the color to the good color and inform
        //the user that they have entered the correct password 
        pass2.style.backgroundColor = goodColor;
    }else{
        //The passwords do not match.
        //Set the color to the bad color and
        //notify the user.
        pass2.style.backgroundColor = badColor;
    }
 
}  

function checkPassa()
{
    var pass0 = document.getElementById('pass0');
    var goodColor = "#66cc66";
    var badColor = "#ff6666";
     if(pass0.value.length == 0) {
      pass0.style.backgroundColor = badColor;
    } else {
      pass0.style.backgroundColor = goodColor;
    }
}

  </script>
  </HEAD>
  <BODY>
    <div class="LogHeadC">
  <div class="LogHeadH FBk_ clearfix Body_E01">
   <center>
   <p>loged in as: <?php echo $userRow['UzRI']; ?></p> 
   <p></p>
   <p></p>
    <nav>
     <ul>
       <li><a href="../Profile.php">My Profile</a></li>
       <li><a href="USM/Credentials.php">My Credentials</a></li>
       <li><a href="USM/Wallet.php">My Wallet</a></li>
       <li><a href="USM/History.php">My History</a></li>
       <li><a href="USM/ReportB.php">My Bug report</a></li>
       <li><a href="USM/Help.php">Help Center</a></li>
       <li><a href="USM/Contact.php">Contact</a></li>
       <li><a href="../Logout.php?logout">Logout</a></li>
      </ul>
   </nav>

  
  </center> 
  </div>
</div>

  
  
  </div>  
  <div class="Space_0 Background_0"></div>



<div class="Space_0 Background_1"></div>

<div class="Space_0 Background_1"></div>
<center>
    <div class="Background_1 clearfix">
    <div class="Body_E01 Body_Wrapp Background_1">
      <form class="Rform" method="POST">
        <table>

            <div class="usrl">
          <input type="text" placeholder="Lastname*" name="lname" value="<?php echo $userRow['fname'];?>" />
            </div>

            <div class="usrf">
          <input type="text" placeholder="Firstname*" name="fname" value="<?php echo $userRow['lname'];?>"/>
            </div>

          <div class="usre">
          <input type="text" placeholder="Email Adress*" name="email" value="<?php echo $userRow['userEmail'];?>"/>
            </div>
           
            <div class="usrps0">
          <input type="password" placeholder="Old password*" name="cpass" id="pass0"/>
            </div>

            <div class="usrps0">
          <input type="password" placeholder="New password*" name="npass" id="pass1" onkeyup="checkPass(); return false;" onclick="checkPassa(); return false;" />
            </div>
            
            <div class="usrps1">
          <input type="password" placeholder="Confirm New Password*" name="ucnpass" id="pass2" onkeyup="checkPass(); return false;" onclick="checkPassa(); return false;"/>
            </div>
            
            
            
            <div class="usrStreet">
          <input type="text" placeholder="Streetname" name="street" value="<?php echo $userRow['street'];?>"/>
            </div>

            <div class="usrStreetNum">
          <input type="text" placeholder="Streetnumber" name="snum" value="<?php echo $userRow['snum'];?>"/>
            </div>
            
          <div class="usrct">
          <input type="text" placeholder="Your City" name="city" value="<?php echo $userRow['city'];?>"/>
            </div>
            
          <div class="usrC">
          <input type="text" placeholder="Your Country(State)" name="land" value="<?php echo $userRow['country'];?>"/>
            </div>

            <div class="usrC">
          <input type="text" placeholder="Your Zip Code" name="zip" value="<?php echo $userRow['zip'];?>"/>
            </div>
            
            <div class="usrCnT">
            <select name="state" value="<?php echo $userRow['cnt'];?>">
              <option>USA</option>
                <option>MEXICO</option>
                <option>CANADA</option>
                <option>EUROPA</option>
                <option>ASIEN</option>
            </select> 
            </div>
            
            <div class="cpmessage">
            <p><?php if(isset($message)) { echo $message; } ?></p>
            <p><?php if(isset($messagelname)) { echo $messagelnamne; } ?></p>
            <p><?php if(isset($messagefname)) { echo $messagefname; } ?></p>
            <p><?php if(isset($messageemail)) { echo $messageemail; } ?></p>
            <p><?php if(isset($messagestreet)) { echo $messagestreet; } ?></p>
            <p><?php if(isset($messagesnum)) { echo $messagesnum; } ?></p>
            <p><?php if(isset($messagecity)) { echo $messagecity; } ?></p>
            <p><?php if(isset($messageland)) { echo $messageland; } ?></p>
            <p><?php if(isset($messagezip)) { echo $messagezip; } ?></p>
            <p><?php if(isset($messagestate)) { echo $messagestate; } ?></p>
            </div>

            <div class="login">
          <button type="submit" name="btn-submitb">Submit</button>
           </div>
            
            
        </table>
      </form>
    </div>
  </div>
</center>



</BODY>
</html>

sincerely,
AzeS the php noob 

Edited by AzeS
Link to comment
Share on other sites

Skip the “nooby” stuff and tell us specifically what your problem is. In standard English.

 

Which parts don't work as expected? What happens instead? Which errors does PHP display? etc.

 

Right now, all we can tell you is that your code is hopelessly outdated. For example, the mysql_* functions are obsolete since more than a decade and have been removed from the current PHP version. Both PHP itself and the PHP manual explicitly warn against using those functions. And hashing with SHA-256 has become unacceptable somewhere around the year 2000.

 

This is PHP from the 90s. If you want to learn the language, you should use good, up-to-date resources. The PHP manual is a good starting point. To be specific, every current log-in script should use PDO (or mysqli) for database queries and the password hash API for passwords.

Link to comment
Share on other sites

tahnks for the fast response jacques1 ^^ 
im from germany sorry for the bad english xD

And as you mentioned i not even have a clue in php...
I collect snippets from aaround the web and put them together...
but i lookup for better ways i gues dr. google will help me.

The main problem is taht; if i cklick submit it moves the page up to the begnning and does nothing... 
But i guess i should leran more and better if you have some links for me it would be a huge help for me 
 

sincerely AzeS the n00b 








 

Link to comment
Share on other sites

You're using

$POST_

instead of

$_POST

everywhere on your code. Since the former variable doesn't exist at all, any isset() check on it will fail. That would explain why nothing happens after submitting the form.

 

However, since there are dozens of other problems, I suggest you scrap the code and start with a smaller project. Then you can write your own code and actually learn the language. Copy-and-paste programming doesn't get you anywhere. You've probably spent a lot of time putting this script together, but the result is practically useless, and you haven't gained any knowledge.

 

Why don't you start with PDO? Write a simple script, try out a few queries, and learn how to safely pass variables to a query with prepared statements.

Link to comment
Share on other sites

I maneged to update the website to pdo still sha256 but this is another problem... i will fix that later with salt... 
But ii have a new problem it says : SQLSTATE[HY093]: Invalid parameter number: parameter was not defined
OR : 
Undefined variable: statement in D:\XAMPPmm\htdocs\LKINO\crud.php on line 73
 

Crud Function:
 

public function upup($email,$fname,$lname,$street,$zip,$city,$country,$snum,$cnt) {
try{

if(!empty($email)) {
	$statement->bindparam(":mail",$email);
	$statement->bindparam(":uname",$username);
	$statement = $this->Db->prepare("UPDATE users SET userEmail=:mail WHERE UzRI=:uname");
	
$statement->execute();
}
if(!empty($fname)) {
$statement->bindparam(":fname",$fname);
$statement->bindparam(":mail",$email);
$statement = $this->Db->prepare("UPDATE users SET fname=:fname WHERE userEmail=:mail");
$statement->execute();
}
if(!empty($lname)) {
$statement->bindparam(":lname",$lname);	
$statement->bindparam(":mail",$email);
$statement = $this->Db->prepare("UPDATE users SET lname=:lname WHERE userEmail=:mail");
$statement->execute();
}
if(!empty($street)) {
$statement->bindparam(":street",$street);
$statement->bindparam(":mail",$email);	
$statement = $this->Db->prepare("UPDATE users SET street=:street WHERE userEmail=:mail");
$statement->execute();
}
if(!empty($zip)) {
$statement->bindparam(":zip",$zip);
$statement->bindparam(":mail",$email);	
$statement = $this->Db->prepare("UPDATE users SET zip=:zip WHERE userEmail=:mail");
$statement->execute();
}
if(!empty($city)) {
$statement->bindparam(":city",$city);
$statement->bindparam(":mail",$email);	
$statement = $this->Db->prepare("UPDATE users SET city=:city WHERE userEmail=:mail");
$statement->execute();
}
if(!empty($country)) {
$statement->bindparam(":country",$country);
$statement->bindparam(":mail",$email);	
$statement = $this->Db->prepare("UPDATE users SET country=:country WHERE userEmail=:mail");
$statement->execute();
}
if(!empty($snum)) {
$statement->bindparam(":snum",$snum);
$statement->bindparam(":mail",$email);	
$statement = $this->Db->prepare("UPDATE users SET snum=:snum WHERE userEmail=:mail");
$statement->execute();
}
if(!empty($cnt)) {
$statement->bindparam(":cnt",$cnt);
$statement->bindparam(":mail",$email);	
$statement = $this->Db->prepare("UPDATE users SET ,cnt=:cnt WHERE userEmail=:mail");
$statement->execute();
}
return 1;
} catch (PDOException $ex){
echo $ex->getMessage();
return 0;
}
}

Update callout:

<?php
 ob_start();
 session_start();
 require_once '../dbconnect.php';

 if( !isset($_SESSION['user']) ) {
  header("Location: ../index.php");
  exit;
 }
 // select loggedin users detail
 $userRow=$crud->getuser($_SESSION['user']);


 if ( isset($_POST['btn-submitb']) ) {
        if (!isset($_POST['cpass']) =="" && !isset($_POST['npass']) =="" && !isset($_POST['ucnpass']) =="" ) {
        $email = trim($userRow['userEmail']);
        $upass = trim($_POST['cpass']);
        $email = strip_tags(trim($email));
        $upass = strip_tags(trim($upass));
        $password = hash('sha256', $upass);
        $newpassword = trim($_POST['npass']);
        $newpassword = strip_tags($newpassword);
        $confirmnewpassword = trim($_POST['ucnpass']);
        $confirmnewpassword = strip_tags($confirmnewpassword);
        $row=$crud->getUser($email);
    
        if( $row['userPass'] == $password ) {
          if($newpassword == $confirmnewpassword) {
            $password = hash('sha256', $newpassword);
            $result=$crud->upuppw($email,$password);
              if($result=1) {
                $Passchangemsg = "Password change: Your password have been changed successfully.";
              } else {
                $Passchangemsg = "Password change: Somethng went horryblie wrong try again later.";
              }
          } else {
            $Passchangemsg = "Password change: The new password and confirm new password fields must be the same, Try again...";
        } 
        } else {
          $Passchangemsg = "Password change: Wrong Password, Try again...";
        }
 
       }

 $email = trim($_POST['email']);
 $userfname = trim($_POST['fname']);
 $userlname = trim($_POST['lname']);
 $userstreet = trim($_POST['street']);
 $userzip = trim($_POST['zip']);
 $usercity = trim($_POST['city']);
 $usercountry = trim($_POST['land']);
 $userstaate = trim($_POST['state']);
 $userstreetnum = trim($_POST['snum']);


 $email = strip_tags($email);
 $userfname = strip_tags($userfname);
 $userlname = strip_tags($userlname);
 $userstreet = strip_tags($userstreet);
 $userzip = strip_tags($userzip);
 $usercity = strip_tags($usercity);
 $usercountry = strip_tags($usercountry);
 $userstaate = strip_tags($userstaate);
 $userstreetnum = strip_tags($userstreetnum);

  // password encrypt using SHA256();
 $password = hash('sha256', $upass);
    
 $result = $crud->upup($email,$userfname,$userlname,$userstreet,$userzip,$usercity,$usercountry,$userstreetnum,$userstaate);
    
    if($result = 1) {
      $MSGDCHANGE = "Credentials: All entry's that youve changed, have been changed successfully.";
    } else {
      $MSGDCHANGE = "Credentials: Somethng went horryblie wrong.. try again later.";
    }
    }
       
       
        
        
 


?>

Html:
 

<!DOCTYPE html>
<html>
<HEAD>
  <link rel="stylesheet" href="../css/style.css">
  <link rel="stylesheet" href="../css/normalize.css">
  <title>Welcome - <?php echo $userRow['userEmail']; ?></title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  <script>
  var e = 0
  var d = 0
  function myFunction() {
      
      if ( e < 1 /* && d > 0 */) {
        document.getElementById("H1").style.display = "none";
        e = 2

      } else {
        document.getElementById("H1").style.display = "block";
        e = 0
      }
        
  }
  //onmouseout="RedimO()" onmouseover="RedimI()"
  function RedimO() {
    d = 0
    //document.getElementById("H1").style.display = "none";
  }
  function RedimI() {
    d = 1
  }

function checkPass()
{
    //Store the password field objects into variables ...

    var pass1 = document.getElementById('pass1');
    var pass2 = document.getElementById('pass2');
    //Store the Confimation Message Object ...
    var message = document.getElementById('confirmMessage');
    //Set the colors we will be using ...
    var goodColor = "#66cc66";
    var badColor = "#ff6666";
    //Compare the values in the password field 
    //and the confirmation field
    if(pass1.value == pass2.value){
        //The passwords match. 
        //Set the color to the good color and inform
        //the user that they have entered the correct password 
        pass2.style.backgroundColor = goodColor;
    }else{
        //The passwords do not match.
        //Set the color to the bad color and
        //notify the user.
        pass2.style.backgroundColor = badColor;
    }
 
}  

function checkPassa()
{
    var pass0 = document.getElementById('pass0');
    var goodColor = "#66cc66";
    var badColor = "#ff6666";
     if(pass0.value.length == 0) {
      pass0.style.backgroundColor = badColor;
    } else {
      pass0.style.backgroundColor = goodColor;
    }
}

  </script>
  </HEAD>
  <BODY>
  <div class="HeaderC" >
    <DIV class="Header">
      <header class="Header clearfix">
      <a class="logo" href="../index.php">
        <img src="../IMG/LAY/Logo.png" height="85" alt="LKino Logo">
      </a>
      <nav>
        <ul class="clearfix">
          <li><a href="../Index.php">
          <span class="HxE">H</span>ompage</a></li>
          <li><a href="../Showroom.php">
          <span class="HxE">S</span>howroom</a></li>
          <li><a href="../Media_Center.php">
          <span class="HxE">S</span>hop</a></li>
          <li><a href="../Exchange.php">
          <span class="HxE">M</span>oney exchange</a></li>
          <li><a href="../LKC.php">
          <span class="HxE">L</span>KC</a></li>
          <li><a href="../About.php">
          <span class="HxE">A</span>bout Us</a></li>
        </ul>
      </nav>  
      </header>
    </DIV>
    </form>
    <div class="LogHeadC">
  <div class="LogHeadH FBk_ clearfix Body_E01">
   <center>
   <p>your currently loged in as: <?php echo $userRow['UzRI']; ?></p> 

    <nav>
     <ul>
       <li><a href="../Profile.php">My Profile</a></li>
       <li><a href="Credentials.php">My Credentials</a></li>
       <li><a href="Wallet.php">My Wallet</a></li>
       <li><a href="History.php">My History</a></li>
       <li><a href="ReportB.php">My Bug report</a></li>
       <li><a href="Help.php">Help Center</a></li>
       <li><a href="Contact.php">Contact</a></li>
       <li><a href="../Logout.php?logout">Logout</a></li>
      </ul>
   </nav>

  
  </center> 
  </div>
</div>

  
  
  </div>  
  <div class="Space_0 Background_0"></div>



<div class="Space_0 Background_1"></div>

<div class="Space_0 Background_1"></div>
<center>
    <div class="Background_1 clearfix">
    <div class="Body_E01 Body_Wrapp Background_1">
      <form class="Rform" method="POST">
        <table>

            <div class="usrl">
          <input type="text" placeholder="Lastname*" name="lname" value="<?php echo $userRow['fname'];?>" />
            </div>

            <div class="usrf">
          <input type="text" placeholder="Firstname*" name="fname" value="<?php echo $userRow['lname'];?>"/>
            </div>

          <div class="usre">
          <input type="text" placeholder="Email Adress*" name="email" value="<?php echo $userRow['userEmail'];?>"/>
            </div>
           
            <div class="usrps0">
          <input type="password" placeholder="Old password*" name="cpass" id="pass0"/>
            </div>

            <div class="usrps0">
          <input type="password" placeholder="New password*" name="npass" id="pass1" onkeyup="checkPass(); return false;" onclick="checkPassa(); return false;" />
            </div>
            
            <div class="usrps1">
          <input type="password" placeholder="Confirm New Password*" name="ucnpass" id="pass2" onkeyup="checkPass(); return false;" onclick="checkPassa(); return false;"/>
            </div>
            
            
            
            <div class="usrStreet">
          <input type="text" placeholder="Streetname" name="street" value="<?php echo $userRow['street'];?>"/>
            </div>

            <div class="usrStreetNum">
          <input type="text" placeholder="Streetnumber" name="snum" value="<?php echo $userRow['snum'];?>"/>
            </div>
            
          <div class="usrct">
          <input type="text" placeholder="Your City" name="city" value="<?php echo $userRow['city'];?>"/>
            </div>
            
          <div class="usrC">
          <input type="text" placeholder="Your Country(State)" name="land" value="<?php echo $userRow['country'];?>"/>
            </div>

            <div class="usrC">
          <input type="text" placeholder="Your Zip Code" name="zip" value="<?php echo $userRow['zip'];?>"/>
            </div>
            
            <div class="usrCnT">
            <select name="state" value="<?php echo $userRow['cnt'];?>">
              <option>USA</option>
                <option>MEXICO</option>
                <option>CANADA</option>
                <option>EUROPA</option>
                <option>ASIEN</option>
            </select> 
            </div>
            
            <div class="cpmessage">
            <p><?php if(isset($Passchangemsg)) { echo $message; } ?></p>
            <p><?php if(isset($MSGDCHANGE)) { echo $messagelnamne; } ?></p>
            </div>

            <div class="login">
          <button type="submit" name="btn-submitb">Submit</button>
           </div>
            
            
        </table>
      </form>
    </div>
  </div>
</center>



</BODY>
</html>
Link to comment
Share on other sites

It looks like you are binding the parameters before preparing the statement. Try changing this

$statement->bindparam(":mail",$email);
$statement->bindparam(":uname",$username);
$statement = $this->Db->prepare("UPDATE users SET userEmail=:mail WHERE UzRI=:uname");
 
To this

$statement = $this->Db->prepare("UPDATE users SET userEmail=:mail WHERE UzRI=:uname");
$statement->bindparam(":mail",$email);
$statement->bindparam(":uname",$username);

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.