Submitted Questions

  • what is difference between mysql_fetch_array(),mysql_fetch_row() and mysql_fetch_object()please insert with example

    archit attrey

    • Dec 27th, 2017

    when we use mysql_fetch_array so in this condition we should pass value through an index or in the associative array through name instead of index. mysql_fetch_row only for a particular row. and mysq...

    SUBHASISH MANDAL

    • Jun 29th, 2016

    Sir, Actually mysqli_fetch_array() and row() in both cases I can use echo $rwo[0] or $row[name] to retrieve data from database, thats why I could not get exactly difference between these.

  • how to make a download page in own site, which i can know that how many file has been loaded by particular user or particular ipaddress

    Rahul Thipse

    • Oct 31st, 2006

    Here is code // Give actually File_name1 path from remote server header("Content-Disposition: attachment; filename=".$file_name1); header("Content-type: application/octet-stream"); readfile($file_path1);FromRahul Thipse

    Kiran

    • Sep 15th, 2006

    We can log the IP addresses in one database table while downloading the file. This way we can count and check the no. of rows inserted for a particular download.

  • how i can make a chat page in php in simple

    Archana Jayaseelan

    • Feb 7th, 2007

    First, establish a simple socket connection. If in UNIX/LINUX, use AF_INIX.function get_the_host($host,$path) { // open the host $fp = fsockopen($host, 80, &$errno, &$errstr,...

    Prasanna

    • Jul 10th, 2006

    First of all we have to make one .txt file ...then open it in write mode then write something in messsage box that will written in that file ...the another user also open that file and write the file ...

  • what is differenc between mysql_connect and mysql_pconnect

    manas ranjan dikhit

    • May 31st, 2007

    Mysql_connect  establish a new connection every time when it connect to database but mysql_pconnect first searches if there is pre-existing connection or not. if it found connection then it make use of that connection to databases.

  • how i will check that user is, logged in or not. i want to make it a function and i want to use in each page and after login i want to go in current page(same page. where i was working)

    abc

    • Sep 12th, 2011

    For this we can use the session objec($_SESSION)t. When the user login with his/ her user name and password, usually we check those to ensure for correctness. If that user name and password are valid ...

  • 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>