Results 1 to 2 of 2

Thread: Looking for help!

  1. #1
    Join Date
    Oct 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Looking for help!

    Hello!

    My website is in the process of being updated. It is a craft mall for crafters to sell their crafts through my site.

    What I am doing for the update is to have a way for crafters to login into their account and update their listings without having me do it for them. I also am looking for a way that they can upload their images as well. You know when you go to upload an image or a document and you hit the browse button - to take it off of your computer to put onto the website you are part of - that is what I am looking for as well.

    If anyone has any idea of how to write that or even where I can find the script, I would greatly appreciate it!

    Thanks so much!

  2. #2
    Join Date
    Oct 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The HTML Code for upload/browse

    HTML Code:
    <h1>UPLOADING FILES</h1>
    <form name="fupload" enctype="multipart/form-data" action="upfiles.php" method="post">
    <input type="file" name="picture" />
    <input type="submit" value="Submit" />
    </form>
    </body>
    PHP code is...
    Your "upfiles.php":
    PHP Code:
    <header>
    <?php
    function UploadOne($fname)
    {
    $uploaddir 'uploadedfiles/';
    if (
    is_uploaded_file($fname['tmp_name']))
    {
    $filname basename($fname['name']);
    $uploadfile $uploaddir basename($fname['name']);
    if (
    move_uploaded_file ($fname['tmp_name'], $uploadfile))
    $res "File " $filname " was successfully uploaded and stored.<br>";
    else
    $res "Could not move ".$fname['tmp_name']." to ".$uploadfile."<br>";
    }
    else
    $res "File ".$fname['name']." failed to upload.";
    return (
    $res);
    }
    ?>
    </header>
    <body>
    <?php
    if ($_FILES['picture']['name'] != "")
    {
    $res UploadOne($_FILES['picture']);
    $filname $_FILES['picture']['name'];
    echo (
    $res);
    }
    ?>
    Last edited by jscheuer1; 11-27-2014 at 05:25 AM. Reason: format code

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •