![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Guest
Posts: n/a
|
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 |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Feb 2002
Location: Las Vegas
Posts: 6,504
|
<? if ($logged_in == 1) && ($blah == 2) { whatever } ?>
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Guest
Posts: n/a
|
|
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Guest
Posts: n/a
|
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 '}' |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Jan 2007
Posts: 190
|
Code:
<?PHP if($logged_in == 1 && $_SESSION['group_id'] == 5) { //do whatever } ?> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
So Fucking Banned
Join Date: Aug 2003
Location: ICQ #23642053
Posts: 19,593
|
Code:
<?PHP if($logged_in == 1 && $_SESSION['group_id'] == 5) { echo 'Juicy'; } ?> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Guest
Posts: n/a
|
|
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Guest
Posts: n/a
|
|
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,097
|
Quote:
Code:
<li> <? php if ($loggedin_can_upgrade_account == 1) && ($session.group_id == 2) { echo 'anchor:url1="upgrade/",url2="index.php?m=account_upgrade",name="Upgrade"'; } ?> </li>
__________________
All cookies cleared! |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Confirmed User
Join Date: Jan 2007
Posts: 190
|
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. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Chafed.
Join Date: May 2002
Location: Face Down in Pussy
Posts: 18,041
|
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.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 | |
Guest
Posts: n/a
|
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 --> |
|
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Confirmed User
Join Date: Jan 2007
Posts: 190
|
Your code above isnt valid PHP.
What templating system are you using ? <!-- --> is a HTML comment syntax |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
So Fucking What
Industry Role:
Join Date: Jul 2006
Posts: 17,189
|
im an expert at the PHP's.
I will get back to you shortly brb. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Guest
Posts: n/a
|
oh ok, ill ask the software developer tomorrow then. was just hoping to get this done tonight
|
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Confirmed User
Join Date: Aug 2008
Posts: 3,223
|
Yeah, you better ask the software developer.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Confirmed User
Join Date: Apr 2003
Location: Texas / London
Posts: 2,204
|
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.
__________________
$ CLICKMEMEDIA.COM $ CONVERTING ETHNIC TRAFFIC SINCE 1998 ~ $30+PPS
BLACK-X.COM - NEW BLACK EX-GF SITE CLICKMEMEDIA.COM ~ ICQ - 8788771 |
![]() |
![]() ![]() ![]() ![]() ![]() |