Php vars $_POST $_FILES

Discussion in 'PHP' started by digitals.future, Apr 5, 2009.

  1. #1
    Hello i'm working on a form with about 40 - 45 vars including $_FILES
    and i was thinking .. if there is another solution to get rid of some of the vars from $_FILES and maybe $_POST vars :) to write less line of code and declare less vars

    ex:
    
    <?php 
    
    if(isset($_POST['submit']))
    {
     
        $name = $_POST['name'];
        $surname = $_POST['surname'];
        $age = $_POST['age'];
        
    
        $tmp_name = $_FILES['upload']['tmp_name'][0];
        $file_name  = $_FILES['upload']['name'][0];
    
    
    ....
    ...
    ....
       // code... 
       
    }
    
    ?>
    
    Code (markup):
    what i'm trying to say is that i have 5 upload fields that i have to set some vars and 10 fields for input datas.. and all of them i will have to parse in myql
    the easy way would be setting a var .. but i know that there is onther way
    can someone give me an advice what should i do ?
     
    digitals.future, Apr 5, 2009 IP
  2. Syndrom

    Syndrom Peon

    Messages:
    89
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    @ html
    <input type="file" name="upload[]"><input type="file" name="upload[]"><input type="file" name="upload[]">
    @ php
    $tmp_name = $_FILES[0-9]['tmp_name']

    should i explain it with more details?
     
    Syndrom, Apr 5, 2009 IP
  3. digitals.future

    digitals.future Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yeah you should.. :-? i don't understand quite well :-?
     
    digitals.future, Apr 5, 2009 IP
  4. digitals.future

    digitals.future Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    can you please provide more details?
     
    digitals.future, Apr 5, 2009 IP