php is not working

  • Unknown's avatar

    I have been developing in C# for years, but in php for only a couple weeks, and I am still having problems wrapping my head around it. I am trying to do something simple: put a login/out option in a page and/or sidebar. I am finding I can’t get simple php to work. If I enter:

    Before
    <?php
    echo ‘Hello World!’;
    ?>
    After <b>

    I end up with:

    Before
    After

    Also, I added:

    <?php if (is_user_logged_in()){echo “<h2>You are logged in! </h2>”; ?>
    <?php } else {echo “<h2>Please log in. </h2>”; ?>

    The page ends up with:

    You are logged in! ”; ?> Please log in. ”; ?>

    Obviously, the closing tags are not getting parsed, though the opening ones are.

    What am I missing?

    thanks!

  • Unknown's avatar

    You did not specify a blog address or reason for posting when you created this topic.

    This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.

    If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.

    If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.

    This is an automated message.

  • Unknown's avatar

    I’m sorry, but that embed code will not work because we remove JavaScript, Flash, iframe, form, and input tags for security reasons.

    There are no restrictions if you setup a self-hosted WordPress.org blog instead of a WordPress.com blog, but there are some added responsibilities. We have hosting recommendations at the following link if you are interested.

  • The topic ‘php is not working’ is closed to new replies.