Re: [PHP] php in css not working with IF's
Budweiser if ( A != 10 or A != 9 ) -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php in css not working with IF's
Should I stick with if (($site_style!=10) ($site_style!=9) ($site_style!=8)) or if($site_style != ('10' or '9' or '8')) So here's what I've gathered from the various messages and my current methods: - index.php selects $site_style from the db - header.php is included by index.php (header.php has the css src for styles.php in it) - styles.php has the IF's - I need to put link rel=stylesheet src=styles.php?site_style=xxBROWSER_PLATFORM=xyz to pass the variables from the script to the css file (if possible, I need to get around this as headers are being included with the css src already in them) - do not need to use require() in styles.php Thanks to everyone for all the suggestions!! :) Jason -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: October 4, 2001 2:09 AM To: Maxim Maletsky (PHPBeginner.com) Cc: 'Jason Dulberg'; [EMAIL PROTECTED] Subject: RE: [PHP] php in css not working with IF's Ok. Wll show you with an example: if (($site_style!==10) ($site_style!==9) ($site_style!==8)) { } elseif ($site_style==10) { } Should simply be if($site_style != ('10' or '9' or '8')) {} Stop confusing the lad. That obviously won't work. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php in css not working with IF's
On Thu, 4 Oct 2001 16:04, Jason Dulberg wrote: Should I stick with if (($site_style!=10) ($site_style!=9) ($site_style!=8)) or if($site_style != ('10' or '9' or '8')) As has been pointed out, that latter won't work. What is the range of possible values for $site_style? If it is 10 or less, then you could simply rephrase the test to if($site_style 8) or alternatively, if the range is 0 to more than 10 if( $site_style 8 || $site_style 10 ) -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Ici nous voyons le tour Eiffel! Tom parried. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php in css not working with IF's
$site_style ranges from 1 - 11 $site_style 1 - 7,11 use the same css style. $site_style 8,9 use the same css $site_stylye 10 uses different css from them all. Thanks for your time. Jason -Original Message- From: David Robley [mailto:[EMAIL PROTECTED]] Sent: October 4, 2001 2:48 AM To: Jason Dulberg; Rasmus Lerdorf Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] php in css not working with IF's On Thu, 4 Oct 2001 16:04, Jason Dulberg wrote: Should I stick with if (($site_style!=10) ($site_style!=9) ($site_style!=8)) or if($site_style != ('10' or '9' or '8')) As has been pointed out, that latter won't work. What is the range of possible values for $site_style? If it is 10 or less, then you could simply rephrase the test to if($site_style 8) or alternatively, if the range is 0 to more than 10 if( $site_style 8 || $site_style 10 ) -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Ici nous voyons le tour Eiffel! Tom parried. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php in css not working with IF's
I just want to thank everyone who helped me get the css stuff to work. All of the IF statements are now working properly --- I've certainly learned a lot from all the messages. thanks again... Maxim Maletsky Rasmus Lerdorf and all others who responded to my message! __ Jason Dulberg Extreme MTB http://extreme.nas.net I have a common css file that is being used across several virtual hosts. Basically, what I am trying to do is use the same css file even though several text colors/sizes need to be changed depending on what site/platform its being used on. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php in css not working with IF's
On Thu, 4 Oct 2001 13:49, Jason Dulberg wrote: I have a common css file that is being used across several virtual hosts. Basically, what I am trying to do is use the same css file even though several text colors/sizes need to be changed depending on what site/platform its being used on. I have my sql query (retrieves $site_style) in the file that includes the css file and a bunch of IF statements inside the css file itself. The only problem is that the css is not being generated properly. For some reason, the IF statements are not being processed correctly/at all. I can echo the variables through the index.php and the variables are set to global. Its just that styles.php seems to almost bypass the IF and use the 1st set of variables even though it shouldn't be. Here's an example from the css (styles.php) - there are about 5 IF statements in there but here's the basic idea of them all: ?php //index.php creates platform and site style require(index.php); if (($BROWSER_PLATFORM == Win) (($site_style!==10) || Any other problems aside, this is not how you do 'Not Equal'. $site_style!=10 is correct syntax. ($site_style!==9))) { $pc8=8; $pc9=9; $pc10=10; $pc12=12; $pc13=13; $pc14=14; $text=#ff; $heading=#2E4471; } ? .standard { font-family:verdana, arial; font-size: ?=$pc10;?pt; color:?=$text;?; } The call from site style 10 link rel=stylesheet href=/styles.php If I go to a $site_style 10, it still uses the variables defined within the example IF statement even though it clearly shouldn't. If I type in the URL to styles.php from a $site_style 10, it shows the wrong tags. Is it a problem with my IF statements or is something else going over my head? Thanks again for any help - I've been trying to figure this out for days to no avail... __ Jason Dulberg Extreme MTB http://extreme.nas.net -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA The first myth of management is that it exists. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php in css not working with IF's
if (($BROWSER_PLATFORM == Win) (($site_style!==10) || ($site_style!==9))) { Common logic mistake. if ( A != 10 or A != 9 ) Which value of A would make that logic false? -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php in css not working with IF's
Thank you for your response. I changed my the code to the method that you suggested. Unfortunately, it still doesn't use the IF's properly. For instance, if I open a $site_style 10, the IF statement for that is the following: elseif (($BROWSER_PLATFORM == Win) ($site_style==10)) { $pc8=8; $pc9=9; $pc10=10; $pc12=12; $pc13=13; $pc14=14; $text=#D1BAC6; $link=#F8CC92; $heading=#B38B9F; } It still reads the first IF statement as I have in the original message shown below. Thanks again. Jason. if (($BROWSER_PLATFORM == Win) (($site_style!==10) || Any other problems aside, this is not how you do 'Not Equal'. $site_style!=10 is correct syntax. ($site_style!==9))) { $pc8=8; $pc9=9; $pc10=10; $pc12=12; $pc13=13; $pc14=14; $text=#ff; $heading=#2E4471; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php in css not working with IF's
Any other problems aside, this is not how you do 'Not Equal'. $site_style!=10 is correct syntax. No, !== is quite valid. It is the non-equality version of === See http://www.php.net/manual/en/language.operators.comparison.php -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php in css not working with IF's
Theoretically, either/or I'm assuming. If A isn't 10 or A isn't 9... So I'm assumuming that my IF's are way off base? This is definitely something that'll be helpful for my other work as well. Thanks __ Jason Dulberg Extreme MTB http://extreme.nas.net -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: October 4, 2001 12:41 AM To: Jason Dulberg Cc: [EMAIL PROTECTED] Subject: Re: [PHP] php in css not working with IF's if (($BROWSER_PLATFORM == Win) (($site_style!==10) || ($site_style!==9))) { Common logic mistake. if ( A != 10 or A != 9 ) Which value of A would make that logic false? -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php in css not working with IF's
Without following your logic I can give an example of how style sheets on PHPBeginner.com work: In the page we have link rel=stylesheet href=/styles.php And in the styles.php we have all the possible DB connections, browser checks by (PHP SNIFF) and so and so on. You cold even try to call the class this way with Get: link rel=stylesheet href=/styles.php?foo=foobar=baz That will work as well. But one thing you cannot do is defining variable on index.php hoping they would become available in styles.php - those are TOTALY separated processes. Something like if you would have a page with two frames. So, here's another thing. The only reason of using external CSS file is to have it automatically cached by your browser so it loads once per session. By default it will not. You're gonna need to review your headers, adding cache control to it. Hope it gave you an idea. Maxim Maletsky www.PHPBeginner.com -Original Message- From: Jason Dulberg [mailto:[EMAIL PROTECTED]] Sent: giovedì 4 ottobre 2001 6.19 To: [EMAIL PROTECTED] Subject: [PHP] php in css not working with IF's I have a common css file that is being used across several virtual hosts. Basically, what I am trying to do is use the same css file even though several text colors/sizes need to be changed depending on what site/platform its being used on. I have my sql query (retrieves $site_style) in the file that includes the css file and a bunch of IF statements inside the css file itself. The only problem is that the css is not being generated properly. For some reason, the IF statements are not being processed correctly/at all. I can echo the variables through the index.php and the variables are set to global. Its just that styles.php seems to almost bypass the IF and use the 1st set of variables even though it shouldn't be. Here's an example from the css (styles.php) - there are about 5 IF statements in there but here's the basic idea of them all: ?php //index.php creates platform and site style require(index.php); if (($BROWSER_PLATFORM == Win) (($site_style!==10) || ($site_style!==9))) { $pc8=8; $pc9=9; $pc10=10; $pc12=12; $pc13=13; $pc14=14; $text=#ff; $heading=#2E4471; } ? .standard { font-family:verdana, arial; font-size: ?=$pc10;?pt; color:?=$text;?; } The call from site style 10 link rel=stylesheet href=/styles.php If I go to a $site_style 10, it still uses the variables defined within the example IF statement even though it clearly shouldn't. If I type in the URL to styles.php from a $site_style 10, it shows the wrong tags. Is it a problem with my IF statements or is something else going over my head? Thanks again for any help - I've been trying to figure this out for days to no avail... __ Jason Dulberg Extreme MTB http://extreme.nas.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php in css not working with IF's
Theoretically, either/or I'm assuming. If A isn't 10 or A isn't 9... But since A cannot be both 9 and 10 at the same time, A will *always* not be one of them. It's exactly the same as saying: if (!(A==9 AND A==10)) Obviously A cannot be both 9 and 10 at the same time so the above will be: if(!(false)) which is the same as if(true) Some people find it helpful to draw Venn diagrams of their boolean logical expressions. See http://www.lib.csub.edu/infocomp/search/boolean/venn.htm for a simple description of those. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php in css not working with IF's
nice to know demorgan's laws actually show up every now and then ;-) -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 04, 2001 12:58 AM To: Jason Dulberg Cc: [EMAIL PROTECTED] Subject: RE: [PHP] php in css not working with IF's Theoretically, either/or I'm assuming. If A isn't 10 or A isn't 9... But since A cannot be both 9 and 10 at the same time, A will *always* not be one of them. It's exactly the same as saying: if (!(A==9 AND A==10)) Obviously A cannot be both 9 and 10 at the same time so the above will be: if(!(false)) which is the same as if(true) Some people find it helpful to draw Venn diagrams of their boolean logical expressions. See http://www.lib.csub.edu/infocomp/search/boolean/venn.htm for a simple description of those. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php in css not working with IF's
Thanks Rasmus. The link you provided will become a great resource for PHPBeginner.com Cheers! Maxim Maletsky www.PHPBeginner.com -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: giovedi 4 ottobre 2001 6.58 To: Jason Dulberg Cc: [EMAIL PROTECTED] Subject: RE: [PHP] php in css not working with IF's Theoretically, either/or I'm assuming. If A isn't 10 or A isn't 9... But since A cannot be both 9 and 10 at the same time, A will *always* not be one of them. It's exactly the same as saying: if (!(A==9 AND A==10)) Obviously A cannot be both 9 and 10 at the same time so the above will be: if(!(false)) which is the same as if(true) Some people find it helpful to draw Venn diagrams of their boolean logical expressions. See http://www.lib.csub.edu/infocomp/search/boolean/venn.htm for a simple description of those. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php in css not working with IF's
Would make a nice little PHP-GD exercise for someone to build a PHP app that took a boolean logical expression and produced a Venn diagram. Maybe limit it to 3 or less terms to not make your brain explode. -Rasmus On Thu, 4 Oct 2001, Maxim Maletsky (PHPBeginner.com) wrote: Thanks Rasmus. The link you provided will become a great resource for PHPBeginner.com Cheers! Maxim Maletsky www.PHPBeginner.com -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: giovedi 4 ottobre 2001 6.58 To: Jason Dulberg Cc: [EMAIL PROTECTED] Subject: RE: [PHP] php in css not working with IF's Theoretically, either/or I'm assuming. If A isn't 10 or A isn't 9... But since A cannot be both 9 and 10 at the same time, A will *always* not be one of them. It's exactly the same as saying: if (!(A==9 AND A==10)) Obviously A cannot be both 9 and 10 at the same time so the above will be: if(!(false)) which is the same as if(true) Some people find it helpful to draw Venn diagrams of their boolean logical expressions. See http://www.lib.csub.edu/infocomp/search/boolean/venn.htm for a simple description of those. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php in css not working with IF's
Do you want to do it? PHPBeginner.com and many other PHP sites would greatly appreciate it, Rasmus. Though, NOT and XOR are often unknown to beginners, I noticed it in their codes. Anyway, it is a great idea, I think. I see so many neo programmers confusing with it. Lots of PHP developers are coming from web development industry where they've often seen few other things but Macromedia. Obviously it takes them ages to get logical operators as it is rarely documented for very beginners level. For instance, my assistants at my previous job were categorically refusing looking onto manuals trying religiously to understand logicals from raw code samples. Maxim Maletsky www.PHPBeginner.com -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: giovedi 4 ottobre 2001 7.09 To: Maxim Maletsky (PHPBeginner.com) Cc: 'Jason Dulberg'; [EMAIL PROTECTED] Subject: RE: [PHP] php in css not working with IF's Would make a nice little PHP-GD exercise for someone to build a PHP app that took a boolean logical expression and produced a Venn diagram. Maybe limit it to 3 or less terms to not make your brain explode. -Rasmus On Thu, 4 Oct 2001, Maxim Maletsky (PHPBeginner.com) wrote: Thanks Rasmus. The link you provided will become a great resource for PHPBeginner.com Cheers! Maxim Maletsky www.PHPBeginner.com -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: giovedi 4 ottobre 2001 6.58 To: Jason Dulberg Cc: [EMAIL PROTECTED] Subject: RE: [PHP] php in css not working with IF's Theoretically, either/or I'm assuming. If A isn't 10 or A isn't 9... But since A cannot be both 9 and 10 at the same time, A will *always* not be one of them. It's exactly the same as saying: if (!(A==9 AND A==10)) Obviously A cannot be both 9 and 10 at the same time so the above will be: if(!(false)) which is the same as if(true) Some people find it helpful to draw Venn diagrams of their boolean logical expressions. See http://www.lib.csub.edu/infocomp/search/boolean/venn.htm for a simple description of those. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php in css not working with IF's
Wonderful! Update as all on your start so we can contribute! P.S: and happy birthday! Real-life story: my ex manager asked me once: Dude, I heard you're leaving office at 2am, are you also coding on your birthdays and Christmas? Maxim Maletsky www.PHPBeginner.com -Original Message- From: Jack Dempsey [mailto:[EMAIL PROTECTED]] Sent: giovedì 4 ottobre 2001 7.34 To: [EMAIL PROTECTED] Subject: RE: [PHP] php in css not working with IF's i'll start it...will be fun and i've got some coldfusion proponents i'd love to show it to...a little swamped with work though, and monday's my 21st, so i don't think i'll be doing much coding, but hey, its opensource, you do a lil, i do a lil, it'll be done in no time... jack -Original Message- From: Maxim Maletsky (PHPBeginner.com) [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 04, 2001 1:24 AM To: 'Rasmus Lerdorf' Cc: 'Jason Dulberg'; [EMAIL PROTECTED] Subject: RE: [PHP] php in css not working with IF's Do you want to do it? PHPBeginner.com and many other PHP sites would greatly appreciate it, Rasmus. Though, NOT and XOR are often unknown to beginners, I noticed it in their codes. Anyway, it is a great idea, I think. I see so many neo programmers confusing with it. Lots of PHP developers are coming from web development industry where they've often seen few other things but Macromedia. Obviously it takes them ages to get logical operators as it is rarely documented for very beginners level. For instance, my assistants at my previous job were categorically refusing looking onto manuals trying religiously to understand logicals from raw code samples. Maxim Maletsky www.PHPBeginner.com -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: giovedi 4 ottobre 2001 7.09 To: Maxim Maletsky (PHPBeginner.com) Cc: 'Jason Dulberg'; [EMAIL PROTECTED] Subject: RE: [PHP] php in css not working with IF's Would make a nice little PHP-GD exercise for someone to build a PHP app that took a boolean logical expression and produced a Venn diagram. Maybe limit it to 3 or less terms to not make your brain explode. -Rasmus On Thu, 4 Oct 2001, Maxim Maletsky (PHPBeginner.com) wrote: Thanks Rasmus. The link you provided will become a great resource for PHPBeginner.com Cheers! Maxim Maletsky www.PHPBeginner.com -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: giovedi 4 ottobre 2001 6.58 To: Jason Dulberg Cc: [EMAIL PROTECTED] Subject: RE: [PHP] php in css not working with IF's Theoretically, either/or I'm assuming. If A isn't 10 or A isn't 9... But since A cannot be both 9 and 10 at the same time, A will *always* not be one of them. It's exactly the same as saying: if (!(A==9 AND A==10)) Obviously A cannot be both 9 and 10 at the same time so the above will be: if(!(false)) which is the same as if(true) Some people find it helpful to draw Venn diagrams of their boolean logical expressions. See http://www.lib.csub.edu/infocomp/search/boolean/venn.htm for a simple description of those. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php in css not working with IF's
Thanks for sticking with me here and for your examples!! So basically, I need to use AND instead of OR. if (($site_style!==10) ($site_style!==9) ($site_style!==8)) { } elseif ($site_style==10) { } hrm... it didn't work. Sorry for being such a dope about this :( Jason Ok, you are clearly not following along here... ;) You have (let $site_style = A for brevity): if( A!=10 OR A!=9 OR A!=8 ) When A=10 this becomes: if( 10!=10 OR 10!=9 OR 10!=8 ) falsetrue true if( false OR true OR true ) is the same as if (true) Seriously, try drawing the Venn diagram for your expression. Or try substituting common english. if Jason is not 21 or Jason is not 20 or Jason is no 19 let him into the cool club. Say Jason is 21, is he allowed in? Sure he is, because one of the conditions for getting into the cool club is that Jason is not 20. It doesn't matter that one of the other conditions says to not let Jason in. If the people writing the rules wanted to force all the conditions to apply they would have written: if Jason is not 21 AND Jason is not 20 AND Jason is not 19, let him into the cool club. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php in css not working with IF's
have you thought about a switch statement? haven't looked at your code, but that would allow you a default, and then a bunch of cases, etc... jack -Original Message- From: Jason Dulberg [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 04, 2001 1:43 AM To: Rasmus Lerdorf Cc: [EMAIL PROTECTED] Subject: RE: [PHP] php in css not working with IF's Thanks for sticking with me here and for your examples!! So basically, I need to use AND instead of OR. if (($site_style!==10) ($site_style!==9) ($site_style!==8)) { } elseif ($site_style==10) { } hrm... it didn't work. Sorry for being such a dope about this :( Jason Ok, you are clearly not following along here... ;) You have (let $site_style = A for brevity): if( A!=10 OR A!=9 OR A!=8 ) When A=10 this becomes: if( 10!=10 OR 10!=9 OR 10!=8 ) falsetrue true if( false OR true OR true ) is the same as if (true) Seriously, try drawing the Venn diagram for your expression. Or try substituting common english. if Jason is not 21 or Jason is not 20 or Jason is no 19 let him into the cool club. Say Jason is 21, is he allowed in? Sure he is, because one of the conditions for getting into the cool club is that Jason is not 20. It doesn't matter that one of the other conditions says to not let Jason in. If the people writing the rules wanted to force all the conditions to apply they would have written: if Jason is not 21 AND Jason is not 20 AND Jason is not 19, let him into the cool club. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php in css not working with IF's
Ok. Wll show you with an example: if (($site_style!==10) ($site_style!==9) ($site_style!==8)) { } elseif ($site_style==10) { } Should simply be if($site_style != ('10' or '9' or '8')) {} Bla bla bla Maxim Maletsky www.PHPBeginner.com -Original Message- From: Maxim Maletsky (PHPBeginner.com) [mailto:[EMAIL PROTECTED]] Sent: giovedì 4 ottobre 2001 7.56 To: 'Jason Dulberg'; 'Rasmus Lerdorf' Cc: [EMAIL PROTECTED] Subject: RE: [PHP] php in css not working with IF's Jason, are not a dope As mentioned to you by Rasmus: just move those !== off the script replacing them with != That is what causes your error. Maxim Maletsky www.PHPBeginner.com -Original Message- From: Jason Dulberg [mailto:[EMAIL PROTECTED]] Sent: giovedì 4 ottobre 2001 7.43 To: Rasmus Lerdorf Cc: [EMAIL PROTECTED] Subject: RE: [PHP] php in css not working with IF's Thanks for sticking with me here and for your examples!! So basically, I need to use AND instead of OR. if (($site_style!==10) ($site_style!==9) ($site_style!==8)) { } elseif ($site_style==10) { } hrm... it didn't work. Sorry for being such a dope about this :( Jason Ok, you are clearly not following along here... ;) You have (let $site_style = A for brevity): if( A!=10 OR A!=9 OR A!=8 ) When A=10 this becomes: if( 10!=10 OR 10!=9 OR 10!=8 ) falsetrue true if( false OR true OR true ) is the same as if (true) Seriously, try drawing the Venn diagram for your expression. Or try substituting common english. if Jason is not 21 or Jason is not 20 or Jason is no 19 let him into the cool club. Say Jason is 21, is he allowed in? Sure he is, because one of the conditions for getting into the cool club is that Jason is not 20. It doesn't matter that one of the other conditions says to not let Jason in. If the people writing the rules wanted to force all the conditions to apply they would have written: if Jason is not 21 AND Jason is not 20 AND Jason is not 19, let him into the cool club. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php in css not working with IF's
On Thu, 4 Oct 2001 15:25, Maxim Maletsky \(PHPBeginner.com\) wrote: Jason, are not a dope As mentioned to you by Rasmus: just move those !== off the script replacing them with != That is what causes your error. Maxim Maletsky www.PHPBeginner.com No, that was Rasmus telling _me_ that they are valid! Rasmus told him his logic was flawed. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Sorrow looks back, worry looks around, faith looks up. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php in css not working with IF's
Ok. Wll show you with an example: if (($site_style!==10) ($site_style!==9) ($site_style!==8)) { } elseif ($site_style==10) { } Should simply be if($site_style != ('10' or '9' or '8')) {} Stop confusing the lad. That obviously won't work. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php in css not working with IF's
Maybe you can try simplifying your logic. Why don't you avoid nested IFs till later, and keep to simple IFs. If you want to check for $site_style not equal to 10 and also not equal to 9 then you can say ($site_style != 10 $site_style != 9) or even !($site_style == 10 || $site_style == 9) then later if you want to check for $site_style == 10 make a separate IF rather than use a elsif, just for ease of comprehension. -Naintara - Original Message - From: Jason Dulberg [EMAIL PROTECTED] To: Rasmus Lerdorf [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, October 04, 2001 11:12 AM Subject: RE: [PHP] php in css not working with IF's Thanks for sticking with me here and for your examples!! So basically, I need to use AND instead of OR. if (($site_style!==10) ($site_style!==9) ($site_style!==8)) { } elseif ($site_style==10) { } hrm... it didn't work. Sorry for being such a dope about this :( Jason Ok, you are clearly not following along here... ;) You have (let $site_style = A for brevity): if( A!=10 OR A!=9 OR A!=8 ) When A=10 this becomes: if( 10!=10 OR 10!=9 OR 10!=8 ) falsetrue true if( false OR true OR true ) is the same as if (true) Seriously, try drawing the Venn diagram for your expression. Or try substituting common english. if Jason is not 21 or Jason is not 20 or Jason is no 19 let him into the cool club. Say Jason is 21, is he allowed in? Sure he is, because one of the conditions for getting into the cool club is that Jason is not 20. It doesn't matter that one of the other conditions says to not let Jason in. If the people writing the rules wanted to force all the conditions to apply they would have written: if Jason is not 21 AND Jason is not 20 AND Jason is not 19, let him into the cool club. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]