Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8757891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:24:38+00:00 2026-06-13T14:24:38+00:00

I have contact form structure. With the following: HTML: <form name=feedback_form method=post action= class=feedback_form>

  • 0

I have contact form structure. With the following:

HTML:

   <form name="feedback_form" method="post" action="" class="feedback_form">
                                                <input type="text" name="field-name" value="İsim" title="İsim" class="field-name form_field">
                                                <input type="text" name="field-email" value="Email" title="Email" class="field-email form_field">
                                                <input type="text" name="field-subject" value="Başlık" title="Subject" class="field-subject form_field">
                                                <textarea name="field-message" cols="45" rows="5" title="Mesajınız..." class="field-message form_field">Mesajınız...</textarea>
                                                <input type="reset" name="reset" id="reset2" value="Temizle" class="feedback_reset">
                                                <input type="button" name="submit" class="feedback_go" id="submit2" value="Gönder">                                    

</form>  

And i added this codes for file upload:

<label for='uploaded_file'>Upload your picture:</label>
 <input type="file" name="uploaded_file">

I want, users can upload jpg, png, gif, bmp images via this label. But i don’t know how can i reorganize my mail.php file?

mail.php:

<?php
header('Content-Type: text/html; charset=utf-8');

function sendFeedback($feedback_email, $feedback_msg, $feedback_name, $feedback_subject, $feedback_file) {


    /* EDIT THIS */
    $admin_email = "mymail@gmail.com";
    if ($feedback_subject == "Subject" || empty($feedback_subject) ) {
        $subj = "Email from your site";
    } else {
        $subj = $feedback_subject;
    }


    /* //EDIT THIS */


    $message = "
    <html>
    <head>
      <title>Websitenizin emaili</title>
    </head>
    <body>
        <p><a href='mailto:".$feedback_email."'>".$feedback_name."</a> send this message:</p>
        <p>".$feedback_msg."</p>
        <p>".$subject."</p>
    </body>
    </html>
    ";
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";

    if ($feedback_name!=="Name" && $feedback_email!=="Email" && !empty($feedback_email) && !empty($feedback_msg) && !empty($feedback_name) ) {
        if ($feedback_email == "mail_error") {
            echo "<span class='ajaxok'>Geçersiz email adresi.</span>";
        } else {            
            mail($admin_email, $subj, $message, $headers);
            echo "<span class='ajaxok'>Teşekkürler. Mesajınız gönderilmiştir.</span>";  
        }
    } else {
        echo "<span class='ajaxalert'>Lütfen zorunlu alanları doldurunuz.</span>";      
    }


}

sendFeedback($_POST['email'], $_POST['message'], $_POST['name'], $_POST['subject'], $_POST['file']);
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:24:40+00:00Added an answer on June 13, 2026 at 2:24 pm

    First change the action to the directory where you have your mail.php file, as the code below. Then in the mail.php your gonna use something similiar to the PHP code below.

     <form name="feedback_form" method="post" action="mail.php" class="feedback_form">
    

    There is something called

    $_FILES['file']['type'];
    

    You can use that like in the following code.

    If you want more information or something, just reply or read more on this site

    W3Schools file upload

    <?php
    $allowedExts = array("jpg", "jpeg", "gif", "png");
    $extension = end(explode(".", $_FILES["file"]["name"]));
    if ((($_FILES["file"]["type"] == "image/gif")
    || ($_FILES["file"]["type"] == "image/jpeg")
    || ($_FILES["file"]["type"] == "image/png")
    || ($_FILES["file"]["type"] == "image/pjpeg"))
    && ($_FILES["file"]["size"] < 20000)
    && in_array($extension, $allowedExts))
      {
      if ($_FILES["file"]["error"] > 0)
        {
        echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
        }
      else
        {
        echo "Upload: " . $_FILES["file"]["name"] . "<br />";
        echo "Type: " . $_FILES["file"]["type"] . "<br />";
        echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
        echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
    
        if (file_exists("upload/" . $_FILES["file"]["name"]))
          {
          echo $_FILES["file"]["name"] . " already exists. ";
          }
        else
          {
          move_uploaded_file($_FILES["file"]["tmp_name"],
          "upload/" . $_FILES["file"]["name"]);
          echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
          }
        }
      }
    else
      {
      echo "Invalid file";
      }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a contact form which asks users for their name, email address and
I have a contact form on a website (a general form: name , email
I have a contact form with some fields like Name, Email, Subscribe. The Subscribe
I have a very basic email app. The forms class is: class ContactForm(forms.Form): name
I have contact form which is sending email. But if I type a long
I have a contact form. I want to add class to parent div of
I have a contact form on my website so users can send me an
I have a contact form made with php on my website. The problem is
I have a contact form in a div on it's own with opacity 0,
I have a contact form which is suppose to go to a thank you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.