Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: modify this

  1. #1
    New Coder
    Join Date
    Nov 2005
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    modify this

    Hello friends.

    I want to modify this

    PHP Code:
    if(isset($Submit)){
        
    $error_msg='';
        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
        
    if($error_msg==''){
            echo 
    "<script type=\"text/javascript\">window.location=\"uploadT.php\"</script>";
        } else {
             
    $valid_error "<ol><font color=red>$error_msg</font></ol>";
        }



    This is OK?

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

  • #2
    Regular Coder ralph l mayo's Avatar
    Join Date
    Nov 2005
    Posts
    951
    Thanks
    1
    Thanked 31 Times in 29 Posts
    what

    $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 != '')

  • #3
    New Coder
    Join Date
    Nov 2005
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thnx

    $error_msg=='' this means that there are no errors

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


    Thnx Friend


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •