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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:38:51+00:00 2026-06-07T02:38:51+00:00

I have a user registration script. At one stage I call a method three

  • 0

I have a user registration script. At one stage I call a method three times. Once to check if the method returns true, else if it doesn’t, does it return a string (containing an error message) and if it does get the returned string and place it in a variable.

Is the a more productive way of doing this so that I only need to call the method once? But still get all answers I need?

Heres the code:

//check thumbnail is present and good
            if($register->checkThumb()){
                //send image to permanent image directory
                $register->moveUploadedImage();

                //if the thumbnail failed validation put the error message in variable
            }else if(is_string($register->checkThumb())){
                $message = $register->checkThumb();

            }
  • 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-07T02:38:54+00:00Added an answer on June 7, 2026 at 2:38 am
        $thumb = $register->checkThumb(); //call method once and save in variable
       /* using just if($thumb) would return always true, because 
          the function may returns an errormessage on failure 
          which is ja string, which is not empty, not 0, not false == true */
        if($thumb === true){
          //send image to permanent image directory
          $register->moveUploadedImage();
        }else{ //so then it's enough to ask for error this way
          $message = $thumb;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user registration Form. If a new User register their account in
Let's say I have an user registration form. In this form, I have the
I have to do a user registration form (classical layout with two columns, labels
I have developed a web site that requires user registration and authentication for some
I have such view that handles user registration. After creating new user i want
I want to make a user-registration form where I will have fields such first
I have a joomla website and I use community builder for user registration and
I have a registration form where this CSS rules apply. when user submits with
I have a Unity3D application who needs registration. The user needs to register in
I'm building a registration script and I want to insert the user's input (username,

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.