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 7174179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:58:46+00:00 2026-05-28T15:58:46+00:00

What is the problem? When I add a file using my form the $_POST

  • 0

What is the problem?

When I add a file using my form the $_POST variables are undefined. When I don’t add a file the $_POST variables are defined.

What errors do you receive?

Notice: Undefined index: bbmpin in C:\...\addpin.php on line 6
Notice: Undefined index: usermsg in C:\...\addpin.php on line 7

Source Code

index.html

<form method="POST" action="addpin.php"  enctype="multipart/form-data">
        <div>
            <label for="bbmpin">Your BBM Pin</label>
            <input type="text" name="bbmpin" placeholder="Enter Your BBM Pin">
        </div>

        <div>
            <label for="usermsg">Message</label>
            <input type="text" name="usermsg" placeholder="(optional) Add a short message" maxlength="255">
        </div>

        <div>
            <label for="image">Upload Image <small>(optional)</small></label>
            <input type="file" name="image"> 
        </div>

        <button type="submit">Submit</button>
</form>

addpin.php

<?php
session_start();

require_once('config/config.php');

$pin = $_POST['bbmpin'];
$msg = $_POST['usermsg'];
$ip  = $_SERVER['REMOTE_ADDR'];

print_r($_POST);
print_r($_FILES);
    exit;

    ...
?>
  • 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-05-28T15:58:48+00:00Added an answer on May 28, 2026 at 3:58 pm

    If the post size exceeds the allowed maximum, the $_POST superglobal array will be empty.

    So you have to check if file upload suceeds be checking the $_FILES array or checking the $_POST array.

    http://www.php.net/manual/en/features.file-upload.errors.php

    If you need to increase the post size limit, you should check this php.ini directive

    http://www.php.net/manual/en/ini.core.php#ini.post-max-size

    And maybe you will need to change it in your web server configuration (I don’t know which one do you use)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've encountered this problem (while trying to add SQL Server Database (.mdf) file to
The problem Dynamically add and remove fields to entities on the fly using Hibernate.
The problem is simple: Using bash, I want to add a directory to my
I want to upload files using PHP but the problem is that I don't
Problem solved...variable undefined. I will add full answer when stackoverflow allows me to answer
I have a problem: I've add a Jquery UI drag-n-drop widget to my page,
There are a set of point that are collinear. The problem is to add
I'm experiencing this problem: I want to add the Google Maps API to my
I often face the problem of wanting to add additional methods to classes I
I have a problem where I have to add thirty-three integer vectors of equal

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.