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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:31:16+00:00 2026-05-25T11:31:16+00:00

I have a problem, I am getting the Undefined Variable and I’m not sure

  • 0

I have a problem, I am getting the Undefined Variable and I’m not sure what’s wrong. I have only been working with PHP for the last 3 months, so that might be the main problem hehe.

This is the class:

<?php

class BannedIPs
{
public $id;
public $ip;
public $date;
public $time;
public $reason;

public $Conn;
public $Error;

public function __construct(&$Conn)
{
    $this->id = "";
    $this->ip = "";
$this->date = "";
    $this->time = "";
    $this->reason = "";

    $this->Conn = $Conn;
    $this->Error = false;
}

public function GetByID($strCode)
{
    $strSQL =  "SELECT ";
$strSQL .= "bingoliv_bannedips.* ";
$strSQL .= "FROM bingoliv_bannedips ";
$strSQL .= "WHERE (id = '" . mysqli_real_escape_string($this->Conn, $strCode) . "') ";
$this->GetRecord($strSQL);
}

private function GetRecord($strSQL)
{
    $objRS = mysqli_query($this->Conn, $strSQL);
if (mysqli_num_rows($objRS) == 1)
{
        $arrRS = mysqli_fetch_assoc($objRS);
        $this->id = $arrRs["ID"]; //error here
        $this->ip = $arrRS["IP"];
        $this->date = $arrRS["Date"];
        $this->time = $arrRS["Time"];
        $this->reason = $arrRs["Reason"]; //and here

        $this->Error = false;
    }
else
{
        $this->Error = true;
}
    mysqli_free_result($objRS);
}

public function Insert() //inserts a new banned ip to the database
{
    $strSQL  = "INSERT INTO bingoliv_bannedips (ID, IP, Date, Time, Reason) ";
$strSQL .= "VALUES ( ";
    $strSQL .= "'" . mysqli_real_escape_string($this->Conn, $this->id) . "', ";
$strSQL .= "'" . mysqli_real_escape_string($this->Conn, $this->ip) . "', ";
$strSQL .= "'" . mysqli_real_escape_string($this->Conn, $this->date) . "', ";
    $strSQL .= "'" . mysqli_real_escape_string($this->Conn, $this->time) . "', ";
    $strSQL .= "'" . mysqli_real_escape_string($this->Conn, $this->reason) . "' ";
$strSQL .= ") ";
$resResult = mysqli_query($this->Conn, $strSQL);
}

public function Delete() //deletes using id as an identifier
{
    $strSQL = "DELETE FROM bingoliv_bannedips WHERE id ='" . mysqli_real_escape_string($this->Conn, $this->id) . "' ";
$resResult = mysqli_query($this->Conn, $strSQL);

    $this->id = "";
    $this->ip = "";
$this->date = "";
    $this->time = "";
    $this->reason = "";

$this->Error = false;
}

}

?>

This is the Admin Page:

<?php
require_once "includes/ssi.page.top.php";
require_once "includes/ssi.admincols.start.php";

kickIfInsufficientRights($resConn, $objCurrentPage->RightName, $objCurrentUser->ProfileID, 'admin.php');

handleResultMessage($strResultType, $strResult); #What is this for??

 ?>

<h3><a href="admin.php">Administration</a> &raquo; Banned IPs</h3>
<div class="admin">
<table>

<?php
$strSQL  = "SELECT id FROM bingoliv_bannedips ORDER BY ip ASC ";
$objRS = new ZpPagingRecordset($resConn, $objCurrentUser->PageSize);
$objRS->GetData($strSQL, $intCurPage);
?>
<tr>
<th class="right" colspan="5"><?php echo $objRS->Controls('admin.bannedips.php', '')?></th>
</tr>
<tr class="strong">
<th>ID</th>
<th>IP</th>
<th>Date</th>
<th>Time</th>   
<th>Reason</th>
<th></th>
</tr>
<?php

if (!$objRS->Error)
        {
        $objBannedIPs = new BannedIPs($resConn);
        foreach ($objRS->Data as $arrRS)
        {
                $objBannedIPs->GetByID($arrRS["id"]);
                ?>

                <!-- bam -->
                <tr class="hoverable">

                    <td><?php echo $objBannedIPs->id?></td>
                    <td><?php echo $objBannedIPs->ip?></td>
                    <td><?php echo $objBannedIPs->date?></td>
                    <td><?php echo $objBannedIPs->time?></td>
                    <td><?php echo $objBannedIPs->reason?></td>

                    <td class="right">
                        <?php if ($objCurrentUser->AllowedTo('ADMIN_COUNTRIES_UPDATE'))                   { ?>
                            <a onclick="return zpSure('Deleting a banned ip is permanent!\n\nAre you sure you want to delete this banned ip?')" href="actions/admin.bannedips.delete.php?intCurPage=<?php echo $intCurPage?>&amp;cnt_id=<?php echo $objBannedIPs->id?>" title="delete">
                            <img src="zplib/icons/delete.png" alt="Delete" /></a>
                        <?php } ?>
                    </td>

                </tr>

                <?php
        }
        unset($objBannedIPs);
        ?>
        <?php
        }  
#when no data if found
else
{
        ?>
        <tr>
        <td class="celGridCenterBold" colspan="5"><br />No data found<br />&nbsp;</td>
        </tr>
        <?php
}              
unset($objRS);
?>

</table>
</div><!--/admin-->


<?php

    require_once "includes/ssi.admincols.mid.php";
    require_once "includes/ssi.panel.sidemenu.php";
    require_once "includes/ssi.admincols.end.php";
    require_once "includes/ssi.page.bottom.php";
?>

This is the table:

enter image description here

And finally, this is the error:

enter image description here

  • 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-25T11:31:17+00:00Added an answer on May 25, 2026 at 11:31 am

    $arrRS is not the same as $arrRs.

    From http://www.php.net/manual/en/language.variables.basics.php:

    Variables in PHP are represented by a dollar sign followed by the name of the variable. The variable name is case-sensitive.

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

Sidebar

Related Questions

I have a problem where a method is getting an undefined variable error, even
I have an application that has been working with session variables no problem. I
I have a problem getting the right Price for a product based on Effectivity
I have a problem getting boost::multi_index_container work with random-access and with orderd_unique at the
I have a problem regarding getting the path of a user control. The scenario
I have a problem with getting my pager-function to work. For some reason it
I have a problem with getting jquery to retrieve results from a WCF service.
I seem to have a problem with getting MVC to fill in my custom
I have a problem while scrolling images on tableview. I am getting a Signal
I currently have a problem with my jgroups configuration, causing thousands of messages getting

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.