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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:17:24+00:00 2026-06-11T08:17:24+00:00

I’m trying to add the login_form from Tank_auth view into my HTML template. When

  • 0

I’m trying to add the login_form from Tank_auth view into my HTML template.

When I do so, it returns a few errors regarding missing variables, and I’m not sure what I’m doing wrong.

My controller:

public function index()
{
    $topbar['account'] = $this->load->view('auth/login_form');
    $data['topbar'] = $topbar;
    $this->load->view('main_template', $data);
}

Main template looks like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
    <head><?php echo $template['head'] ?></head>
<body>
    <div id="topbar"><?php echo $topbar['account'] ?></div>
</body>
</html>

The error I’m receiving when loading the page is the following:

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: show_captcha

Filename: auth/login_form.php

Line Number: 47

In addition, I’m receiving identical errors for:

Undefined variable: login_by_username

Heres the login form (untouched…default tank_auth form)

<?php
$login = array(
    'name'  => 'login',
    'id'    => 'login',
    'value' => set_value('login'),
    'maxlength' => 80,
    'size'  => 30,
);
if ($login_by_username AND $login_by_email) {
    $login_label = 'Email or login';
} else if ($login_by_username) {
    $login_label = 'Login';
} else {
    $login_label = 'Email';
}
$password = array(
    'name'  => 'password',
    'id'    => 'password',
    'size'  => 30,
);
$remember = array(
    'name'  => 'remember',
    'id'    => 'remember',
    'value' => 1,
    'checked'   => set_value('remember'),
    'style' => 'margin:0;padding:0',
);
$captcha = array(
    'name'  => 'captcha',
    'id'    => 'captcha',
    'maxlength' => 8,
);
?>
<?php echo form_open($this->uri->uri_string()); ?>
<table>
    <tr>
        <td><?php echo form_label($login_label, $login['id']); ?></td>
        <td><?php echo form_input($login); ?></td>
        <td style="color: red;"><?php echo form_error($login['name']); ?><?php echo isset($errors[$login['name']])?$errors[$login['name']]:''; ?></td>
    </tr>
    <tr>
        <td><?php echo form_label('Password', $password['id']); ?></td>
        <td><?php echo form_password($password); ?></td>
        <td style="color: red;"><?php echo form_error($password['name']); ?><?php echo isset($errors[$password['name']])?$errors[$password['name']]:''; ?></td>
    </tr>

    <?php if ($show_captcha) {
        if ($use_recaptcha) { ?>
    <tr>
        <td colspan="2">
            <div id="recaptcha_image"></div>
        </td>
        <td>
            <a href="javascript:Recaptcha.reload()">Get another CAPTCHA</a>
            <div class="recaptcha_only_if_image"><a href="javascript:Recaptcha.switch_type('audio')">Get an audio CAPTCHA</a></div>
            <div class="recaptcha_only_if_audio"><a href="javascript:Recaptcha.switch_type('image')">Get an image CAPTCHA</a></div>
        </td>
    </tr>
    <tr>
        <td>
            <div class="recaptcha_only_if_image">Enter the words above</div>
            <div class="recaptcha_only_if_audio">Enter the numbers you hear</div>
        </td>
        <td><input type="text" id="recaptcha_response_field" name="recaptcha_response_field" /></td>
        <td style="color: red;"><?php echo form_error('recaptcha_response_field'); ?></td>
        <?php echo $recaptcha_html; ?>
    </tr>
    <?php } else { ?>
    <tr>
        <td colspan="3">
            <p>Enter the code exactly as it appears:</p>
            <?php echo $captcha_html; ?>
        </td>
    </tr>
    <tr>
        <td><?php echo form_label('Confirmation Code', $captcha['id']); ?></td>
        <td><?php echo form_input($captcha); ?></td>
        <td style="color: red;"><?php echo form_error($captcha['name']); ?></td>
    </tr>
    <?php }
    } ?>

    <tr>
        <td colspan="3">
            <?php echo form_checkbox($remember); ?>
            <?php echo form_label('Remember me', $remember['id']); ?>
            <?php echo anchor('/auth/forgot_password/', 'Forgot password'); ?>
            <?php if ($this->config->item('allow_registration', 'tank_auth')) echo anchor('/auth/register/', 'Register'); ?>
        </td>
    </tr>
</table>
<?php echo form_submit('submit', 'Let me in'); ?>
<?php echo form_close(); ?>

Hopefully someone is familiar with Tank Auth and can solve this problem easily.

Thank you.

  • 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-11T08:17:25+00:00Added an answer on June 11, 2026 at 8:17 am

    first please check auth controller how they using login and passing show_captcha to you login_form view, you are not passing show_captcha to login_view

        $login_data['login_by_username'] = ($this->config->item('login_by_username','tank_auth') AND $this->config->item('use_username','tank_auth'));
        $login_data['login_by_email'] = $this->config->item('login_by_email', 'tank_auth');
    
        $login_data['show_captcha']  = FALSE
    
        $topbar['account'] = $this->load->view('auth/login_form',$login_data);
        $data['topbar'] = $topbar;
        $this->load->view('main_template', $data);
    

    it will not show captcha, but i suggest you to follow login method of thank auth’s auth controller

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am currently running into a problem where an element is coming back from
I have a view passing on information from a database: def serve_article(request, id): served_article
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,

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.