Trying to edit my profile image and I get this error message from thisWipit...
Notice: Undefined index: thisWipit in /home/*******/public_html/edit_res.php on line 76 (marked below) (I did the indent code - how it shows better)
Your session expired from inactivity. Please click here to refresh it..
<?php
// Start_session, check if user is logged in or not, and connect to the database all in one included file
include_once("scripts/checkuserlog.php");
?>
<?php
//////////////////////////////////////////////// Member log in double check ///////////////////////////////////////////////////
if (!isset($_SESSION['idx'])) {
$msgToUser = '<br /><br /><font color="#FF0000">Only ticked members can do that. Please click link below.</font><p><a href="makeareservation.php">Join here by Making A Reservation</a></p>';
include_once 'msgToUser.php';
exit();
} else if ($ckinOptions_id != $_SESSION['id']) {
$msgToUser = '<br /><br /><font color="#FF0000">Only ticked members can do that. Please click link below.</font><p><a href="makeareservation.php">Join here by Making A Reservation</a></p>';
include_once 'msgToUser.php';
exit();
}
//////////////////////////////////////////////// End Member log in double check ///////////////////////////////////////
$id = $ckinOptions_id; // Set the profile owner ID
// Now let's initialize vars to be printed to page in the HTML section so our script does not return errors
// they must be initialized in some server environments, not shown in video
$error_msg = "";
$errorMsg = "";
$success_msg = "";
$username = "";
$firstname = "";
$lastname = "";
$city = "";
$state_province = "";
$country = "";
$currentairline = "";
$previousairline = "";
$myfirstairline = "";
$bio_body = "";
$bio_body = "";
$workstatus = "";
$website = "";
$youtube = "";
$user_pic = "";
$private = "";
$cacheBuster = rand(9999999,99999999999); // Put appended to the image URL will help always show new when changed
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ------- IF WE ARE PARSING ANY DATA ------------------------------------------------------------------------------------------------------------
if (!isset($_POST['parse_var']))
{
$_POST['parse_var'] = "undefined";
}
if($_POST['parse_var'] == "undefined")
{
//Code to handle undefined exception
}
if ($_POST['parse_var'] == "pic"){
// If a file is posted with the form
if ( isset($_FILES['fileField']) && ! empty($_FILES['fileField']['tmp_name']) ) {
$maxfilesize = 2097152; // equal to 2 mb
if($_FILES['fileField']['size'] > $maxfilesize ) {
$error_msg = '<font color="#FF0000">ERROR: Your image was too large, please try again.</font>';
unlink($_FILES['fileField']['tmp_name']);
} else if (!preg_match("/\.(gif|jpg|png)$/i", $_FILES['fileField']['name'] ) ) {
$error_msg = '<font color="#FF0000">ERROR: Your image was not one of the accepted formats, please try again.</font>';
unlink($_FILES['fileField']['tmp_name']);
} else {
$newname = "image01.jpg";
$place_file = move_uploaded_file( $_FILES['fileField']['tmp_name'], "tktedmembers/$id/".$newname);
}
}
}
//// W.I.P.I.T ///
LINE 76: $thisWipit = $_POST['thisWipit'];
$sessWipit = base64_decode($_SESSION['wipit']);
//
if (!isset($_SESSION['wipit']) || !isset($_SESSION['idx'])) {
echo 'Error: Your session expired from inactivity. Please <a href="index.php">click here to refresh it.</a>.';
exit();
}
//
if ($sessWipit != $thisWipit) {
echo 'Your session expired from inactivity. Please <a href="index.php">click here to refresh it.</a>.';
exit();
}
//
if ($thisWipit == "") {
echo 'Error: Missing Data... click back in your browser please.';
exit();
}
// ------- PARSING PICTURE UPLOAD ---------
if ($_POST['parse_var'] == "pic"){
// If a file is posted with the form
if ($_FILES['fileField']['tmp_name'] != "") {
$maxfilesize = 51200; // 51200 bytes equals 50kb
if($_FILES['fileField']['size'] > $maxfilesize ) {
$error_msg = '<font color="#FF0000">ERROR: Your image was too large, please try
again.</font>';
unlink($_FILES['fileField']['tmp_name']);
} else if (!preg_match("/\.(gif|jpg|png)$/i", $_FILES['fileField']['name'] ) ) {
$error_msg = '<font color="#FF0000">ERROR: Your image was not one of the accepted formats,
please try again.</font>';
unlink($_FILES['fileField']['tmp_name']);
} else {
$newname = "image01.jpg";
$place_file = move_uploaded_file( $_FILES['fileField']['tmp_name'], "tktedmembers/$id/".$newname);
}
}
}
// ------- END PARSING PICTURE UPLOAD ---------