I’m not sure why this bit is failing
[php]$san_label = mysql_real_escape_string(strtolower($_POST[‘label’]));
$flabel = mysql_query(“SELECT label FROM venzo_clients WHERE label = ‘$san_label’”) or die(mysql_error());
$badLabels = array('unknown','unknwn','unkn','ukn','indie','unsigned','independent','indie label','n/a','unsigned artist','artist','not available','none','none available','independent label','label','non','-','_','not signed', 'no signed', 'signed', 'nosigned', 'ns');
if(!empty($_POST[‘label’])) {
if(mysql_num_rows($flabel) > 0) {
$err['badlabel'] = "Label is in use";
}
if(in_array($san_label, $badLabels)) {
$err['badlabel'] = "Invalid label name";
}
// more code below here
}[/php]
Basically, I have 2 searches going on, the top one uses a query to search existing labels and one that uses an array of invalid labels. Its the second one that’s failing.
At the bottom, I use an if statement to test for $err, and I’m thinking that maybe why its failing - if(!$err) {…}
I can’t get it to fail, but I know it is because when someone registers, it sends out an email to me and the client, and the label is one from the bad label array, in this case it was independent. I’m loosing the last of my marbles trying to figure this out, hopefully someone can shed some light.