session_start ();
$_SESSION['name'] = $name;
//тут ещё код
$name = $cursitearr['name'];
//тут ещё код
if (isset ($_POST ['save'])) {
$namev = $_SESSION["name"];
echo $namev;
if (isset ($_POST ['wslist'])) {
$curws = $_POST ['wslist'];
$cursite = mysqli_query ($connection, "SELECT * FROM $dbtable WHERE name = '$curws' ");
$cursitearr = mysqli_fetch_array ($cursite);
$name = $cursitearr['name'];
$_SESSION['name'] = $name;
}