<html>
<head>
<body style="background-image:url(FadedBG.png); background-repeat:no-repeat; background-attachment:fixed; background-position:center;">
<html>
<head>
<title> PCRA </title>
</head>
</html>
<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
if( isset($_POST) && !empty($_POST) )
{
$host = "localhost";
$user = "uname";
$pw = "password";
$db = "pcra";
$conn = mysql_connect( $host, $user, $pw )
or die( "Error! Unable to connect to database server: <br/>" . mysql_error() );
$rs = mysql_select_db( $db, $conn )
or die( "Error! Unable to connect to database: <br/>" . mysql_error() );
foreach($_POST as $key=>$value)
{
${$key}=mysql_real_escape_string($value);
}
$strSQL = "INSERT INTO offender_test
( fname, lname, pacts, tdate, employee, question1, question2, question3 )
VALUES
( '" . $fname . "', '" .$lname . "', '" . $tdate . "', '" . $employee . "', '" . $question1 . "', '" . $question2 . "', '" . $question3 . "' )";
switch($_REQUEST['employee']) {
case "Employee1":
$Email = "employee1@yahoo.org";
break;
case "Employee2":
$Email = "employee2@yahoo.org";
break;
default:
echo "Error, no employee selected!!!";
break;
}
$Message = "The below has successfully completed the PCRA test.\n \nTest Date : ${_REQUEST['tdate']}\nOffender Name : ${_REQUEST['fname']} ${_REQUEST['lname']} \nemployee : ${_REQUEST['employee']} \n\nQuestion 1 : I will allow nothing to get in the way of me getting what I want......(Answer ${_REQUEST['question1']}) \n\nQuestion 2 : I find myself blaming society and external circumstances for the problems I have had in life......(Answer ${_REQUEST['question2']}) ";
$Subject = "An Person Has Finished The PCRA Test";
$Headers = "From: PCRA@google.com \n";
if (mail($Email, $Subject, $Message, $Headers))
if (!mysql_query( $strSQL, $conn )){
echo( "Unable to save data to database: <br/>" . mysql_error() . "<br/>" . $strSQL . "</span><br/>" );
}
else{
header( "Location: submitted.html" );
exit;
}
}
?>
<form method="post" action="thetest.php">
<table width="95%" border="4">
<b><u> <h2>PCRA Section</h2></b></u>
<tr>
<td><b>First Name:</b> <br><input type="text" name="fname" size="20" maxlength="30" /><br> </td>
<td><b>Last Name: </b><br><input type="text" name="lname" size="20" maxlength="30" /><br></td>
<td><b>Date</b><br><input name = "tdate" id="todaysDate" value="<?php echo(date("Y-m-d")); ?>"> <br></td>
</tr>
<tr>
<td>
<b>Who's Your employee?<br>
<select name="employee">
<option value=""></option>
<option value="Employee1">Employee1</option>
<option value="Employee2">Employee2</option>
</select> </td>
</tr>
<table width="95%" border="5">
<b><br><h5>Directions: The following items, if answered honestly, are designed to help you better understand your thinking and behavior. Please take the time to complete each of the 80 items on this inventory using the four-point scale defined below:</h5></b>
<b><h5>4 = Strongly Agree</b><br>
<b>3 = Agree</b><br>
<b>2 = Uncertain</b><br>
<b>1 = Disagree</b><br><br>
<tr>
<td><b>1. I will allow nothing to get in the way of me getting what I want......<br> <select name="question1" />
<option value=""></option>
<option value="4">4</option>
<option value="3">3</option>
<option value="2">2</option>
<option value="1">1</option>
</select>
</tr>
<tr>
<td><b>2. I find myself blaming society and external circumstances for the problems I have had in life......<br> <select name="question2" />
<option value=""></option>
<option value="4">4</option>
<option value="3">3</option>
<option value="2">2</option>
<option value="1">1</option>
</select>
</tr>
<tr>
<td><b>3. Change can be scary......<br> <select name="question3" />
<option value=""></option>
<option value="4">4</option>
<option value="3">3</option>
<option value="2">2</option>
<option value="1">1</option>
</select>
</tr>
<tr>
</tr>
<td>
<input type="submit" value="SUBMIT TEST"/>
</td>
</form>
</body>
</html>
JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.
TRUSTED BY