Hi,
This is my code
<?php
session_start();
echo '
<BR><BR><BR><BR><font color="#ffffff"><h2> Add New Track </h2></font>
<form enctype="multipart/form-data" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="524288">
<fieldset><legend<font color="#ffffff">Select a GBX file of 512KB or smaller to be uploaded:</legend>
<font color="#ffffff"><b>File:</b> <input type="file" name="upload" /></font> <BR>
<font color="#ffffff"><b>Track Name:</b> <input type="text" name="name" /></font>
<div align="center"><input type="submit" name="submit" value="Submit" /></div>
<input type="hidden" name="submitted" value="TRUE" />
</fieldset>
<BR><BR>
</form> ';
// Check if the form has been submitted:
if (isset($_POST['submitted'])) {
// Check for an uploaded file:
if (isset($_FILES['upload'])) {
// Move the file over.
if (move_uploaded_file ($_FILES['upload']['tmp_name'], "replays/{$_FILES['upload']['name']}")) {
echo '<p><em>The file has been uploaded!</em></p>';
} // End of move... IF.
} // End of isset($_FILES['upload']) IF.
// Check for an error:
if ($_FILES['upload']['error'] > 0) {
echo '<p>The file could not be uploaded because: <strong>';
// Print a message based upon the error.
switch ($_FILES['upload']['error']) {
case 1:
print 'The file exceeds the upload_max_filesize setting in php.ini.';
break;
case 2:
print 'The file exceeds the MAX_FILE_SIZE setting in the HTML form.';
break;
case 3:
print 'The file was only partially uploaded.';
break;
case 4:
print 'No file was uploaded.';
break;
case 6:
print 'No temporary folder was available.';
break;
case 7:
print 'Unable to write to the disk.';
break;
case 8:
print 'File upload stopped.';
break;
default:
print 'A system error occurred.';
break;
} // End of switch.
print '</strong></p>';
} // End of error IF.
// Delete the file if it still exists:
if (file_exists ($_FILES['upload']['tmp_name']) && is_file($_FILES['upload']['tmp_name']) ) {
unlink ($_FILES['upload']['tmp_name']);
}
include_once("gbxdatafetcher.inc.php");
$filename = "replays/{$_FILES['upload']['name']}";
$gbx = new GBXReplayFetcher($filename, true);
$replayusername = $_SESSION['replayusername'];
$numberformat = $_SESSION['numberformat'];
$trackid = $_SESSION['trackid'];
$trackauthor = $_SESSION['trackauthor'];
$name = $_POST['name'];
?>
gbxdatafetcher.inc.php code
<?php
$replayusername = 'thecase';
$replaytime = '054187';
$trackid = '189478';
$trackauthor = 'bob';
$_SESSION['replayusername'] = $replayusername;
$_SESSION['numberformat'] = $replaytime;
$_SESSION['trackid'] = $trackid;
$_SESSION['trackauthor'] = $trackauthor;
?>
Error
Notice: Undefined index: replayusername
Notice: Undefined index: numberformat
Notice: Undefined index: trackid
Notice: Undefined index: trackauthor
Any ideas,
Thanks