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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 03-10-2009, 09:53 PM   #1
teh ghey
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
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-10-2009, 09:59 PM   #2
tical
Confirmed User
 
Join Date: Feb 2002
Location: Las Vegas
Posts: 6,504
<? if ($logged_in == 1) && ($blah == 2) { whatever } ?>
tical is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-10-2009, 09:59 PM   #3
teh ghey
Guest
 
Posts: n/a
Quote:
Originally Posted by tical View Post
<? if ($logged_in == 1) && ($blah == 2) { whatever } ?>
cool thank you
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-10-2009, 10:05 PM   #4
teh ghey
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 '}'
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-10-2009, 10:06 PM   #5
jimbona
Confirmed User
 
Join Date: Jan 2007
Posts: 190
Code:
<?PHP
if($logged_in == 1 && $_SESSION['group_id'] == 5)
{
   //do whatever
}
?>
__________________
Thanks
Paul
Thunder-Ball.net - Member
jimbona is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-10-2009, 10:12 PM   #6
who
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';
}
?>
who is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-10-2009, 10:13 PM   #7
teh ghey
Guest
 
Posts: n/a
Quote:
Originally Posted by jimbona View Post
Code:
<?PHP
if($logged_in == 1 && $_SESSION['group_id'] == 5)
{
   //do whatever
}
?>
thanks, this is in the middle of a php page, and actually inside another IF statement, so should I take out the <?PHP
and the ?>
?
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-10-2009, 10:15 PM   #8
teh ghey
Guest
 
Posts: n/a
Quote:
Originally Posted by jimbona View Post
Code:
<?PHP
if($logged_in == 1 && $_SESSION['group_id'] == 5)
{
   //do whatever
}
?>
nevermind that crashed too

Parse error: syntax error, unexpected '}'
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-10-2009, 10:16 PM   #9
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,097
Quote:
Originally Posted by teh ghey View Post
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:
<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!

Last edited by sarettah; 03-10-2009 at 10:17 PM..
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-10-2009, 10:16 PM   #10
jimbona
Confirmed User
 
Join Date: Jan 2007
Posts: 190
Quote:
Originally Posted by teh ghey View Post
thanks, this is in the middle of a php page, and actually inside another IF statement, so should I take out the <?PHP
and the ?>
?
If you have already initiated PHP to start (i.e. tags opened <?PHP )
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.
__________________
Thanks
Paul
Thunder-Ball.net - Member
jimbona is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-10-2009, 10:18 PM   #11
gornyhuy
Chafed.
 
gornyhuy's Avatar
 
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.
__________________

icq:159548293
gornyhuy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-10-2009, 11:38 PM   #12
teh ghey
Guest
 
Posts: n/a
Quote:
Originally Posted by gornyhuy View Post
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.
i just changed it to this.
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 -->
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-10-2009, 11:46 PM   #13
jimbona
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
__________________
Thanks
Paul
Thunder-Ball.net - Member
jimbona is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-10-2009, 11:54 PM   #14
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
im an expert at the PHP's.
I will get back to you shortly
brb.
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-10-2009, 11:57 PM   #15
teh ghey
Guest
 
Posts: n/a
oh ok, ill ask the software developer tomorrow then. was just hoping to get this done tonight
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2009, 02:02 AM   #16
ExLust
Confirmed User
 
ExLust's Avatar
 
Join Date: Aug 2008
Posts: 3,223
Yeah, you better ask the software developer.
__________________

BE A PARTNER
ExLust is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2009, 03:54 AM   #17
james_clickmemedia
Confirmed User
 
james_clickmemedia's Avatar
 
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
james_clickmemedia is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.