Jump to content

end of string help


MDanz

Recommended Posts

can't seem to get this working.

 

I put the variable $info as test.jpg

 

$arr = array('jpg', 'bmp', 'gif', 'png' /* ... */);
			$check = pathinfo($info, PATHINFO_EXTENSION);
			if(in_array($check['extension'], $arr)){

			$query = "INSERT INTO Stacks";
				  $query .= "(`username`,`image`,`reply`,`number`,`ip`,`origin`,`keywords`,`avatar`,`Positive`,`Negative`) VALUES ('$usernames','$reply','$reply $info','$id','$ip',$org+1,'$keywords','$avatarreply','$pos1','$neg1')";
				  $results = mysql_query($query, $dlink);

echo "worked";
			} else {
				  
				  
				   $query = "INSERT INTO Stacks";
				  $query .= "(`username`,`reply`,`number`,`ip`,`origin`,`keywords`,`avatar`,`Positive`,`Negative`) VALUES ('$usernames','$reply $info','$id','$ip',$org+1,'$keywords','$avatarreply','$pos1','$neg1')";
				  $results = mysql_query($query, $dlink);

echo "didn't work";
				  }

 

 

it should echo didn't work..

Link to comment
https://forums.phpfreaks.com/topic/204144-end-of-string-help/#findComment-1069233
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.