...

View Full Version : Auto redirecting problem



Digicoder
11-18-2007, 06:42 PM
I've recently built an upload script and got it all working but there is one problem.
Whenever a user submits a file upload the uploader completes the upload and immediately redirects the user to an address that doesn't exist on my site.
www.gamezftw.com/*USERSFILE.EXT* is the address but userfile.ext is replaced with the file name and extension of the users submitted file.

Does any one know who to stop my uploader from redirecting?
Thanks all.

CFMaBiSmAd
11-18-2007, 07:10 PM
Ummm. The only way to be able to know what your code is and to be able to find and fix the problem would be if you were to post your code.

Digicoder
11-18-2007, 07:21 PM
Here you go.


case 'podz': //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PODZ
$new_name = $_POST['name'];
$files = array( '.mp3', '.wav', '.MP3', '.WAV');
if($_SESSION['permix']['a_podz'] == 1)
{
if ($podz->validate())
{
$podz->freeze();

if(isset($_POST['pid']))
{
$podz->process('podz_rocessing', false);
}

if (isset($_GET['sub']) && $_GET['sub'] == 'upload' and !isset($_POST['pid']))
{
// Uploading/Resizing Script

$ext = explode('.', basename($_FILES['pod_file']['name'])); // Get The File Extention In The Format Of , For Instance, .jpg, .gif or .php
$file_ext = '.'.$ext[1];
$url1 = $new_name.$file_ext; // Set $url To Equal The Filename For Later Use
if(in_array($file_ext, $files) && is_uploaded_file($_FILES['pod_file']['tmp_name']))
{
move_uploaded_file($_FILES['pod_file']['tmp_name'], $pdir . $url1);
$links = "$pdir" . $new_name.$file_ext;
$size = $_FILES['pod_file']['size'];
$podz->process('podz_processing', false);
}
else
{
print '<font color="#FF0000">ERROR: Wrong filetype (has to be a .wav or .mp3. Yours is '; // Error Message If Filetype Is Wrong
print $file_ext; // Show The Invalid File's Extention
print '.</font>';
print_r($_FILES);
}
}
}
else
{
define('PAGE_TITLE', 'ACP - Podcasts');
define('BODY_FORM','width="1000" cellpadding="0" cellspacing="0" height="1" bordercolor="#000000" style="main" border="0"');
include_once('includes/Header.php');
include_once('includes/Hmessage.php');
$podz->display();
include_once('includes/Fmessage.php');
include_once('includes/footer.php');
}
}
else
{
message('You don\'t have permissions to access the Podcast control','User Notice:', NULL,NULL,NULL);
}
break;



This is only the one case that handles the podcast processing, the rest of the file is about 800 lines of code that use PEAR/QuickForm and other query functions.
I've started scanning around for any thing in the connected processing that might have anything to remotely do with this. I suspect I may have used a variable name twice or something.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum