Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9028485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:59:42+00:00 2026-06-16T06:59:42+00:00

I need help in getting this if else statement working. I have the HTML

  • 0

I need help in getting this if else statement working. I have the HTML showing up on the website but I also need the php working too. I do not know a way around doing an echo inside of another echo (which is frowned upon). Any suggestions would help!

code
<?php
if ( is_user_logged_in() ) {echo "
<div id='fixedbar'>
<div id='boxfloat'>
<div id='header'>
<img src='http://s3.amazonaws.com/punchtab-static/nd/images/favicon.ico' id='favicon'       border='0' onerror='imageNotFound(this, '//s3.amazonaws.com/punchtab-  static/nd/images/bar/shield.png')' onload='imageFound(this)' style='visibility: visible;'>
</div>
<p>
Rewards
<div id='points'>
<div id='user'>
echo 'cosmo_avatar( get_the_author_meta('ID') , 30 )'; ?>
</div>
echo cp_displayPoints($user->ID)'; pts
</div>
<div id='more'>
<a href='/leaderboard'>
<img border='0' src='http://expertcamo.com/wp-content/uploads/2012/12/icon-leaderboard.png' id='leaderboard' alt='Leaderboard' title='Expert Camo Points Leaderboard'</a>

<a href='/catalog'>
<img border='0' src='http://expertcamo.com/wp-content/uploads/2012/12/icon-trophy.png' id='catalog' alt='Catalog' title='Rewards Catalog'</a>

</div>
</p>
<div id='copyright'><a href='/'>
Expert Camo &copy; echo 'date('Y')';</a>
</div>
</div>
</div>
";} else { echo "
<div id='fixedbar'>
<div id='boxfloat'>

</div>
</div>
";}
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T06:59:43+00:00Added an answer on June 16, 2026 at 6:59 am

    Untested but based on what you had should work:

        <?php
    if(is_user_logged_in()){
                   echo "
                    <div id='fixedbar'>
                    <div id='boxfloat'>
                    <div id='header'>
                    <img src='http://s3.amazonaws.com/punchtab-static/nd/images/favicon.ico' id='favicon'           border='0' onerror='imageNotFound(this, '//s3.amazonaws.com/punchtab-      static/nd/images/bar/shield.png')' onload='imageFound(this)' style='visibility: visible;'>
                    </div>
                    <p>
                    Rewards
                    <div id='points'>
                    <div id='user'>";
                    echo cosmo_avatar( get_the_author_meta('ID') , 30 );
                    echo "</div>";
    
                    echo cp_displayPoints($user->ID) . 'pts';
    
    
                    echo "</div>
                    <div id='more'>
                    <a href='/leaderboard'>
                    <img border='0' src='http://expertcamo.com/wp-content/uploads/2012/12/icon-leaderboard.png' id='leaderboard' alt='Leaderboard' title='Expert Camo Points Leaderboard'</a>
    
                    <a href='/catalog'>
                    <img border='0' src='http://expertcamo.com/wp-content/uploads/2012/12/icon-trophy.png' id='catalog' alt='Catalog' title='Rewards Catalog'</a>
    
                    </div>
                    </p>
                    <div id='copyright'><a href='/'>Expert Camo &copy; ";
    
                    echo date('Y');
    
                    echo "</a>
                            </div>
                            </div>
                            </div>";
    
            }
                else{
    
                        echo "<div id='fixedbar'>
                                <div id='boxfloat'>
                                </div>
                                </div>";
    
                }
    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'll try this again. I need help in getting a third option working using
I need some help in getting this right, problem Write a function which takes
I need a little help getting this script doing what I want it to.
I need help getting VIM to correctly indent javascript inside script tags. This is
Need help getting Ember-Data working with Zend Rest. At first, I'm familiar with Zend
I need help getting CommonJS working on Java 7 and Rhino 1.7R3. Rhino 1.7R3
I need help getting git extensions to run with msysgit. I have had bad
I need help getting my java program ready for release. I have a program
I know this is a lot of code but I really need help making
I am working on a homework problem, I'm close but need some help with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.