I have a myaccount page which a user logs into. From this the user can click on another form 'Language' table. When submitted it take them back to their account. This is the code I have so far but getting the error Parse error: syntax error, unexpected '='.
if (!empty($_POST['doLanguage']) && $_POST['doLanguage'] == 'Submit')
{
foreach($_POST as $key => $value)
id = '$_SESSION[user_id]';
$host = $_SERVER['HTTP_HOST'];
$host_upper = strtoupper($host);
$path = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
(empty($err)) {
for($i = 0; $i < count($_POST["other"]); $i++)
{
$native = mysql_real_escape_string($_POST['native'][$i]);
$other = mysql_real_escape_string($_POST['other'][$i]);
$other_list = mysql_real_escape_string($_POST['other_list'][$i]);
$other_read = mysql_real_escape_string($_POST['other_read'][$i]);
$other_spokint = mysql_real_escape_string($_POST['other_spokint'][$i]);
$other_spokprod = mysql_real_escape_string($_POST['other_spokprod'][$i]);
$other_writ = mysql_real_escape_string($_POST['other_writ'][$i]);
$sql_insert = "INSERT into `language`
(`native`,`other`,`other_list`,`other_read`, `other_spokint`
,`other_spokprod`,`other_writ` )
VALUES
('$native','$other','$other_list','$other_read','$other_spokint',
'$other_spokprod'
,'$other_writ' WHERE id='$_SESSION[user_id]
)
";
mysql_query($sql_insert,$link) or die("Insertion Failed:" . mysql_error());
}
echo('<a href="myaccount.php?id=' . $_SESSION['id'] . '">link</a>');
exit();
}
}
Please help!