Member Avatar for TechySafi

Hi guys! How you doing? Well I'm having a little headache...here is it :D

$emaillist=mysql_result($checkemail, 0);
				print_r ($pieces = explode(",", $emaillist)); //printing values for debugging
							$useremail_array=mysql_fetch_array($useremail_query);
				extract($useremail_array);
				print_r ($user_em); //for debugging
				if(in_array('$user_em',$pieces))
				{
				?>
                <div class="discussposttext">
            
      			<form action="more.php?id=<?php echo $id; ?>" method="post" id="jstest">
                In reply to ID:<input type="text" name="inreplyto" />
            <textarea class="big2" id="postcomment" name="postcomment"></textarea> &nbsp;<input type="submit" name="submitcomment" value="Comment" />
            </form>
      		</div>
				<?php 
				}
					else
					{
						?>

      		<div class="discussposttext">
            Sorry! Settings says only group memebers are allowed to participate!
      		</div>
			<?php } 
						
			?>

Now see the output

Array ( [0] => xyz@gmail.com [1] => rty@gmail.com ) //output of $pieces
xyz@gmail.com //output of $user_em
Sorry! Settings says only group memebers are allowed to participate! //output of boolean

lol I'm sure somewhere I'v been complete stupid because you can see xyz@gmail.com exists in the array but boolean returning false :?!

Recommended Answers

All 2 Replies

try without single quote.

in_array($user_em,$pieces)
Member Avatar for TechySafi

what I can say?? Just LOL!

Thanks mate :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.