//ob_start(); // echo "Test"; // header("Location: http://www.php.net"); // ob_flush(); $output = new GeneralResponseQ(); if (isset($_REQUEST['h']) && !preg_match('/[^0-9a-zA-Z]+/', $_REQUEST['h']) && isset($_REQUEST['email']) && isValidEmail($_REQUEST['email'])) { $sql = null; if (isset($_REQUEST['iv']) && $_REQUEST['iv']) { $sql = 'UPDATE anonymous_users SET validated = 0 WHERE email = \'%s\' AND hash = \'%s\''; } else { $sql = 'UPDATE anonymous_users SET validated = 1 WHERE email = \'%s\' AND hash = \'%s\''; } $sql = sprintf($sql, $_REQUEST['email'], $_REQUEST['h']); $result = mysql_query($sql); if ($result === false) { $output->pushMsg(new GeneralResponse('We\'re sorry there was an error when trying to verify your email address. An administrator has been contacted. Please try again later.'), iResponseQ::MSG_TYPE_ERROR); $body = 'failed to execute sql \'' . $sql . '\''; $body .= ' Db error \'' . mysql_error() . '\''; $body .= ' _REQUEST[] = ' . var_export($_REQUEST, true); $mail = new phpmailer(); $mail->From = "*****@*****.**"; $mail->FromName = "No-reply"; $mail->Host = "127.0.0.1"; // specify main and backup server $mail->AddAddress($adminEmail, "BoD Admin"); $mail->AddReplyTo("*****@*****.**", "No-reply"); $mail->WordWrap = 50; // set word wrap $mail->IsHTML(true); // set email format to HTML $mail->Subject = "Error: Verifying user email";
$tmp = sprintf($tmp, $row['question_id'], $answers[$row['question_id']]); break; default: $tmp = "('','','','','')"; } if ($sql) { $sql .= ", " . $tmp; } else { $sql = $tmp; } } if ($sql) { $sql = 'INSERT INTO users_answers (question_id,answerText,answerDate,answerNumeric) VALUES ' . $sql; $result = mysql_query($sql); if ($result === false) { $output->pushMsg(new GeneralResponse('Internal error occured. An administrator has been notified. 1'), iResponseQ::MSG_TYPE_ERROR); } else { $output->pushMsg(new GeneralResponse('Survey Submitted'), iResponseQ::MSG_TYPE_NORMAL); } } else { $output->pushMsg(new GeneralResponse('Internal error occured. An administrator has been notified. 2'), iResponseQ::MSG_TYPE_ERROR); } } else { $output->pushMsg(new GeneralResponse('Internal error occured. An administrator has been notified. 3'), iResponseQ::MSG_TYPE_ERROR); } ?> <page name="act_survey"> <?php echo '<surveyid><![CDATA[' . '' . ']]></surveyid>'; $printer = new XMLResponseQPrinter($output);
// echo "Test"; // header("Location: http://www.php.net"); // ob_flush(); $output = new GeneralResponseQ(); if (isset($_REQUEST['h']) && !preg_match('/[^0-9a-zA-Z]+/', $_REQUEST['h']) && isset($_REQUEST['cat']) && isset($_REQUEST['u'])) { $hash = $_REQUEST['h']; $catid = $_REQUEST['cat']; $userid = $_REQUEST['u']; $sql = null; $sql = 'DELETE FROM anonymoususers_newsletterscategories WHERE anonuser_id IN (SELECT anonuser_id FROM Anonymous_Users WHERE hash = \'%s\' AND anonuser_id = %s) AND newslettercat_id IN (SELECT newslettercat_id FROM newsletters_categories WHERE newslettercat_id = %s)'; $sql = sprintf($sql, $hash, $userid, $catid); $result = mysql_query($sql); if ($result === false) { $output->pushMsg(new GeneralResponse('We\'re sorry there was an error when trying to remove your subscription. An administrator has been contacted. Please try again later.'), iResponseQ::MSG_TYPE_ERROR); $body = 'failed to execute sql \'' . $sql . '\''; $body .= ' Db error \'' . mysql_error() . '\''; $body .= ' _REQUEST[] = ' . var_export($_REQUEST, true); $mail = new phpmailer(); $mail->From = "*****@*****.**"; $mail->FromName = "No-reply"; $mail->Host = "127.0.0.1"; // specify main and backup server $mail->AddAddress($adminEmail, "BoD Admin"); $mail->AddReplyTo("*****@*****.**", "No-reply"); $mail->WordWrap = 50; // set word wrap $mail->IsHTML(true); // set email format to HTML $mail->Subject = "Error: Removing user subscription";