Ask a Question related to PHP Development, Design and Development.
-
Devboy #1
Simple varible wont work!
Hey heres the code:
<? if (xbt = 1) { ?>
<tr><Td colspan=2><center>The STATS are from the
XBT tracker we run as the backend of the
server.</center></td></tr>
<? } else {?>
<? } ?>
and the varible is:
xbt = 0;
The varible is at the top of the file.
Why wont this work? If set one 1 or 0 it displays the
<tr><Td colspan=2><center>The STATS are from the
XBT tracker we run as the backend of the
server.</center></td></tr>
Please help.
----------------------------------------
The post originated from PHP Freaks:
----------------------------------------
[url]http://www.phpfreaks.com[/url]
[url]http://www.phpfreaks.com/forums[/url]
Devboy Guest
-
Wont Work
Every time I go to Youtube or photobucket yo watch something, it says you need at least flash player 8 or whatever. And I click the link that takes... -
SQL wont work
Can anyone suggest why this SQL wont work? Someone has suggested that I have a few " in the wrong place. I am missing the basic understanding... -
ASP PAGES WONT WORK
We have a 2000 server running IIS 5.0. and it seems that no asp pages are working. it gives an error server application error. please help. -
Can anyone tell me why this wont work
Dear Stephen on stopMovie repeat with n in the windowlist -- forget n -- use this forget the windowlist end repeat end -
Can anyone tell me why this wont work??
I am trying to check and see if a field is posted or not, if not posted then assign $location which is a session variable to $location_other. If... -
Rod #2
Re: Simple varible wont work!
$xbt = 1 is an assignment...
use if($xbt==1) instead
ROD
"Devboy" <devil@e-xtreme-dot-net.no-spam.invalid> wrote in message
news:EtednalTp7Zctw3dRVn_vA@giganews.com...> Hey heres the code:
>
> <? if (xbt = 1) { ?>
> <tr><Td colspan=2><center>The STATS are from the
> XBT tracker we run as the backend of the
> server.</center></td></tr>
>
> <? } else {?>
> <? } ?>
>
> and the varible is:
>
> xbt = 0;
>
> The varible is at the top of the file.
>
> Why wont this work? If set one 1 or 0 it displays the
> <tr><Td colspan=2><center>The STATS are from the
> XBT tracker we run as the backend of the
> server.</center></td></tr>
>
> Please help.
>
>
>
>
> ----------------------------------------
> The post originated from PHP Freaks:
> ----------------------------------------
> [url]http://www.phpfreaks.com[/url]
> [url]http://www.phpfreaks.com/forums[/url]
>
>
Rod Guest
-
Devboy #3
Re: Simple varible wont work!
Tried that, when i do that it wont display even is its set to 0 or 1
:S
----------------------------------------
The post originated from PHP Freaks:
----------------------------------------
[url]http://www.phpfreaks.com[/url]
[url]http://www.phpfreaks.com/forums[/url]
Devboy Guest
-
AndyB #4
Re: Simple varible wont work!
--------
<?php
xbt = 1; // change value to test xbt =0 or whatever
?>
yadda yadda in html
<?php
if (xbt == 1) {
?>
<tr><Td colspan=2><center>The
STATS are from the XBT tracker we run as the backend of the
server.</center></td></tr>
<?php
} // end case of xbt equals one
else {
?>
boo hoo
<?php
}
?>
--------
Easier to read like this.
The answer is
[url]http://www.php.net/manual/en/index.php[/url]
----------------------------------------
The post originated from PHP Freaks:
----------------------------------------
[url]http://www.phpfreaks.com[/url]
[url]http://www.phpfreaks.com/forums[/url]
AndyB Guest
-
Devboy #5
Re: Simple varible wont work!
No doesnt seem to work with the code layout i have or something,
because with the varible at the top of the page under the
<?
But with the varible under tyhe code u made under:
<?php
xbt = 1;
if (xbt == 1;)
etc etc then it works fine :S.
----------------------------------------
The post originated from PHP Freaks:
----------------------------------------
[url]http://www.phpfreaks.com[/url]
[url]http://www.phpfreaks.com/forums[/url]
Devboy Guest
-
AndyB #6
Re: Simple varible wont work!
> No doesnt seem to work with the code layout i have or something
... but with the varible under tyhe code u made ... it works fine :S.
Then I assume there's something not right with the code layout you>
>
have.
The only difference between <? and <?php is that <? assumes
'short tags' are enabled (which they usually are). Safest is
always to use <?php to begin a chunk of php script.
So, have we solved your problem??
The answer is
[url]http://www.php.net/manual/en/index.php[/url]
----------------------------------------
The post originated from PHP Freaks:
----------------------------------------
[url]http://www.phpfreaks.com[/url]
[url]http://www.phpfreaks.com/forums[/url]
AndyB Guest
-
Devboy #7
Re: Simple varible wont work!
Well that code works so in away yes, but the function wont work, so in
a way no :S.
----------------------------------------
The post originated from PHP Freaks:
----------------------------------------
[url]http://www.phpfreaks.com[/url]
[url]http://www.phpfreaks.com/forums[/url]
Devboy Guest
-
AndyB #8
Re: Simple varible wont work!
> Well that code works so in away yes, but the function wont work, so
in a way no :S.... what function?? I don't see any mention of a function in your>
>
posts (or am I in need of more sleep/more coffee?).
The answer is
[url]http://www.php.net/manual/en/index.php[/url]
----------------------------------------
The post originated from PHP Freaks:
----------------------------------------
[url]http://www.phpfreaks.com[/url]
[url]http://www.phpfreaks.com/forums[/url]
AndyB Guest
-
Devboy #9
Re: Simple varible wont work!
Sorry! i ment varible, wotn work with my code layout.
----------------------------------------
The post originated from PHP Freaks:
----------------------------------------
[url]http://www.phpfreaks.com[/url]
[url]http://www.phpfreaks.com/forums[/url]
Devboy Guest
-
AndyB #10
Re: Simple varible wont work!
> Sorry! i ment varible, wotn work with my code layout.
Then my inevitable conclusion is that your 'layout' is wrongly>
>
coded. If you want help with fixing it ... post a useful chunk of
the code you have and use the CODE button in your response to show
your code in the most readable format.
The answer is
[url]http://www.php.net/manual/en/index.php[/url]
----------------------------------------
The post originated from PHP Freaks:
----------------------------------------
[url]http://www.phpfreaks.com[/url]
[url]http://www.phpfreaks.com/forums[/url]
AndyB Guest



Reply With Quote

