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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:12:42+00:00 2026-05-29T09:12:42+00:00

function test(){ $embedmode = ‘normal’; if ( ( $embedmode != ” ) && (

  • 0
function test(){
$embedmode = 'normal';
if ( ( $embedmode != '' ) && ( $embedmode != 'normal' || $embedmode != 'popup' || $embedmode != 'popup' ) )
    return "<p>ARVE Error: mode is not set to 'normal', 'popup' or 'special' maybe typo</p>";
elseif ( $embedmode == '')
    $mode = 'default';
else
    $mode = $embedmode;

echo '<pre>';
var_dump($mode);
echo "</pre>";
}
echo test();

this is my attempt and I am getting a headache now it puts out the return message and I don’t know why

  • 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-29T09:12:43+00:00Added an answer on May 29, 2026 at 9:12 am

    Your bad logic is here:

    ( $embedmode != 'normal' || $embedmode != 'popup' || $embedmode != 'popup' )
    

    if $embedmode equals 'normal', then $embedmode != 'popup', so this whole bit is TRUE. I believe you want to replace || with &&.

    For code that’s easier to reason about, I’d probably use in_array or switch, like this:

    switch ($embedmode) {
      case 'normal':
      case 'popup':
      case 'special':
        // valid, proceed
        break;
      case '':
        $embedmode = 'default';
        break;
      default:
        trigger_error ("Embed mode '$embedmode' not valid.");
        break;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not able to check the return values of the function test; man test
If I do function test() { var fromDate=01/17/2012; var res= Test1(fromDate); return false; }
Javascript compiles this code without error: function test() { property: true; alert('testing'); } test();
I am trying to set three variables from a test function. Here's my code
Public MyObj as Object Public Function Test(t as Type) as Boolean Return TypeOf MyObj
mysql> CREATE FUNCTION test () -> RETURNS CHAR(16) -> NOT DETERMINISTIC -> BEGIN ->
$_POST['asdf'] = 'something'; function test() { // NULL -- not what initially expected $string
The following js method does not return, yet firebug reports no exception: function test_contains_doesNotBailWithoutException()
<script type=text/javascript> function test() { alert('&lt;span&gt;blah&lt;span&gt;'); } </script> <a href=# onclick=test();>First</a><br /> <a href=#
Is the following code valid? function test() { return /\//.exec(\/); } alert(test()); It seems

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.