Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2007
    Location
    US
    Posts
    88
    Thanks
    4
    Thanked 4 Times in 4 Posts

    Question Auto redirecting problem

    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.
    I need to find a book about all this stuff. God, thats gonna be one big book!

    http://www.gamezftw.com
    Play On!

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,026
    Thanks
    2
    Thanked 315 Times in 307 Posts
    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.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #3
    New Coder
    Join Date
    Sep 2007
    Location
    US
    Posts
    88
    Thanks
    4
    Thanked 4 Times in 4 Posts
    Here you go.
    PHP Code:
    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.
    I need to find a book about all this stuff. God, thats gonna be one big book!

    http://www.gamezftw.com
    Play On!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •