Jump to content

If statement question


Padgoi

Recommended Posts

I have this code:

 

			
<if="author['mgroup'] != 14">
{$post['signature']}
</if>

 

I want to add another number after 14.  How would I go about doing that?  I tried just adding a comma, but that caused an html parse error, as did a semi-colon.  Any help would be greatly appreciated.

Link to comment
Share on other sites

If it's considered HTML, I apologize for posting it here.

Can anyone help regardless?

 

The problem is that your code isn't PHP.  It seems to be a mishmash of PHP and HTML.

 

PHP doesn't use tags for statements -- only if you're going from HTML to PHP, or vise versa.  So, an if-statement does not look like:

<if something>
{ ... }
</if>

 

If-statements, in PHP, look like:

<?php

if(something){
   ...
}

?>

 

Note: I used the PHP start and end tags to turn on this message board's syntax highlighting.

 

In order to answer your question, we'll need to see more code and know exactly what you're testing against.

Link to comment
Share on other sites

It's a board script, Invision Power Board.  It is going from PHP to HTML, but there is no other code, just that. 

 

Looks like they're using a templating system then, as what you posted originally isn't plain PHP.

 

Like I asked before, what do you want to test against?  You mentioned another number other than 14.  Is it just one other number?  Or a range of other numbers?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.