Tell your friend to watch the code breaks. He had them messed up.
The files he needs to fix are listed below
IAT.php
PHP Code:
<?php
require_once("IATname.inc");
if( !isset( $_POST['sub'] ) || !$_POST['sub'] ){
die( 'No sub provided! go back and try again!' ); }
$_SESSION['subject'] = $_POST['sub']; ?>
<html>
<head>
<title><?php echo $IATname; ?> IAT</title>
</head>
<body>
<div id="experiment_frame">
<div id="header">
<div id="left_cat"></div><div id="right_cat"></div>
</div>
<div id="picture_frame">
<div id="exp_instruct"></div>
<div id="word" class="IATitem"></div>
<img id="wrong" src="Wrong.jpg">
</div>
</div>
<div id="under_instruct">
If the <b>E</b> and <b>I</b> keys do not work, click the mouse inside the white box and try again.<br>
If the red <font color=red>X</font> appears, press the other key to make the red <font color=red>X</font> go away.
</div>
</body>
He did not put
$_SESSION['subject'] = $_POST['sub']; on a new line therefore it was blocked by markup. Also, he has both INC and call in two separate <?> blocks; no reason to do that.
IATname.inc
PHP Code:
<?php
session_start();
$base_dir = realpath(dirname(__FILE__));
$folder_dir = "/Users/patrick/Sites/IAT/implicitassoc/trunk/output"; // retrieve the subject from the session data -- or unknown if not there (so we don't lose data)
$sub = isset( $_SESSION['subject'] ) ? $_SESSION['subject'] : 'unknown' ;
echo $sub;
$data = $_REQUEST["data"]; $randtxt = date('Y-m-d-H-s-'); // we need to stick the subject identifier in the file name
$fh = fopen($folder_dir. '/IAT_' . $sub . '-' . $randtxt . '.txt', 'w');
fwrite($fh, $data);
fclose($fh);
?>
I removed
. dechex(rand(4097,65536)); because I saw no reason why he needed a decimal to hex conversion. I don't know the full extent of his assignment. This was giving a random hex at the end of the filename.
There you go. Solved.
That will be
10,000g. Please ask him to forward it to my super secret Swiss Bank account.