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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:07:58+00:00 2026-06-16T15:07:58+00:00

I received the following error message when I tried to submit the content to

  • 0

I received the following error message when I tried to submit the content to my form. How may I fix it?

Notice: Undefined index: filename in D:\wamp\www\update.php on line 4

Example Update.php code:

<?php

    $index = 1;
    $filename = $_POST['filename'];

    echo $filename;
?>

And $_POST[‘filename’] comes from another page:

<?php
    $db = substr($string[0],14) . "_" . substr($string[1],14) . "_db.txt";
?>

<input type="hidden" name="filename" value="<?php echo $db; ?>">
  • 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-16T15:07:59+00:00Added an answer on June 16, 2026 at 3:07 pm

    Assuming you only copy/pasted the relevant code and your form includes <form method="POST">


    if(isset($_POST['filename'])){
        $filename = $_POST['filename'];
    }
    if(isset($filename)){ 
        echo $filename;
    }
    

    If _POST is not set the filename variable won’t be either in the above example.

    An alternative way:

    $filename = false;
    if(isset($_POST['filename'])){
        $filename = $_POST['filename'];
     } 
        echo $filename; //guarenteed to be set so isset not needed
    

    In this example filename is set regardless of the situation with _POST. This should demonstrate the use of isset nicely.

    More information here:
    http://php.net/manual/en/function.isset.php

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

Sidebar

Related Questions

I received the following error when I tried to run a C# WinForms application
I am trying to initialize NSDictionary but it gives me following error: Program received
I received this error on following code.Is this + sign is not available in
I receive the following error message when I try to use the sphinx-quickstart generated
I tried the following command: git commit path/to/my/file.ext -m 'my notes' And received an
I received an error when an referenced .NET Framework 2.0 assembly tried to execute
I receive the following error in Microsoft SQL Server Report Builder Error While generating
I receive the following error when trying to run my ASP.NET MVC application: The
i receive the following error when trying to implement auto-complete based on edismax type.
I receive the following error when running a new compass project in OSX 10.7.3.

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.