/confirmation.php

https://github.com/AvinashMudunuri/Modernize · PHP · 67 lines · 61 code · 6 blank · 0 comment · 3 complexity · 404fc10db655a9b5e6bfb817fc375494 MD5 · raw file

  1. <?php
  2. require_once('Connections/powermigrate.php');
  3. include("includes/common.php");
  4. ?>
  5. <?php
  6. $colname_confirmation = "-1";
  7. if (isset($_GET['confirmcode'])) {
  8. $colname_confirmation = $_GET['confirmcode'];
  9. }
  10. mysql_select_db($database_powermigrate, $powermigrate);
  11. $query_confirmation = sprintf("SELECT * FROM customers WHERE passkey = %s", GetSQLValueString($colname_confirmation, "text"));
  12. $confirmation = mysql_query($query_confirmation, $powermigrate) or die(mysql_error());
  13. $row_confirmation = mysql_fetch_assoc($confirmation);
  14. $totalRows_confirmation = mysql_num_rows($confirmation);
  15. if($totalRows_confirmation == 1){
  16. $update_confirmation_SQL = sprintf("UPDATE customers SET isactive = '1' WHERE passkey = %s", GetSQLValueString($colname_confirmation, "text"));
  17. $update_confirmation = mysql_query($update_confirmation_SQL, $powermigrate);
  18. $updateRow_confirmation = mysql_fetch_assoc($update_confirmation);
  19. $totalRows_updated = mysql_num_rows($update_confirmation);
  20. }else{
  21. die(mysql_error());
  22. }
  23. ?>
  24. <?php include("header.php");?>
  25. <div id="main-content">
  26. <div style="margin:3%; padding:5%;height:auto;">
  27. <ul style="line-height:20px">
  28. <li style="font-size:15px; line-height:20px"><br />
  29. Congratulations, <?php echo $row_confirmation['first_name']; ?>!
  30. Your account is now activated and you can begin using SoftSol's industry
  31. leading instant PowerBuilder migration tools.
  32. </li>
  33. <li style="font-size:15px;color:#1F497d; line-height:25px"><br />
  34. <?php
  35. if (!isset($_SESSION)) {
  36. session_start();
  37. }
  38. $loginStrGroup = "";
  39. $MM_redirectLoginSuccess = "details.php";
  40. if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
  41. //declare two session variables and assign them
  42. $_SESSION['MM_Username'] = $row_confirmation['email'];
  43. $_SESSION['MM_UserGroup'] = $loginStrGroup;
  44. $_SESSION['MM_fname'] = $row_confirmation['first_name'];
  45. $_SESSION['MM_lname'] = $row_confirmation['last_name'];
  46. header("Location: " . $MM_redirectLoginSuccess );
  47. ?>
  48. <div align="center">
  49. <input type="button" value="Continue" style="margin:5px;color:#085299;
  50. font-weight:bold" onclick="location.href='details.php'" /></div>
  51. </li>
  52. </ul>
  53. </div>
  54. </div>
  55. <?php include("footer.php");?>
  56. <?php
  57. mysql_free_result($confirmation);
  58. mysql_free_result($update_confirmation);
  59. ?>