![]() |
Any PHP guys here? Need quick help with an IF statement
I need to say:
<!-- IF loggedin_can_upgrade_account == "1" --> AND <!-- IF session.group_id == "5" --> THEN do something I want <!-- ENDIF --> So how do I put those 2 conditions together? So I just list them seperately, or put them on the same line. I know nothing about php thanks |
<? if ($logged_in == 1) && ($blah == 2) { whatever } ?>
|
Quote:
|
didnt work
I did: <!-- if ($loggedin_can_upgrade_account == 1) && ($session.group_id == 2) --> <li>{anchor:url1="upgrade/",url2="index.php?m=account_upgrade",name="Upgrade "}</li> <!-- ENDIF --> I got this error: Parse error: syntax error, unexpected '}' |
Code:
<?PHP |
Code:
<?PHP |
Quote:
and the ?> ? |
Quote:
Parse error: syntax error, unexpected '}' |
Quote:
Code:
<li> |
Quote:
then you only need the if statement/data. In your code though, you have it surrounded in comments which would cause parse errors as you see reported. If you can post the full code, or the segment your trying to join it into I can advise more. |
post the entire code block. You have mixed php and templating system stuff there and you could be fucking it up in any number of ways.
|
Quote:
it doesnt crash, but it doesnt work (display the url I want to group #2 <!-- IF app_license == "commercial" --> <!-- IF system_enable_upgrades == "1" --> <!-- IF loggedin_can_upgrade_account == "1" --> <!-- IF session.group_id == "2" --> <li>{anchor:url1="theurliwant"}</li> <!-- ENDIF --> <!-- ENDIF --> <!-- ENDIF --> <!-- ENDIF --> |
Your code above isnt valid PHP.
What templating system are you using ? <!-- --> is a HTML comment syntax |
im an expert at the PHP's.
I will get back to you shortly brb. |
oh ok, ill ask the software developer tomorrow then. was just hoping to get this done tonight
|
Yeah, you better ask the software developer.
|
better of giving one of these guys the php file and they could fix the code in like 2 secs. Its hard to write code blindly when you don't know what else is on the page.
|
All times are GMT -7. The time now is 01:23 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123