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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:02:33+00:00 2026-05-26T10:02:33+00:00

Edit:I added this if (isset($_POST[‘delete’]) && isset($_POST[‘checkbox’])) (get from an answer below but it

  • 0

Edit:I added this

if (isset($_POST[‘delete’]) && isset($_POST[‘checkbox’]))
(get from an answer below but it seems the asnwer is gone)

and now the undefined varialbe and index error are gone…but the problem now is when I try to delete , it require check and click delete button twice to delete the selected rows…

  <form name="frmSearch" method="post" action="insert-add.php">

<table width="600" border="1">
  <tr>
    <th width="50"> <div align="center">#</div></th>
    <th width="91"> <div align="center">ID </div></th>
    <th width="198"> <div align="center">First Name </div></th>
    <th width="198"> <div align="center">Last Name </div></th>
    <th width="250"> <div align="center">Mobile Company </div></th>
    <th width="100"> <div align="center">Cell </div></th>
    <th width="100"> <div align="center">Workphone </div></th>
    <th width="100"> <div align="center">Group </div></th>
  </tr>
    </form>
<?

    echo "<form name='form1' method='post' action=''>";

while($objResult = mysql_fetch_array($objQuery))
{


    echo "<tr>";
    echo "<td align='center'><input name=\"checkbox[]\" type=\"checkbox\" id=\"checkbox[]\" value=\"$objResult[addedrec_ID]\"></td>";
    echo "<td>$objResult[addedrec_ID] </td>";
    echo "<td>$objResult[FirstName]</td>";
    echo "<td>$objResult[LastName] </td>";
    echo "<td>$objResult[MobileCompany] </td>";
    echo "<td>$objResult[Cell] </td>";
    echo "<td>$objResult[WorkPhone] </td>";
    echo "<td>$objResult[Custgroup] </td>";

   echo "</tr>";

}


 echo "<td colspan='7' align='center'><input name=\"delete\" type=\"submit\" id=\"delete\" value=\"Delete\">";

 if (isset($_POST['delete']) && isset($_POST['checkbox'])) // from button name="delete"
 {
 $checkbox = ($_POST['checkbox']); //from name="checkbox[]"
     $countCheck = count($_POST['checkbox']);

 for($d=0;$d<$countCheck;$d++)
     {
         $del_id  = $checkbox[$d];

 $sql = "DELETE from UserAddedRecord where addedrec_ID = $del_id";

 $result2=mysql_query($sql)  or trigger_error(mysql_error());;;

     }
         if($result2)
     {  
          $fgmembersite->GetSelfScript();
         }
         else
         {
 echo "Error: ".mysql_error();
         }
 }
  echo "</form>";

Thanks for every reply.

  • 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-26T10:02:33+00:00Added an answer on May 26, 2026 at 10:02 am

    The first notice is due to no $_POST[“checkbox”] variable. If you’re using AJAX, inspect your query with firebug to check if you’re sending a checkbox variable.

    The second undefined is coming from your nesting. See my below example:

    $foo = 0
    if($foo ==1){
        $bar = 5;
    }
    if($bar == 2){
        //Blah
    }
    

    If you were to run that then $bar would never be set, hence the notice. As $countCheck is set to 0 as $_POST[“checkbox”] is not set, then the for loop never runs hence $result2 is never set.

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

Sidebar

Related Questions

EDIT: Solved with a hack for now. Added at line 473: if (isset($this->_termsFreqs[$termId][$docId])) {
EDIT: Modified title and added update. UPDATE : We no longer believe this is
Edit: You can get the full source here: http://pastebin.com/m26693 Edit again: I added some
EDIT : Accepted answer points out what my issue was. I added another answer
Edit: From another question I provided an answer that has links to a lot
EDIT: I have added Slug column to address performance issues on specific record selection.
I have a piece of code: EDIT: The _penParams are initialized as the added
in C# I'd like to invoke the label edit of a newly added item
Edit: This question was written in 2008, which was like 3 internet ages ago.
EDIT: This was formerly more explicitly titled: - Best solution to stop Kontiki's KHOST.EXE

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.