View Full Version : modify this

02-07-2006, 08:11 PM
Hello friends. :cool:

I want to modify this

if (trim($artist)=='' || strlen(trim($artist)) > 30 || ereg('[^[:space:]a-zA-Z0-9_.-]{1,}', $artist)) {
$error_msg.="<li>Please enter a <strong>Artist/Band Name </strong>max 30 max char long No special characters</li>";

// display error message if any, if not, proceed to other processing
echo "<script type=\"text/javascript\">window.location=\"uploadT.php\"</script>";
} else {
$valid_error = "<ol><font color=red>$error_msg</font></ol>";

This is OK?

if($error_msg > 1){
$valid_error = "<ol><font color=red>$error_msg</font></ol>";
} else {


ralph l mayo
02-07-2006, 09:56 PM

$error_msg is a non-numeric string message, right? So what sense is there in comparing it to 1? Do you mean to check its length maybe (if (strlen($error_msg) > 1)? Or if it's set to anything? ('anything' in the sense of 'not nothing', $error_msg != '')

02-07-2006, 10:17 PM
$error_msg=='' this means that there are no errors

$error_msg != '' That means that there are some errors...... Right?:thumbsup:

Thnx Friend

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum