Notice: Undefined index: parse_var in

I’m a newbie, me gentle on me.

I never had this error until my web hosting company upgraded PHP from
PHP 5.2.x to PHP 5.3.x.

My edit profile page is giving me this following error…

Notice: Undefined index: parse_var in /home/*****/public_html/edit_profile.php on line 152 & line 172

Line 152…
if ($_POST[‘parse_var’] == “links”){

$website = $_POST['website'];
$website = strip_tags($website);
$website = str_replace("http://", "", $website);
$website = str_replace("'", "'", $website);
$website = str_replace("`", "'", $website);
$website = mysql_real_escape_string($website);
$youtube = preg_replace('#[^A-Za-z_0-9]#i', '', $_POST['youtube']); // filter everything but desired characters
$sqlUpdate = mysql_query("UPDATE myMembers SET website='$website', youtube='$youtube' WHERE id='$id' LIMIT 1");
if ($sqlUpdate){
        $success_msg = '<img src="images/round_success.png" width="20" height="20" alt="Success" />Your links and API connections have been updated successfully.';
} else {
	    $error_msg = '<img src="images/round_error.png" width="20" height="20" alt="Failure" /> ERROR: Problems arose during the information exchange, please try again later.</font>';
}

}

Line 172…
if ($_POST[‘parse_var’] == “bio”){

$bio_body = $_POST['bio_body'];
$bio_body = str_replace("'", "&#39;", $bio_body);
$bio_body = str_replace("`", "&#39;", $bio_body);
$bio_body = mysql_real_escape_string($bio_body);
$bio_body = nl2br(htmlspecialchars($bio_body));
 // Update the database data now here for all fields posted in the form
 $sqlUpdate = mysql_query("UPDATE myMembers SET bio_body='$bio_body' WHERE id='$id' LIMIT 1");
 if ($sqlUpdate){
        $success_msg = '&lt;img src="../root/images/round_success.png" width="20" height="20" alt="Success" /&gt;Your description information has been updated successfully.';
 } else {
	    $error_msg = '&lt;img src="../root/images/round_error.png" width="20" height="20" alt="Failure" /&gt; ERROR: Problems arose during the information exchange, please try again later.&lt;/font&gt;';
 }

}

Thanks in advance,
Scotty13

Hi Scotty13,

is the parse_var being sent from the form?
What does the html look like for your forms output?

It comes from this table

<table width=“90%” border=“0” align=“center”>
<form action=“root/edit_res.php” enctype=“multipart/form-data” method=“post” name=“bioForm” id=“bioForm”>
<tr>
<td width=“12%”><strong>Over the years, I’ve been…</strong>:</td>

                &lt;td width="54%"&gt;&lt;textarea name="bio_body" cols="" rows="5" class="formFields" style="width:94%;"&gt;&lt;?php echo "$bio_body"; ?&gt;&lt;/textarea&gt;&lt;/td&gt;
                &lt;td width="34%"&gt;
                  &lt;input name="parse_var" type="hidden" value="bio_body" /&gt;
                &lt;input type="submit" name="button10" id="button10" value="Submit" /&gt;&lt;/td&gt;
              &lt;/tr&gt;
            &lt;/form&gt;
          &lt;/table&gt;

PHP doesn’t know the var $_POST[‘parse_var’] because it doesn’t exist when your form doesn’t get submitted.

If you do

 ini_set('error_reporting',E_NONE);

it will be gone. Or look in php.net to find other values you can assign to error_reporting.
You can also do something like

if(!isset($_POST['parse_var'])) $_POST['parse_var'] = '';

Thank you!!!