Advertisement
Guest User

Untitled

a guest
Sep 28th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.95 KB | None | 0 0
  1. <?php
  2. ob_start();
  3. include "./includes/timerhead.php";
  4. include "./includes/conn.php";
  5. include "./includes/includes.php";
  6. include "./includes/nocache.php";
  7. include "./includes/validation.php";
  8.         session_start();
  9.  
  10.  
  11.  
  12.       if (isset($_REQUEST['testID'])) {
  13.         $testID=$_REQUEST['testID'];
  14.       }
  15.       if (isset($_POST['testID'])) {
  16.         $testID=$_POST['testID'];
  17.       }
  18.       if (!isset($testID)) {
  19.         redirect_to("index.php");
  20.       }
  21.  
  22.     $testSQL="SELECT * FROM Tests WHERE ID=" . $testID;
  23.     $testResult=mysql_query($testSQL, $conn);
  24.     $testRs=mysql_fetch_assoc($testResult);
  25.    
  26.  
  27. ?>
  28. <html><!-- InstanceBegin template="/Templates/Test%20Layout.dwt.php" codeOutsideHTMLIsLocked="false" -->
  29.  
  30. <head>
  31. <link href="includes/wtstyle.css" rel="stylesheet"  type="text/css">
  32. <?
  33. // Copyright (C) 2003 - 2007 Eppler Software.  All rights reserved.
  34. // Any redistribution or reproduction of any materials herein is strictly prohibited.
  35. ?>
  36. <!-- InstanceBeginEditable name="doctitle" -->
  37. <title><?=TITLE?></title>
  38. <!-- InstanceEndEditable -->
  39. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  40. <!-- InstanceBeginEditable name="head" -->
  41. <style type="text/css">
  42. <!--
  43. .style8 {color: #FF0000}
  44. -->
  45. </style>
  46. <!-- InstanceEndEditable -->
  47. <style type="text/css">
  48. input.next
  49. {
  50.   margin-top       : 1.6em;
  51.   float            : right;
  52. }
  53. .t {background: url(images/dot.gif) 0 0 repeat-x; width: 20em}
  54. .b {background: url(images/dot.gif) 0 100% repeat-x}
  55. .l {background: url(images/dot.gif) 0 0 repeat-y}
  56. .r {background: url(images/dot.gif) 100% 0 repeat-y}
  57. .bl {background: url(images/bl.gif) 0 100% no-repeat}
  58. .br {background: url(images/br.gif) 100% 100% no-repeat}
  59. .tl {background: url(images/tl.gif) 0 0 no-repeat}
  60. .tr {background: url(images/tr.gif) 100% 0 no-repeat; padding:10px}
  61. p {font-family: sans-serif; text-align:left}
  62. <?php
  63. if (DISABLE_PRINT) {  ?>
  64. @media print {
  65. body {display:none}
  66. <?php
  67. }
  68. ?>
  69. }
  70.  
  71. </style>
  72. </head>
  73. <?php
  74.       if (IPSESSIONS) {
  75.         $strSQL="SELECT * FROM Sessions WHERE IP='" . $ip . "'";
  76.       } else {
  77.         $strSQL="SELECT * FROM Sessions WHERE ID='" . $sessID . "'";
  78.       }
  79.       // $strSQL="SELECT * From Sessions WHERE IP='" . $ip . "'";
  80.       $result=mysql_query($strSQL, $conn)
  81.         or $myVar=true;
  82.      
  83.       if (!isset($myVar)) {
  84.           $num_records=mysql_num_rows($result);
  85.           $row=mysql_fetch_array($result);
  86.           if ($num_records == 0) {
  87.             $myVar = true;
  88.           } else {
  89.             $myVar = false;
  90.           }
  91.       }
  92.  
  93. ?>
  94. <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="<?=BGCOLOR?>">
  95. <?php
  96. include "./includes/top.php";
  97. ?>
  98. <div align="center">
  99.   <table width="100%" border="0" cellpadding="2" cellspacing="0">
  100.     <tr>
  101.       <td height="47" align="left" valign="middle"><img src="images/webtestertop.gif" width="<?=LOGOW?>" height="<?=LOGOH?>">
  102.         <br>        
  103.       </td>
  104.       <td align="center" valign="middle">
  105.                 <?php if (!$myVar) { ?>
  106.          
  107.         <div class="t"><div class="b"><div class="l"><div class="r"><div class="bl"><div class="br"><div class="tl">
  108.           <div class="tr"><font face="Arial, Helvetica, sans-serif"><?php echo($row['FirstName'] . $myVar . " " . $row['LastName']) ?><br>
  109.             <?php } ?>
  110.         <?php
  111.  if ($myVar != 1) {
  112.     if ($row['TestName'] != "") {
  113.  ?>
  114.         <?=$row['TestName']?><br>
  115.         <div id="countdowncontainer"></div>
  116.         <?
  117.         if ($row['AllowQuit']) {
  118.             if (!$row['review'] and !$quit) {
  119.         ?>
  120.         <div id="quit"><a href="./quitTest.php">Quit</a></div>
  121.         <?      }
  122.             }?>
  123.         </font>
  124.         </div></div></div></div></div></div></div></div>
  125.         <?php
  126.  }
  127. }
  128. ?>
  129. </td>
  130.     </tr>
  131.     <tr>
  132.       <td colspan="2" align="left" valign="top"> <div class="hr">
  133.         <hr />
  134.       </div>      
  135.         <!-- InstanceBeginEditable name="Content Area" -->
  136.         <form name="form1" method="post" action="startTest.php">
  137.         <?php
  138.     if($testRs['RequireLogin']) {
  139.         ?>
  140.           <p>Username:<br>
  141.           <?php
  142.           if (isset($_REQUEST['username'])) {
  143.             $username=stripslashes($_REQUEST['username']);
  144.           }
  145.           if (isset($_REQUEST['password'])) {
  146.             $password=stripslashes($_REQUEST['password']);
  147.           }
  148.           if (isset($_SESSION['username'])) {
  149.             $username=stripslashes($_SESSION['username']);
  150.             $password=stripslashes($_SESSION['password']);
  151.           }
  152.           if (PHPBB) {
  153.             define('IN_PHPBB', true);
  154.             $phpbb_root_path = PHPBB_PATH;
  155.             include($phpbb_root_path . 'extension.inc');
  156.             include($phpbb_root_path . 'common.php');
  157.             include($phpbb_root_path . 'config.php');
  158.             $userdata = session_pagestart($user_ip, PAGE_INDEX);
  159.             init_userprefs($userdata);
  160.             if($userdata['session_logged_in']) { // if logged in
  161.                 echo("Logged In");
  162.                 $_SESSION['TestID']=$testID;
  163.                 redirect_to("startTest.php");
  164.                 ob_end_flush();
  165.                 exit;
  166.             }
  167.           }
  168.           ?>
  169.             <input name="username" type="text" id="username" size="30" maxlength="254" value="<?=$username?>">
  170.             <script language="JavaScript">
  171.             <!--
  172.  
  173.             document.form1.username.focus();
  174.  
  175.             //-->
  176.           </script>
  177.           </p>
  178.           <p>Password:<br>
  179.             <?php
  180.             if ($password!="") {
  181.             ?>
  182.             <input name="passwordmd5" type="password" id="passwordmd5" size="30" maxlength="254" value="<?=$password?>">
  183.             <?php } else { ?>
  184.             <input name="password" type="password" id="password" size="30" maxlength="254">
  185.             <?php } ?>         
  186.           </p>  <?php
  187.     } else {
  188.         ?>
  189.         <p>Please complete the following information:</p>
  190.         <?php if ($_REQUEST['noname']) { ?>
  191.         <p class="style8">You must enter a name</p>
  192.         <?php } ?>
  193.         <p><?=FIRST_NAME?><br>
  194.             <input name="FirstName" type="text" id="FirstName" size="30" maxlength="254">
  195.           </p>
  196.           <script language="JavaScript">
  197.             <!--
  198.  
  199.             document.form1.FirstName.focus();
  200.  
  201.             //-->
  202.           </script>
  203.           <p><?=LAST_NAME?><br>
  204.             <input name="LastName" type="text" id="LastName" size="30" maxlength="254">
  205.           </p>
  206.           <?php
  207.           if($testRs['EmailUsers']) {
  208.             if ($_REQUEST['emailerror']) {
  209.           ?>
  210.           <p class="style8">Email addresses don't match</p>
  211.           <?php } ?>
  212.           <?php if ($_REQUEST['noemail']) { ?>
  213.           <p class="style8">You must enter an email address</p>
  214.           <?php } ?>
  215.           <p><?=EMAIL_ADDRESS?><br>
  216.             <input name="Email" type="text" id="Email" size="30" maxlength="254">
  217.             <input name="RequireEmail" type="hidden" value="true">
  218.           </p>
  219.           <?php
  220.             if (VERIFY_EMAIL) {
  221.           ?>
  222.           <p><?=VERIFY_EMAIL_STRING?><br>
  223.             <input name="VerifyEmail" type="text" id="VerifyEmail" size="30" maxlength="254">
  224.           </p>
  225.           <?php
  226.             }
  227.           }
  228.           if ($testRs['AltEmail']) {
  229.           ?>
  230.           <p><?=ALT_EMAIL?><br>
  231.             <input name="AltEmail" type="text" id="AltEmail" size="30" maxlength="254">
  232.           </p>
  233.           <?php
  234.             if (VERIFY_EMAIL) {
  235.           ?>
  236.           <p><?=VERIFY_ALT_EMAIL?><br>
  237.             <input name="VerifyAltEmail" type="text" id="VerifyAltEmail" size="30" maxlength="254">
  238.           </p>
  239.           <?php
  240.             }
  241.           }
  242.     }
  243.           ?>
  244.           <?php
  245.           $prefsSQL="SELECT * FROM Preferences";
  246.           $prefsResult=mysql_query($prefsSQL, $conn);
  247.           $prefs=mysql_fetch_assoc($prefsResult);
  248.           $notes=$prefs['notes'];
  249.           ob_end_flush();
  250.           ?>
  251.           <p><?=$notes?>:<br>
  252.             <input name="Notes" type="text" id="Notes" size="30" maxlength="254">
  253.           </p>
  254.           <p>
  255.             <input type="submit" name="Submit" value="<?=START_BUTTON?>">
  256.             <input name="TestID" type="hidden" id="TestID" value="<?=$testID?>">
  257.             <input name="IPAddress" type="hidden" id="IPAddress" value="<?=$ip?>">
  258.           </p>
  259.         </form>
  260.         <!-- InstanceEndEditable -->      </td>
  261.     </tr>
  262.     <tr>
  263.       <td colspan="2" align="center" valign="top">
  264.         <div align="center">
  265.         <div class="hr"><hr /></div>
  266.           <?php include "./includes/copyright.php" ?></div></td>
  267.     </tr>
  268.   </table>
  269. </div>
  270. </body>
  271. <!-- InstanceEnd --></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement