Can someone tell me why this is still showing the data?
<? $info = 0;?>
<? if ($info == 1){?>
<div class="col-md-5">
<img src="<?= $info['n_1_image1'];?>">
</div>
<div class="col-md-4">
<b>Title:</b> <?= $info['n_1_title1'];?><hr style="margin-bottom: -10px; margin-top: 10px"> <br />
<b>Total Views:</b> <?= number_format($info['n_1_view1']);?><hr style="margin-bottom: -10px; margin-top: 10px"> <br />
<b>Duration:</b> <?= gmdate("H:i:s", $info['n_1_time1'])?><hr style="margin-bottom: -10px; margin-top: 10px"> <br />
<b>Likes:</b> <?= number_format($info['n_1_likes1']);?><hr style="margin-bottom: -10px; margin-top: 10px"> <br />
<b>Comments:</b> <?= number_format($info['n_1_comments1']);?><hr style="margin-bottom: -10px; margin-top: 10px"> <br /><br />
</div>
<div class="col-md-2">
<a href="<?=$info['n_1_link1'];?>" target="_blank"> <button type="button" class="btn btn-shadow btn-danger" style="height: 175px; width: 200px">Watch Now!</button></a>
</div>
<br /><br />
<?}else{?>
<?}?>
I really don't know why this will show data even $info isn't 1
I hope someone can help me thanks!
By default, you need to use <?php
instead of <?
unless you use short_open_tag=On
in your php.ini
.
From the docs:
When PHP parses a file, it looks for opening and closing tags, which are which tell PHP to start and stop interpreting the code between them. Parsing in this manner allows PHP to be embedded in all sorts of different documents, as everything outside of a pair of opening and closing tags is ignored by the PHP parser.
PHP also allows for short open tags (which are discouraged because they are only available if enabled with short_open_tag php.ini configuration file directive, or if PHP was configured with the --enable-short-tags option.