Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5

Thread: php newb

  1. #1
    Senior Member Noteleklabs's Avatar
    Join Date
    Jun 2012
    Location
    NC
    Posts
    217
    Member #
    31890
    Liked
    28 times
    I am Making a file Uploader! this is the code for the file sent validation:
    PHP Code:
                if (!file_exists($this->uploadLocation)){
                    
    $error "The target directory doesn't exists!";
                } else if (!
    is_writeable($this->uploadLocation)) {
                    
    $error "The target directory is not writeable!";
                } else {
                    
    $target_path $this->uploadLocation basename$_FILES['myfile']['name']);

                    if(@
    move_uploaded_file($_FILES['myfile']['tmp_name'], $target_path)) {
                        
    $msg basename$_FILES['myfile']['name']).
                        
    "http://www.notelek.tk/upload/";
                    } else{
                        
    $error "The upload process failed!";
                    }
                }

                
    $this->showUploadForm($msg,$error);
            } 
    that makes makes is show (yourfilehere)http://www.notelek.tk/upload/

    how do I make it a link and move the file name to the end?
    Please help!
    Hey you! Go make something!

  2.  

  3. #2
    Senior Member Zboost's Avatar
    Join Date
    Apr 2011
    Location
    Houston
    Posts
    246
    Member #
    27459
    Liked
    20 times
    I'm not 100% sure what your asking or wanting from that post, but maybe it's just me.

  4. #3
    Senior Member Zboost's Avatar
    Join Date
    Apr 2011
    Location
    Houston
    Posts
    246
    Member #
    27459
    Liked
    20 times
    $msg = "http://www.notelek.tk/upload" . basename( $_files['myfile']['name']);

    Maybe that's what you wanted?

  5. #4
    Senior Member Noteleklabs's Avatar
    Join Date
    Jun 2012
    Location
    NC
    Posts
    217
    Member #
    31890
    Liked
    28 times
    nope that doesnt work :-(
    Hey you! Go make something!

  6. #5
    Senior Member Ganners's Avatar
    Join Date
    Feb 2011
    Location
    United Kingdom
    Posts
    415
    Member #
    27007
    Liked
    92 times
    I believe as Zboost suggests, you need to change the message. If you're saying it didn't work then that makes me think you may have implemented that line incorrectly.

    PHP Code:
                if (!file_exists($this->uploadLocation)){
                    
    $error "The target directory doesn't exists!";
                } else if (!
    is_writeable($this->uploadLocation)) {
                    
    $error "The target directory is not writeable!";
                } else {
                    
    $target_path $this->uploadLocation basename$_FILES['myfile']['name']);

                    if(@
    move_uploaded_file($_FILES['myfile']['tmp_name'], $target_path)) {
                        
    $msg "http://www.notelek.tk/upload/" basename$_FILES['myfile']['name']);
                    } else{
                        
    $error "The upload process failed!";
                    }
                }

                
    $this->showUploadForm($msg,$error);
            } 
    Zboost likes this.
    Mark Gannaway Software Developer

    Recent Experiments
    - Backpropogation Neural Network language solving (http://ann.ganners.co.uk/)
    - Animated image to ASCII (http://google.ganners.co.uk/)
    - 3D Paper Characters (http://cybergame.ganners.co.uk/)
    - Anagram solving (http://roflol.co.uk/)


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:38 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com