Why can't i do this in a control structure

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Little Spy
Forum Commoner
Posts: 31
Joined: Thu Oct 10, 2002 8:18 pm
Contact:

Why can't i do this in a control structure

Post by Little Spy »

Code: Select all

elseif ($HTTP_GET_VARSї'sn'] == FALSE) || ($HTTP_GET_VARSї'sn'] == "HTTP://") {
      die("Could Not Get ScreenName");
   }
this gives me an error why?
rev
Forum Commoner
Posts: 52
Joined: Wed Oct 02, 2002 3:58 pm
Location: Atlanta, GA

Re: Why can't i do this in a control structure

Post by rev »

Little Spy wrote:

Code: Select all

elseif ($HTTP_GET_VARSї'sn'] == FALSE) || ($HTTP_GET_VARSї'sn'] == "HTTP://") {
      die("Could Not Get ScreenName");
   }
this gives me an error why?
Your use of parenthesis and encapsulating your test is not syntactically sound. The edit below should work.

Code: Select all

<?php
if($blah) {
	//something
} elseif (($HTTP_GET_VARSї'sn'] == FALSE) || ($HTTP_GET_VARSї'sn'] == "HTTP://")) {
	die("Could Not Get ScreenName");
}
?>
Last edited by rev on Mon Oct 14, 2002 1:07 pm, edited 1 time in total.
Coco
Forum Contributor
Posts: 339
Joined: Sat Sep 07, 2002 5:28 am
Location: Leeds, UK
Contact:

Post by Coco »

and the opening one
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

Basically, you can't do

Code: Select all

if () || () { }
you have to do:

Code: Select all

if ( () || () ) { }
statements like that can only have one set of parenthesis between the if and the { }
Post Reply