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

  • Home
  • SEARCH
  • 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 6121503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:47:29+00:00 2026-05-23T15:47:29+00:00

PHP code (functions.php) $main = $db_sql->query_array(SELECT catid,titel,subcat,startorder FROM $cat_table WHERE catid=’$subcat’); $tpl->register(‘category_title’,stripslashes($main[‘titel’])); $tpl->register(‘category_id’,$main[‘catid’]); So

  • 0

PHP code (functions.php)

$main = $db_sql->query_array("SELECT catid,titel,subcat,startorder FROM $cat_table WHERE catid='$subcat'");
$tpl->register('category_title',stripslashes($main['titel']));
$tpl->register('category_id',$main['catid']);

So I want to add an if statement where if {category_id} is not 0 then do the following code

<img src="{GRAFURL}/{category_id}.jpg" alt="{category_title}" width="50" height="50" border="0" align="middle" />&nbsp;{category_title}

what would be the correct syntax?

need more code still for the html file?

  • 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-05-23T15:47:29+00:00Added an answer on May 23, 2026 at 3:47 pm

    HTML doesn’t have dynamic features like if-statements. Think of HTML as a language to define a layout – unchangeable using HTML itself.

    This should do the trick:

    <?php
    
      if ( false === is_empty( $category_id )) {
    
        echo  "<img src='{$GRAFURL}/{$category_id}.jpg' alt='{$category_title}' 
                width='50' height='50' 
                border='0' align='middle' />&nbsp;{$category_title} ";
    
      }
    
    ?>
    

    In case you need to add client-side dynamic features to your HTML-pages, have a look at jQuery or jQuery UI.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a PHP regex to extract functions from php source code.
I have some setup code in my functions.php file that sets permalinks and adds
These past few days I've been working toward converting my PHP code base from
I have the folloing code: <?php require_once('db.inc.php'); print Complete:; Main::getTable(null,null); sleep(3); print <br>Model:; Main::getTable('model','A2');
Can anyone explain what the following PHP Code does function query($query_string) { if ($query_string
I am completely stumped. Here is my php (CodeIgniter) code: function mod() { $uid
The code: function updateDashboardData() { $.getJSON(includes/system/ajaxDataInterface.php, {recordcount:1}, function(data) { $('.stationContainer').each(function(data) { var bsID =
I have this code: function submitTwice(f){ f.action = 'http://mydomain.com/threevideopage.php'; f.target='name'; f.submit(); } I left
I recall reviewing someone else's PHP code once and he had a function or
Can anyone explain the following PHP Code ? function get_param($param_name, $param_type = 0) {

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.