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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:20:10+00:00 2026-05-18T21:20:10+00:00

Is this just impossible? I thought I would clean up some of my code

  • 0

Is this just impossible?

I thought I would clean up some of my code and put db queries in models only where they belong and put all the other code that belongs in controllers in controllers.

Now I keep getting undefined variable errors. Which is not a problem but I’m trying to work out how to call variables between files.

I would simply like the random hash generated at registration .. stored in a variable because that’s the variable I use in the anchor for the “click here to activate account” link that is sent to users email.

I also use that same variable in the method that compares the uri hash that’s at the end of the URL in their email with the one stored in the database.. in order for user to confirm their account and update “status” in database to 1(activated).

I would really appreciate some advice. I’m enjoying this learning process. Loosing sleep but enjoying it as it make me think logically.

  • 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-18T21:20:10+00:00Added an answer on May 18, 2026 at 9:20 pm

    You cannot access a variable if it’s in a seperate file, instead you should set it in your class.

    class User_model extends Model {
    
        // Declare the foo variable
        public $foo = "";
    
        function blah() {
    
            // You can set variable foo this way from any controller/model that includes this model
            $this->foo = "dog";
    
            // You can access variable foo this way
            echo $this->foo;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is probably just a crazy pipe dream but I thought I would ask
Just listening to this week's podcast and thought it would be nice to group
Maybe this is just impossible and I should give up all hope. Or maybe
This is probably impossible but i thought i would ask around and see if
This error just started popping up all over our site. Permission denied to call
I just uncovered this confusion and would like a confirmation that it is what
Just looking for some opinions/ideas on how best to do this. I'm building an
I thought I would find a solution to this problem relatively easily, but here
I'd just like to make sure that this is impossible. I'm coding around it,
I thought that this was impossible but I'm seeing it with my software. I

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.