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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T02:33:58+00:00 2026-06-19T02:33:58+00:00

I am receiving these errors below: Notice: Undefined offset: 1 in … on line

  • 0

I am receiving these errors below:

Notice: Undefined offset: 1 in ... on line 93 
Notice: Undefined offset: 2 in ... on line 94 

What does these errors mean and how can it be fixed? I can’t see where the problem is but I know they are appearing after clicking on the “Module Submit” button

$moduleactive = 1;

    $sql = "SELECT ModuleId, ModuleNo, ModuleName FROM Module WHERE ModuleActive = ? ORDER BY ModuleNo"; 


     $sqlstmt=$mysqli->prepare($sql);

     $sqlstmt->bind_param("i", $moduleactive);

     $sqlstmt->execute(); 

     $sqlstmt->bind_result($dbModuleId,$dbModuleNo,$dbModuleName);


    $moduleHTML  = "";  
      $moduleHTML .= '<select name="modules" id="modulesDrop">'.PHP_EOL;
 $moduleHTML .= '<option value="">Please Select</option>'.PHP_EOL;  

     while($sqlstmt->fetch()) { 
         $moduleHTML .= sprintf('<option value="%1$s_%2$s_%3$s">%1$s - %2$s</option>'.PHP_EOL, $dbModuleNo, $dbModuleName, $dbModuleId);
    } 

$moduleHTML .= '</select>'; 

    $pHTML = "";


    ?>


<form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post" onsubmit="return validation(event);">
<table>
<tr>
<th>Module: <?php echo $moduleHTML; ?></th>
</tr>
</table>
<p><input id="moduleSubmit" type="submit" value="Submit Module" name="moduleSubmit" /></p>
<div id="moduleAlert"></div>
<div id="targetdiv"></div>
</form>

<?php

if (isset($_POST['moduleSubmit'])) {    

$outputmodule = ""; 

$moduleInfo = explode("_", $_POST['modules']);
$moduleNo = $moduleInfo[0];
$moduleName = $moduleInfo[1]; //Error line 93
$moduleId = $moduleInfo[2]; //Error line 94
$outputmodule = sprintf("<p><strong>Selected Module:</strong> %s - %s <input type='hidden' value='%s'></p>", $moduleNo, $moduleName, $moduleId);

}

?>
  • 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-19T02:34:00+00:00Added an answer on June 19, 2026 at 2:34 am

    This error occure because there is no value at that index in $moduleInfo varibale.
    As not coming in $_POST[‘modules’] varible

    Replace this to avoid error

    $moduleName =$moduleInfo[1]; //Error line 93
    $moduleId =$moduleInfo[2]; //Error line 94
    

    with

    $moduleName = isset($moduleInfo[1])?$moduleInfo[1]:''; 
    $moduleId = isset($moduleInfo[2])?$moduleInfo[2]:'';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: PHP: Notice: Undefined variable and Notice: Undefined index Reference - What does
I am receiving 2 errors in my code below: Warning: mysqli::prepare() [mysqli.prepare]: (21S01/1136): Column
Can someone explain to me the errors I am receiving while trying to validate
Is there a C function which can do the equivalent of find_first_not_of, receiving a
I receiving a undefined reference error when try to compile an c++ program. I'm
I am receiving the following error when running my below ruby script: s3parse.rb:12:in `block
I have problems with receiving json through ajax, the error is below. According to
I'm receiving the following error on this line of code select.up().appendChild(sw); With error SCRIPT438:
I have a weird problem , below are two simple get calls and returning
having a problem getting my simple php email contact form working. No errors are

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.