File upload script duel problem
Posted: Thu May 13, 2004 10:02 am
(I want you to know I have been trying to fix this myself all day ... I haven't just gone to you guys as a quick fix )
I have a script for uploading MP3s ( my server/host won't allow this filetype...I don't know why...but that is for me to fix
)
Anyway
The page sporadically and randomlly shows this error:
And also everytime the page is visted, a repeat of the information pertaining to the last file uploaded is written to the .dat file.
Can anyone help?
I have a script for uploading MP3s ( my server/host won't allow this filetype...I don't know why...but that is for me to fix
Anyway
The page sporadically and randomlly shows this error:
Code: Select all
Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/site28/fst/var/www/html/phpBB2/displaying.php:14) in /home/virtual/site28/fst/var/www/html/phpBB2/includes/sessions.php on line 297
Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/site28/fst/var/www/html/phpBB2/displaying.php:14) in /home/virtual/site28/fst/var/www/html/phpBB2/includes/sessions.php on line 298Can anyone help?
Code: Select all
<?php
define('IN_PHPBB', true);
$phpbb_root_path = '../phpBB2/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
if( $userdata['session_logged_in'] )
{
$imagesdir = "../mp3/updir/";
$fp = fopen('../mp3/news.dat','a+');
$file_name = $_FILES['userfile']['name'];
$file_url = "../mp3/updir/".$file_name;
if($HTTP_POST_VARS['submit'])
{
$line = date ("F j, Y, g:i a"). "|" . $HTTP_POST_VARS['desc']. "|" . $file_url;
$line = str_replace("\r\n","<br>",$line);
$line = stripslashes($line);
$line .= "\r\n";
fwrite($fp, $line);
if (isset($_FILES['userfile'])) {
if (!move_uploaded_file($_FILES['userfile']['tmp_name'], $imagesdir . $_FILES['userfile']['name'])) ;
{
echo ' ';
}
} else {
echo'';
}
}
$foom = $fishbaggerss
?>
<FORM ACTION="<?php echo $_SERVER['PHP_SELF']; ?>" METHOD="POST" enctype="multipart/form-data" NAME="mp">
<span class="form2">
Upload MP3 File
</div>
<input type="file" class="button" name="userfile" id="userfile" >
<br>
<span class="form2">
Description
</div>
<TEXTAREA COLS="20" ROWS="5" NAME="desc">
</TEXTAREA>
<br>
<input type="hidden" name="tree" value=$file_url>
<BR>
<INPUT class="button" TYPE="reset" NAME="reset" VALUE="r e s e t">
<INPUT class="button" TYPE="submit" NAME="submit" VALUE="P O S T">
</FORM>
<?php
}
else
{
echo('
<form action="/phpBB2/login2.php" method="post">
<input type="text" name="username">
<input type="password" name="password">
<br/>
<input type="submit" class="button" value="login" name="login">
</form>');
}
?>