Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Web Design (WordPress, Joomla, etc.) PHP picture submission

  • PHP picture submission

    Posted by Robbo Ando on April 22, 2009 at 11:15 pm

    Hi,
    I’m very new to PHP – unbelievably new.
    I’m using dreamweaver and a customizable website script for a picture submission form, and also an information submission form.

    https://www.thatsfishing.com.au/ this is the website being worked on

    this is the code for the form on a page which is not reachable yet (


    //<form ><form form1"action="Scripts/upload.php" method="post" enctype="multipart/form-data">
    //<p>
    //<label for="file">Select a file:</label> <input type="file" name="userfile" id="file"> <br />
    //<button>Upload File</button>
    //<p>
    //</form>

    and my PHP document code:


    // $max_filesize)
    die('The file you attempted to upload is too large. The maximum file size allowed is 500kbs');

    // Check if we can upload to the specified path, if not DIE and inform the user.
    if(!is_writable($upload_path))
    die('You cannot upload to the specified directory, please CHMOD it to 777.');

    // Upload the file to your specified path.
    if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $filename))
    echo 'Your file upload was successful, view the file here'; // It worked.
    else
    echo 'There was an error during the file upload. Please try again.'; // It failed :(.

    ?>
    (the opening php tag < ? php is disappearing here) with information included in the code ->
    what do I have wrong? i have it all linked up properley in dreamweaver (the form to the PHP coding) so why wont the picture submit

    Fernando Mol replied 17 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Robbo Ando

    April 27, 2009 at 12:04 am

    Still having trouble – >

    using a different code but I keep getting Access Denied when I upload so I can’t even test the form

    <?php

    /*Subject and email variables */

    $emailSubject = 'Thats Fishing Contact Form';
    $webMaster = 'fish@thatsfishing.com.au';

    /*Gathering data variables*/

    $emailField = $_POST['email'];
    $nameField = $_POST['name'];
    $commentField = $_POST['comment'];

    $body = <<<EOD
    <br><hr><br>
    Email: $email <br>
    Name: $name <br>
    Comment: $comment <br>
    EOD;

    $headers = "From: $email\r\n";
    $headers .= "Content-type: text/html\r\n";
    $success = mail($webMaster, $emailSubject, $body, $headers);

    /*Results as HTML*/
    $theResults = <<<EOD
    <html xmlns="https://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    Good
    </body>
    </html>
    EOD;
    echo "$theResults";

    ?>

  • Fernando Mol

    April 28, 2009 at 9:44 pm

    Are you getting access denied from inside dreamweaver (FTP problem) or when you actually try to test the page in your server?

    Can you write the exact error message?

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy