Unstoppable Domains

<?=$Variable?> and <? ?>

Spaceship Spaceship
Watch

hanz

onArcade.comVIP Member
Impact
9
I just installed WAMP5 on my computer and I tested some scripts that I have made, but there seems to be some problems with using
PHP:
<?=$variable?>
and
PHP:
<? ?>
I must use
PHP:
<?php ?>
Or it just won't work.
So I was wondering if this is some kind of 'problem' with Windows, WAMP5, PHP 5 or something else. :| And should I stop using <?=$variable?> and <? ?>?

Thanks!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
In php.ini make sure, short_open_tag is set to On. And as far as if you should use it or not:

php.ini said:
; Allow the <? tag. Otherwise, only <?php and <script> tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
 
1
•••
if you are asking if you should use <? or <?php , I think it depends on how php is setup.
 
0
•••
Thanks! I guess I will have to start using <?php :D
 
0
•••
Using <?php ?> and <? echo $var ?> will make sure that your script works and your code will be nicer too ;)
 
0
•••
mch said:
Using <?php ?> and <? echo $var ?> will make sure that your script works and your code will be nicer too ;)
well, I think that <?=$variable?> looks better than <?php echo $variable; ?>, but if there may be problems with some servers then I will just have to start using <?php echo $variable; ?>
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back