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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:08:32+00:00 2026-05-13T12:08:32+00:00

Below is a snippet of PHP that I need to get working, I need

  • 0

Below is a snippet of PHP that I need to get working, I need to make sure that 3 items are not set already and not === ”

I have the part to make it check if not set but when I try to see if the values are empty as well (I might not even be thinking clearly right now, I might not need to do all this) But I need to make sure that redirect, login_name, and password are all not already set to a value, if they are set to a value I need to make sure that the value is not empty.

Can someone help, when I add in check to see if values are empty, I get errors with my syntax, also not sure if I should have 5-6 checks like this in 1 if/else block like that, please help

I need to check the following:
– $_GET[‘redirect’] is not set
– $_REQUEST[‘login_name’] is not set
– $_REQUEST[‘login_name’] is not != to ”
– $_REQUEST[‘password’] is not set
– $_REQUEST[‘password’] is not != to ”

if (!isset($_GET['redirect']) && (!isset($_REQUEST['login_name'])) && (!isset($_REQUEST['password']))){
    //do stuff
}



UPDATE

Sorry It is not very clear, I was a bit confused about this. Based on Hobodaves answer, I was able to modify it and get it working how I need it. Below is the code how I need it, it works great like this… So if that can be improved then that is the functionality that I need, I just tested this.

if (!isset($_GET['redirect']) 
    && empty($_GET['redirect'])
    && isset($_REQUEST['login_name'])
    && !empty($_REQUEST['login_name'])
    && isset($_REQUEST['password'])
    && !empty($_REQUEST['password'])
) {
    echo 'load user';
}

if this was loaded then it will run the login process

login.php?login_name=test&password=testing

If this is loaded then it will NOT run the login process

login.php?login_name=test&password=  
  • 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-13T12:08:33+00:00Added an answer on May 13, 2026 at 12:08 pm
    if (!isset($_GET['redirect']) 
        && !isset($_REQUEST['login_name'])
        && empty($_REQUEST['login_name'])
        && !isset($_REQUEST['password'])
        && empty($_REQUEST['password'])
    ) {
        // do stuff
    }
    

    This is exactly what you describe, (not != empty === empty). I think you should edit your question though to explain what you’re triyng to do, so we can suggest better alternatives.

    Edit:

    Your updated question can be simplified as:

    if (empty($_GET['redirect'])
        && !empty($_REQUEST['login_name'])
        && !empty($_REQUEST['password'])
    } {
        // load user
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have URLs like below that need to be recognized by the PHP code.
I have a code snippet below, I'm not quite sure what the last line
I am using the code snippet below, however it's not working quite as I
The snippet of the PHP script below works for the most part... except for
//I have created below snippet to let the sensor to be detected. -(void)addProximitySensorControl {
In the code snippet below, from my jQuery setup, I need to check if
I have below code snippet SimpleDateFormat dateFormat = new SimpleDateFormat( yyyy-MM-dd hh:mm:ss.SSS); String processedContentDate=2012-04-10
I have a table defined (see code snippet below). How can I add a
I have four types of strings, as shown below. The difference is that the
I have a PHP script that inserts data into a mysql database. The table

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.