vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   PHP If statement issue (https://vborg.vbsupport.ru/showthread.php?t=180659)

rowlandc 05-27-2008 06:50 AM

PHP If statement issue
 
Hi guys,

I need a little bit of help with solving an issue which we are getting with this php statement.

PHP Code:

if(isset($value)) { 
echo 
"true"
} else { 
echo 
"false"


Currently whats happening is that both true and false appear... we've never seen this happen before and wanted to know if you guys would have clue why both echo at the same time.

Dismounted 05-27-2008 07:10 AM

PHP Code:

if ($value)
{
    echo 
'true';
}
else
{
    echo 
'false';


isset() simply checks if the variable exists, regardless of value.

rowlandc 05-27-2008 07:34 AM

The value returned has nothing to do with the issue...

Dismounted 05-27-2008 07:40 AM

Right, sorry, I misinterpreted your question. That should never happen, and really can't happen, as an if/else statement can only run either block, not both.

rowlandc 05-27-2008 07:43 AM

Quote:

Originally Posted by Dismounted (Post 1532645)
Right, sorry, I misinterpreted your question. That should never happen, and really can't happen, as an if/else statement can only run either block, not both.

Aye thats what we where thinking.... it's bizzare.

--------------- Added [DATE]1211881849[/DATE] at [TIME]1211881849[/TIME] ---------------

Anyone else have a clue what could be happening?

Opserty 05-27-2008 12:53 PM

Run this and copy and paste the exact output (preferably from the HTML source):

PHP Code:

echo '------- START -------';

if(isset(
$value))
{
    echo 
'true';
}
else
{
    echo 
'false';
}

echo 
'------- VAR -------';

var_dump($value);

echo 
'------- END -------'


rowlandc 05-28-2008 06:46 AM

fixed, I had to get the coder to type of the whole code by hand. It seems like the files where not uploading correctly.

Thank you for the help.


All times are GMT. The time now is 10:01 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01113 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete