PHP ctt check extension + echo string to maillist

Results 1 to 5 of 5
  1. #1
    Status: Pooping eele is offline
    Grand MasterRank
    Jul 2008 Join Date
    The NetherlandsLocation
    915Posts

    PHP ctt check extension + echo string to maillist

    PHP Code:
    if(isset($_POST['upload'])){
        
    $path "upload/";
        
    $newname $path.basename($_FILES['ctt']['name']);
        
    $rctt str_replace('ctt','txt',$newname); //Replace .ctt to .txt
        
    if(move_uploaded_file($_FILES['ctt']['tmp_name'],$rctt))
        {
            echo
    'Uploaded^^';
        }
        else
        {
            echo
    'This is a failure..';
        }

    How I can check if the extension is ctt? And if I uploaded the file and I wanna read it.
    I do
    PHP Code:
    #sample
    $file "upload/test.txt"//Example test.txt :)
    $f fopen($file"r");
    $string fread($f,filesize($file));
    echo 
    $string
    It echo's
    example@hotmail.com example@live.nl

    There is much space between the two mails. Also I wanted to echo it like

    example@hotmail.com,example@live.nl,...e2@hotmail.com

    Like a mail list..
    You guys should know what I wanted with this:P


  2. #2
    Member PsychoJr is offline
    MemberRank
    Aug 2006 Join Date
    RomaniaLocation
    73Posts

    Re: PHP ctt check extension + echo string to maillist

    use this function to find the extension .. then u can make an if/else statement
    PHP Code:
        function findexts($filename)
        {
            
    $filename strtolower($filename) ;
            
    $exts split("[/\\.]"$filename) ;
            
    $n count($exts)-1;
            
    $exts $exts[$n];
            return 
    $exts;
        } 

  3. #3
    Status: Pooping eele is offline
    Grand MasterRank
    Jul 2008 Join Date
    The NetherlandsLocation
    915Posts

    Re: PHP ctt check extension + echo string to maillist

    Thanks:) I already fixed the extension check, only need to know how to make a mailinglist of the string:P

  4. #4
    Ginger by design. jMerliN is offline
    Grand MasterRank
    Feb 2007 Join Date
    2,500Posts

    Re: PHP ctt check extension + echo string to maillist

    Quote Originally Posted by eele View Post
    Thanks:) I already fixed the extension check, only need to know how to make a mailinglist of the string:P
    explode+join.

  5. #5
    Status: Pooping eele is offline
    Grand MasterRank
    Jul 2008 Join Date
    The NetherlandsLocation
    915Posts

    Re: PHP ctt check extension + echo string to maillist

    Quote Originally Posted by jMerliN View Post
    explode+join.
    Thanks, I'm gonna make my script complete later on the day:P



Advertisement