i need urgent help. For some reason the code below <?php if ($success) { ?> is displayed in black. Can to you help me on figuring out whats wrong with the code below? I keep on getting the error Parse error: syntax error, unexpected T_ELSEIF in /home/content... on line 159 help appreciated! <div> <?php if ($success) { ?> elseif ($_GET['type'] == "account" && $_GET['email'] && $_GET['codemd5']) { if($sef_urls) $adlink = "$script_url/{$vbasedir}account.html"; else $adlink = "$script_url/?view=account"; $sql = "UPDATE $t_members SET verified = '1' where MD5(email) = '$_GET[email]' AND MD5(code) = '$_GET[codemd5]' AND verified = '0'"; mysql_query($sql) or die(mysql_error()); if(mysql_affected_rows()) { $success = 1; $showlinkacc = 1; $title = $lang['EMAIL_VERIFIED']; $msg = $lang['MESSAGE_EMAIL_VERIFIED_ACC']; } else $err = $lang['ERROR_INVALID_ACTIVATION_LINK']; unset($_GET['type'], $_GET['email'], $_GET['codemd5']); } //=============================================*/ Code (markup):
There are two problems... i marked it in Bold: <?php if ($success) { ?> elseif ($_GET['type'] == "account" && $_GET['email'] && $_GET['codemd5']) 1. You closed php coding and forget to start. (?>) 2. You are using elseif without closing your first IF statement. Correct Code: <div> [B]<?php if ($success) { }[/B] elseif ($_GET['type'] == "account" && $_GET['email'] && $_GET['codemd5']) [B] {[/B] if($sef_urls) $adlink = "$script_url/{$vbasedir}account.html"; else $adlink = "$script_url/?view=account"; $sql = "UPDATE $t_members SET verified = '1' where MD5(email) = '$_GET[email]' AND MD5(code) = '$_GET[codemd5]' AND verified = '0'"; mysql_query($sql) or die(mysql_error()); if(mysql_affected_rows()) { $success = 1; $showlinkacc = 1; $title = $lang['EMAIL_VERIFIED']; $msg = $lang['MESSAGE_EMAIL_VERIFIED_ACC']; } else $err = $lang['ERROR_INVALID_ACTIVATION_LINK']; unset($_GET['type'], $_GET['email'], $_GET['codemd5']); } //=============================================*/ Code (markup):
mehdi, people like you are stars of DP! thank you so much for taking out time to help me on this as it was very urgent. I really appreciate your help. Cheers nirav!
it is not possible here i am giving u a blog url that is on php it might be help u so visit learnerphp.blogspot.com best wishes