-2

I added the error reporting...still doesn't show up what the problem was. This is the code in my index.php

As you can see, I added some sort of alert if the user_ok returns...which does...

<?php error_reporting(E_ALL); ?>
<html>
<head>
<script language="javascript" type="text/javascript" src="./js/jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="./js/ajax.js"></script>
<script language="javascript" type="text/javascript" src="./js/main.js"></script>
<title>Title</title>
</head>
<body>
<center>
<?php include_once("check-login.php"); ?>
<?php // if ($user_ok == true) { echo "true"; } ?>
<?php if ($user_ok == true): ?>
<div>
    <img src='./img/logo.png'><br>
    <form action='#' method='post'>
        <input type='text' maxlength='88' placeholder='Search'>
    </form>
</div>
<?php else: ?>
<div>
    <img src='./img/logo-horizontal.png'><br>
    <div>
    <!-- SOME CONTENT -->
    </div>  
</div>
<? endif; ?>
</body>
</html>
1
  • Did one of the answers below help resolve your question? If so, you should accept it as correct. Commented Dec 10, 2013 at 18:26

3 Answers 3

3

Since you've opened your control structure using the traditional <?php ?> open-close tag, you'll need to close your conditional with th PHP tags:

<?php endif; ?>

Note that, per the documentation:

Mixing syntaxes in the same control block is not supported.

Also, note that the use of the <? ?> short tags is only enabled if short_open_tag is set equal to TRUE in your php.ini.

Sign up to request clarification or add additional context in comments.

Comments

1

see the

<? endif; ?>

it should be

<?php endif; ?>

Comments

1

Change

<? endif; ?>

to

<?php endif; ?>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.