At the moment I have this code, for uniformity on all pages, I want to change it.
<?php
session_start();
if(isset($_SESSION["UserID"])){
}else{
header('Location: ../Login.php');
}
?>
<?php
include_once 'dbcon.php';
$id = $_POST['id'];
$fn = $_POST['fn'];
$ln = $_POST['ln'];
$em = $_POST['em'];
$hid = $_POST['hid'];
$tn = $_POST['tn'];
$us = $_POST['us'];
$pw = $_POST['pw'];
$ul = $_POST['ul'];
$chk = $_POST['chk'];
$chkcount = count($id);
for ($i = 0; $i < $chkcount; $i++)
{
$pwHash = password_hash($pw[$i], PASSWORD_BCRYPT, array('cost' => 10));
$MySQLiconn->query("UPDATE user SET FName='$fn[$i]', LName='$ln[$i]', Email='$em[$i]', HerbalifeID='$hid[$i]', TelNr='$tn[$i]', UplineS='$us[$i]', Password='$pwHash', UserLevel='$ul[$i]' WHERE UserID=".$id[$i]);
}
header("Location: indexAdmin.php");
?>
I wan't to change the type of connection to my database.
New type of connection: on the top of my page I use this code (which works on the other pages):
<?php include_once '../Connections/localhost.php'; ?>
When I change
$MySQLiconn->query("UPDATE...
to
mysqli_query($con, "UPDATE...
it won't work.
Can anyone help?