Loading ...
Sorry, an error occurred while loading the content.
 

doubt using php postgres and ajax

Expand Messages
  • san krishnan
    hello guies i am using ajax in php , u may all heard about this ajax which is asynchronous javascript and xml concept where using this we can paopulated data
    Message 1 of 5 , Dec 1, 2005
      hello guies
       
       i am using ajax in php , u may all heard about this ajax which is asynchronous javascript and xml concept where using this we can paopulated data in to combox without reloading the page ,
        so i am using it with php and postgres and i am getting an error unknown respone from the server , does any one have made it working post me  or give me suggestions
       
      with kind regards
      santhana krishnan.v
      NIC programmer
      chennai


      Enjoy this Diwali with Y! India Click here
    • Gobinath M
      Y dont you check this http://gobinath.users.phpclasses.org/browse/package/2053.html ... -- ______________oOO_(_)_OOo_________________ Yahoo :
      Message 2 of 5 , Dec 1, 2005
        Y dont you check this http://gobinath.users.phpclasses.org/browse/package/2053.html

        On 12/2/05, san krishnan <salaikrishnan@...> wrote:
        hello guies
         
         i am using ajax in php , u may all heard about this ajax which is asynchronous javascript and xml concept where using this we can paopulated data in to combox without reloading the page ,
          so i am using it with php and postgres and i am getting an error unknown respone from the server , does any one have made it working post me  or give me suggestions
         
        with kind regards
        santhana krishnan.v
        NIC programmer
        chennai


        Enjoy this Diwali with Y! India Click here

        SPONSORED LINKS
        Design patent Design school Design schools
        Design auto dealer web site Product design Network design


        YAHOO! GROUPS LINKS






        --
                          
        ______________oOO_(_)_OOo_________________

        Yahoo :  gobinathm@...
        AOL    :  gobinath2k4
        ICQ     :  237-267-288
        Skype :  gobinathm
        MSN   :  gobinathm@...

        HomePage : http://www.gobinath.com
        Me @ 360  : http://360.yahoo.com/gobinathm

        "No person deserves your tears, and who deserves them won't make you cry."


        Engineers normally have problem with every solution. If not they have  a solution in search of a problem.
      • Rochak Chauhan
        Sure.. could you post the javascrit code for AJAX ?? only then I maight be able to help you
        Message 3 of 5 , Dec 18, 2005
          Sure.. could you post the javascrit code for AJAX ?? only then I
          maight be able to help you
        • san krishnan
          sir my name is santhana krishnan , currently i am also having problem with ajax and postgres , i have tried but it is giving and error namely ajax server
          Message 4 of 5 , Dec 18, 2005
            sir
             
                my name is santhana krishnan , currently i am also having problem with ajax and postgres ,  i have tried but it is giving and error namely ajax server error can u solve me, please help sir , thks in advance
             
             
            with this i paste my three files  i am using
             
            ajaxregister.php
             
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
            <html>
            <head>
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
            <title>Untitled Document</title>
            <?php
            require_once('common.php');
            $ajax=getAjaxObject();
            $ajaxClient=$ajax->getClient();
            ?>
            <script type="text/javascript" src="javascript/json.js"></script>
            <script type="text/javascript" src="javascript/ajax.js"></script>
            <script type="text/javascript">
            <?php echo $ajaxClient->getJavaScript(); ?>
            function displayStates(result)
            {
            document.forms[0].state.options.length=0;
            for(var i=0;i<result.length;i++)
             document.forms[0].state.options[i]=new Option(result[i]["name"],result[i]["value"]);
             }
             </script>
            </head>
            <body>
            <form method="post" action="register.php">
            <select name="country" onChange="x_Register.getdistricts(this.options[this.options.selectedIndex].value,displayStates);">
            <?php
            $countries=Register::getStates();
            for($i=0;$i<count($countries);$i++)
            print("<option value='".$countries[$i]["state_code"]."'>".$countries[$i]["state_name"]."</option>");
            ?>
            </select>
            <select name="state">
            </select>
            </form>
            </body>
            </html>
            ==========================
            common.php
             
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
            <html>
            <head>
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
            <title>Untitled Document</title>
            </head>
            <body>
            <?php
            require_once('php/Ajax.php');
            class Register
            {
            public static $conn;
            public static function getStates()
            {
            $query="SELECT state_code,state_name FROM m_state";
            $rs=pg_query(self::$conn,$query);
            $result=array();
            $i=0;
            while($row=pg_fetch_array($rs))
            {
            $result[$i++]=$row;
            }
            return $result;
            }
            public static function getdistricts($country)
            {
            $query="SELECT dcode,dname FROM m_district where state_code=".$country."order by dname";
            $rs=pg_query(self::$conn,$query);
            $result=array();
            $i=0;
            while($row=pg_fetch_array($rs))
            {
            $result[$i++]=$row;
            }
            return $result;
            }
            }
            REGISTER::$conn=pg_connect("host=10.163.2.95 port=5432 dbname=priasoft user=postgres password=postgres");
            function getAjaxObject()
            {
            $ajax=new Ajax();
            $ajax->registerMethod("Register","getdistricts");
            $ajax->setOption( Ajax::HandlerOption, 'server.php' );
            return $ajax;
            }
            ?>
            </body>
            </html>
             
            ================================
            server.php
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
            <html>
            <head>
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
            <title>Untitled Document</title>
            </head>
            <body>
            <?php
            require_once('common.php');
            $ajax=getAjaxObject();
            $ajaxServer=$ajax->getServer();
            if ( $ajaxServer->isRequest() )
               {
                  echo $ajaxServer->handleRequest();
               }
            ?>

            </body>
            </html>
             
            please help me solve the problem sir

            with kind regards
            santhana krishnan

            Rochak Chauhan <rochakchauhan@...> wrote:
            Sure.. could you post the javascrit code for AJAX ?? only then I
            maight be able to help you




            Send instant messages to your online friends http://in.messenger.yahoo.com

          • Rochak Chauhan
            Please try my example AJAX+PHP It will help you get the basic idea. If you still have any problem, let me know. AJAX FILE UPLOADER
            Message 5 of 5 , Dec 22, 2005
              Please try my example AJAX+PHP It will help you get
              the basic idea.
              If you still have any problem, let me know.

              AJAX FILE UPLOADER
              http://www.phpclasses.org/browse/package/2759.html


              SIMPLE AJAX EXAMPLE
              http://www.phpclasses.org/browse/package/2718.html


              Best regards,
              Rochak.

              Alt Email: webmaster@...

              Home Page: www.geocities.com/heymailrock



              __________________________________________
              Yahoo! DSL – Something to write home about.
              Just $16.99/mo. or less.
              dsl.yahoo.com
            Your message has been successfully submitted and would be delivered to recipients shortly.