Answered Questions

  • how we know browser properties

    Star Read Best Answer

    Editorial / Best Answer

    bicu  

    • Member Since Sep-2005 | Mar 3rd, 2006


    get_browser() attempts to determine the capabilities of the user's browser. This is done by looking up the browser's information in the browscap.ini file.

    echo $_SERVER['HTTP_USER_AGENT'] . "<hr />\n";

    $browser = get_browser
    ();

    foreach (
    $browser as $name => $value
    ) {
        echo
    "<b>$name</b> $value <br />\n"
    ;
    }

    naveen gautam

    • Dec 24th, 2011

    $_SERVER[HTTP_USER_AGENT]; by this method we can know the properties of browser.

    abc

    • Sep 12th, 2011

    Code
    1. echo $_SERVER['HTTP_USER_AGENT'] . "
    2. ";

  • What is difference between require_once(), require(), include().Becouse above three function usely use to call a file in another file.

    Star Read Best Answer

    Editorial / Best Answer

    bicu  

    • Member Since Sep-2005 | Feb 4th, 2006


    Difference between require() and require_once():  require() includes and evaluates a specific file, while require_once() does that only if it has not been included before (on the same page).
    So, require_once() is recommended to use when you want to include a file where you have a lot of functions for example. This way you make sure you don't include the file more times and you will not get the "function re-declared" error.

    Difference between require() and include() is that require() produces a FATAL ERROR if the file you want to include is not found, while include() only produces a WARNING.

    There is also include_once() which is the same as include(), but the difference between them is the same as the difference between require() and require_once().

    aditya dhanraj

    • Apr 29th, 2015

    Require_once():-using this function we can access the data of another page once i. e we can not access the same page multiple times.

    require():-using this function we can access the data of another page at the desire page multiple times i.e we can access the contents of same page multiple times.

    LAILA NISHI

    • Feb 21st, 2015

    Include() and require() dose same work.The difference is on error cheeking .Require () gives a fatal error when file cant load whereas include() gives a warning and continue to execute.

  • How to use email validation in Java script.Like User can't enter invalid email address?

    Star Read Best Answer

    Editorial / Best Answer

    bicu  

    • Member Since Sep-2005 | Feb 2nd, 2006


    First of all, here is the javascript function that tests if an email address is valid.
    It checks for a lot of things: to see if the email contains a "@" sign and a dot, checks to see if the @ is before the dot, and so on.

    <script>
    function isMail(str)
    {
       var at="@";
       var dot=".";
       var lat=str.indexOf(at);
       var lstr=str.length;
       var ldot=str.indexOf(dot);
       if (str.indexOf(at)==-1) return false;
       if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr) return false;
       if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr) return false;
       if (str.indexOf(at,(lat+1))!=-1) return false; if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot) return false;
       if (str.indexOf(dot,(lat+2))==-1) return false;
       if (str.indexOf(" ")!=-1) return false;
       return true;
    }

    // the next function will be used to validate the form. I made this as a separate function because you might want to validate more fields.
    function validate_form()
    {
       if (!isMail(document.form1.mail.value))
       {
          alert("Please enter a valid email address");
          document.form1.mail.focus();
          return false;
       }
       // if the value entered is not a valid email address, 
       // we show a message, focus on the field and return false.
       // returning false will make sure the form is not submitted

       // if we got here, it means the email address is valid
       return true;
       // return true means that the form is submitted.
    }

    </script>

    After placing this function in the code, here is what you need to put in the form.

    Let's say the form only has the email address and a submit button.

    <form action="/" method="post" onsubmit="return validate_form()" name="form1">
    <input type="text" name="email" value="">
    <input type="submit" name="submit_button" value="continue">
    </form>

  • What are the different frameworks available In AJAX?

    bob

    • Aug 10th, 2006

    There are so many - a good question  as anyone who starts developing with ajax invariably has to look at some of the frameworks http://ajaxpatterns.org/wiki/index.php?title=AJAXFrameworks

    Amit Sharma

    • Apr 28th, 2006

    Prototype.JS Framework is available with detailed documentation, its very easy to handle AJAX and JavaScript, Introduce $ concept its very simple, For Ajax specially u don't need to check cross broswer, OPen, Close and error handling through traditional AJAX.

  • hello sir,i am in 8th semester of computer engineering.with 69 aggregate till 7th sem.i want to do job with the best affort.please suggest me..right now i m doing project training as 8th sem.in IITB.

    gony

    • Jan 29th, 2006

    Hi,  With IITB tag and due to increasing demand in the industry you must be already having offers in hand from the companies visited your campus. When it comes to choosing the company , I feel yo...

  • Tech Tutorials and Articles - Get paid $5 each

    Hello All,  We are looking for Tech related articles and tutorials for our sites.  If you are interested in writing them in your free time, please send them using contact link from the site.Articles and tutorials must be original and not copied from any books or websites.  We run copyscrape on the article to find it's originality.  After the article is approved, you can choose the...

    GeekAdmin

    • Apr 9th, 2006

    Hello Manu,  We had sent mail to you few weeks ago.. not sure if it's ended in SPAM box.  We did not get any articles.. where did you submit.... ?.  Please reply to the email I will be sending. today.  Thanks Admin

  • Top Ten Tips for Bug Tracking

    A good tester will always try to reduce the repro steps to the minimal steps to reproduce; this is extremely helpful for the programmer who has to find the bug. Remember that the only person who can close a bug is the person who opened it in the first place. Anyone can resolve it, but only the person who saw the bug can really be sure that what they saw is fixed. There are many ways to resolve a bug....

    kurtz182

    • Dec 30th, 2009

    Top twelve tips for initial bug reporting:1) Ensure you can reproduce the defect before entering defect report2) Ensure there are no duplicates before entering defect report3) Include all relevant det...