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 5 of 5

Thread: php

  1. #1
    New Coder
    Join Date
    Apr 2011
    Location
    Mumbai
    Posts
    19
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Smile php

    I have an function in error-status.php like this


    function validateHostName($hostName)
    {
    if((strpbrk($hostName,'`~!@#$^&*()=+.[ ]{}\\|;:\'",<>/?')==FALSE) &&

    !ctype_digit($hostName) && eregi("^([a-z0-9-]+)$",$hostName) &&

    ereg("^[^-]",$hostName) && ereg("[^-]$",$hostName))
    {
    return true;
    }
    else
    return false;
    }

    now i want to cal this function in my other page which is datetime.php how it is

    posible plz plz help me its serious

    if($addntp=="")
    {
    seterror("0:|: :|: Add NTP server");

    //$error_text="NTP server already

    added"."\n"."Exiting ...";
    //AddLog("timeconfig.php",$error_text,ERR_INFO);

    header("Location: datetime.php");
    exit;
    }
    Last edited by harry343; 04-27-2011 at 12:12 PM. Reason: modify

  • #2
    Banned
    Join Date
    Feb 2011
    Posts
    2,699
    Thanks
    13
    Thanked 395 Times in 395 Posts
    Did you write that code or did you copy it from somewhere?

    The reason I ask is because you are using eregi which is deprecated - you can use preg_match instead.

  • #3
    New Coder
    Join Date
    Apr 2011
    Location
    Mumbai
    Posts
    19
    Thanks
    10
    Thanked 0 Times in 0 Posts
    bro i want reply so plz reply my ans

  • #4
    Banned
    Join Date
    Feb 2011
    Posts
    2,699
    Thanks
    13
    Thanked 395 Times in 395 Posts
    from the php manual about eregi

    WarningThis function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.

  • #5
    New Coder
    Join Date
    Apr 2011
    Location
    Mumbai
    Posts
    19
    Thanks
    10
    Thanked 0 Times in 0 Posts
    kkk bro just forget all things in php i only want to cal this function


  •  

    Posting Permissions

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