I need information and pictures added from users

Discussion in 'HTML & Website Design' started by newinvestor23, May 7, 2009.

  1. #1
    I need an HTML script, or maybe php to get information from a user, and for them to upload photos too.
    it does not have to auto post on the site, as I can just copy past it onto the site after.
    PM me for more details then I can get quotes

    thanks
     
    newinvestor23, May 7, 2009 IP
  2. Aaron Sustar

    Aaron Sustar Peon

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This is a really really (really!) basic version of what you want:

    HTML (file "form.html):
    <form action="process.php" method="post" enctype="multipart/form-data">
       User data 1: <input type="text" id="data1" name="data1" /><br />
       User data 2: <input type="text" id="data2" name="data2" /><br />
       User data 3: <input type="text" id="data3" name="data3" /><br />
       File: <input type="file" id="file" name="file" /><br />
       <input type="submit" id="submit" name="submit" value="Send data" />
    </form>
    HTML:
    PHP (file "process.php"):
    <?php
    if ($post['submit']) {
       $time = time();
       $message = "Data 1: {$_POST['data1']}<br />Data 2: {$_POST['data1']}<br />Data 3: {$_POST['data1']}<br />Uploaded file was moved to the folder 'uploaded' and named {$time}.zip.";
       move_uploaded_file($_FILES['file']['tmp_name'], "uploaded/{$time}.zip");
       mail("your@email.com", "Submitted data", $message);
    }
    ?>
    PHP:
    This script uploads a file to the folder "uploaded" and renames the file to "current_timestamp.zip". This section needs quite a lot of work to meet your needs (I guess).

    Then the script will send all the submitted text data to your email address.

    I hope I helped you with this. ;)
     
    Aaron Sustar, May 27, 2009 IP
  3. My220x

    My220x Member

    Messages:
    624
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    35
    #3
    Aaron's script should get you started but you need to do some error checking to make sure all data is filled out and the file is actually an image.

    
    <?php
    if ($post['submit'] && trim($_POST["data1"]) && trim($_POST["data2"]) && trim($_POST["data3"]) && $_FILES["file"]["tmp_name"]) {
       $time = time();
       $message = "Data 1: {$_POST['data1']}<br />Data 2: {$_POST['data2']}<br />Data 3: {$_POST['data3']}<br />Uploaded file was moved to the folder 'uploaded' and named {$time}.zip.";
       move_uploaded_file($_FILES['file']['tmp_name'], "uploaded/{$time}.zip");
       mail("your@email.com", "Submitted data", $message);
    } else {
    echo "Please fill out the form.";
    exit;
    }
    ?>
    
    Code (markup):
    That code will check to see if the form was filled out.
     
    My220x, May 27, 2009 IP