Welcome to WebmasterWorld Guest from 54.227.125.200

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Error message from thisWipit

     

Scotty13

9:21 pm on Apr 25, 2012 (gmt 0)



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 ---------

cffrost2

2:46 pm on Apr 26, 2012 (gmt 0)

5+ Year Member



Hi. Usually this is caused by an undefined variable. In this case, seems the $thisWipit var is not being passed. Have you double checked and made sure the var value is available to be passed from it's source? I.E. is it residing in a hidden input and it's value is actually not empty before you post?
Also, may wanna change it to check for the existence of the var before trying to use it.

LINE 76: if(isset($_POST['thisWipit'] ? $_POST['thisWipit'] : '')
{
$thisWipit = $_POST['thisWipit'];
}
else
{
echo 'ERROR: thisWipit not set!';
}

Hope this helps
 

Featured Threads

Hot Threads This Week

Hot Threads This Month