The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Why isn't Age index existing?
masonh928
post Jan 22 2016, 08:27 PM
Post #1


Serious Coder
*****

Group: Members
Posts: 253
Joined: 17-August 13
From: Indiana
Member No.: 19,570



CODE

<?php
session_start();
error_reporting(E_ALL);

require_once("Scripts/PHP/Class/Update.class.php");

if(!empty($_POST['Languages'])){

$_POST['Languages'] = json_encode($_POST['Languages']);
}

if(!empty($_POST['birthday_month']) && !empty($_POST['birthday_day']) && !empty($_POST['birthday_year'])){

$_POST['Age'] = $_POST['birthday_month'] . ", " . $_POST['birthday_day'] . " " . $_POST['birthday_year'];

$_POST['birthday_month'] = NULL;
$_POST['birthday_day'] = NULL;
$_POST['birthday_year'] = NULL;
}

$_POST  = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);

$DataUpdate = array_filter($_POST);

$Columns = array_keys($DataUpdate);

//print_r($DataUpdate)
//It returns that index, Age, doesn't exist and that birthday_month, day and year still are returned, when they're supposedly Nullified.  

$Update = new Update($Columns, $DataUpdate, $_SESSION['ID']);

$Update->bindData();

$Update->bindQuery();

$Update->Update();

$Update->Redirect("Successfully Updated Your Profile");
exit();
?>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Jan 23 2016, 01:40 AM
Post #2


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Where is the HTML form for this code? 1 or more of the 3 $_POST values is not what you think so the entire
CODE
if(!empty($_POST['birthday_month']) && !empty($_POST['birthday_day']) && !empty($_POST['birthday_year']))
section is skipped. Maybe there is a variable name case problem?

This post has been edited by CharlesEF: Jan 23 2016, 01:40 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 29th March 2024 - 04:27 AM