0

I have the following part of code inside my HTML body tag:

<?php if(1==2) { ?>

    <a class="demage" href="xxxx.html">demage</a>
    <a class="history" href="xxxx.html">history</a>

<?php } else { ?>

    <a class="Sign In" href="login_page.html">Sign In</a>
    <a class="Sign Up" href="register_page.html">Sign Up</a>

<?php } ?>

but it displays the 4 links in a row, not the last two as it is supposed to. What is wrong with the code?

user63762453
  • 1,734
  • 2
  • 22
  • 44
nicolasmanic
  • 19
  • 1
  • 10

2 Answers2

0

code

I don't see any error in the code the code is running as expected. (See the image attached.)

May be there's some problem with your php.

user63762453
  • 1,734
  • 2
  • 22
  • 44
0

Answered in comments, collective effort.

By default PHP will only evaluate/parse files containing PHP with the extension .php

Lawrence Cherone
  • 46,049
  • 7
  • 62
  • 106
  • Could you please clarify this; I think the statement is much too broad. I know what you're trying to indicate, however, this reads as if php is limited to reading only files and data that have a `.php` extension. – l'L'l Jul 13 '14 at 11:22
  • @l'L'l Yeah I suppose your right, if the OP's question is not read, it may seem broadish. Its community wiki so feel-free to word it better. – Lawrence Cherone Jul 13 '14 at 11:39