Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Dec 2015
    Posts
    3
    Member #
    52722

    How to submit a picture on a website.

    I have a website in which I require a visitor to post a picture. Can anyone help to write HTML for submitting and capturing a picture.

  2.  

  3. #2
    Junior Member
    Join Date
    Dec 2015
    Posts
    11
    Member #
    52700
    Liked
    1 times

    hello

    I don't think you can upload image just with html. You will need php. You could try this.
    PHP Code:
    <?php
    if(isset($_POST['upload'])){
    $img=rand(10,1000)."-".$_FILES['img']['name'];
    $tmp=$_FILES['img']['tmp_name'];
    $path='uploads/';
    if(
    move_uploaded_files($tmp,$path.$img)){
    ?>
    <script>alert('Image Uploaded');</script>
    <?php }else{?>
    <script>alert('Upload Failed. Please Try Again');</script>
    <?php }} ?>
    HTML Code:
    <form action="" method="post" enctype="multipart/form-data">
    <input type="file" name="img" />
    <button type="submit" name="upload">Upload</button>
    </form>


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:54 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com