"Method POST not allowed" error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • burut
    New Member
    • Dec 2006
    • 6

    #1

    "Method POST not allowed" error

    Hi,

    I have index.php page (attached). The flow is when I put username/password on the page, it will submit to be processed by connection.php where in connection.php, it require koneksi_db.php to connect to the Oracle database (Oracle 9i).

    In fact, it raises error saying that "The requested method POST is not allowed for the URL /lekom_maras/connection.php" .

    Does anybody can help me :

    1. Telling me why it happens ?? Telling me how to handle this problem ?

    2. I am using the webpage to access to Oracle database. What is the requirement to make it happen ??

    PS: index.php, koneksi_db.php and connection.php files are zipped and attached.


    Rgds
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Attached where?

    Ronald :cool:

    Comment

    • burut
      New Member
      • Dec 2006
      • 6

      #3
      index.php

      [PHP]<?
      session_start() ;
      session_destroy ();
      session_start() ;
      ?>
      <html>
      <head>
      <title>:: Login User | PT Pertaminax - Lekom Maras ::</title>
      <link href="style.css " rel="stylesheet " type="text/css">
      <style type="text/css">
      <!--
      .style20 {color: #95A5BB}
      -->
      </style>
      </head>
      <body bgcolor="#BAC4D 2">
      <div align="center">
      <p>
      <SCRIPT>
      function openmenu( windowURL, windowName, windowFeatures ) {
      return window.open( windowURL, windowName, windowFeatures ) ;
      }
      </SCRIPT>
      </p>

      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <table border="0" cellpadding="0" cellspacing="0" width="850">
      <!-- fwtable fwsrc="head_log in.png" fwbase="head_lo gin.jpg" fwstyle="Dreamw eaver" fwdocid = "1273056341 " fwnested="0" -->
      <tr>
      <td><img src="images/spacer.gif" width="15" height="1" border="0" alt=""></td>
      <td><img src="images/spacer.gif" width="236" height="1" border="0" alt=""></td>
      <td><img src="images/spacer.gif" width="347" height="1" border="0" alt=""></td>
      <td><img src="images/spacer.gif" width="236" height="1" border="0" alt=""></td>
      <td><img src="images/spacer.gif" width="16" height="1" border="0" alt=""></td>
      <td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
      </tr>
      <tr>
      <td><img name="head_logi n_r1_c1" src="images/head_login_r1_c 1.jpg" width="15" height="100" border="0" alt=""></td>
      <td><img name="head_logi n_r1_c2" src="images/head_login_r1_c 2.jpg" width="236" height="100" border="0" alt=""></td>
      <td><img name="head_logi n_r1_c3" src="images/head_login_r1_c 3.jpg" width="347" height="100" border="0" alt=""></td>
      <td><img name="head_logi n_r1_c4" src="images/head_login_r1_c 4.jpg" width="236" height="100" border="0" alt=""></td>
      <td><img name="head_logi n_r1_c5" src="images/head_login_r1_c 5.jpg" width="16" height="100" border="0" alt=""></td>
      <td><img src="images/spacer.gif" width="1" height="100" border="0" alt=""></td>
      </tr>
      </table>
      <br>
      <? echo date("D, d M Y"); ?> <br>
      <br>
      <table id="Table_01" width="851" height="154" border="0" cellpadding="0" cellspacing="0" >
      <tr>
      <td width="23"> <img src="images/login2_01.gif" width="23" height="22" alt=""></td>
      <td width="806" background="ima ges/login2_02.gif"> &nbsp; </td>
      <td width="22"> <img src="images/login2_03.gif" width="22" height="22" alt=""></td>
      </tr>
      <tr>
      <td height="112" background="ima ges/login2_04.gif"> &nbsp;
      </td>
      <td bgcolor="A5B3C6 "><table width="100%" height="112" border="0" align="center" cellpadding="0" cellspacing="0" >
      <tr>

      <td width="68%" valign="bottom" >
      <? //method="POST" action="connect ion.php" enctype="multip art/form-data"?>
      <form name="form1" method="POST" action="http://localhost/connection.php" enctype="multip art/form-data">
      <table width="36%" border="0" align="center" cellpadding="2" cellspacing="0" >
      <tr>
      <td><div align="center"> </div></td>
      <td><span class="style18" >LOGIN</span></td>
      </tr>
      <tr>
      <td width="33%"><st rong>Username
      :</strong></td>
      <td width="67%"><in put type="text" name="username" size="27" class="tabel1"> </td>
      </tr>
      <tr>
      <td><strong>Pas sword
      :</strong></td>
      <td><input type="password" name="password" size="27" class="tabel1"> </td>
      </tr>
      <tr>
      <td height="22"><st rong>Access :</strong></td>
      <td><select name="priv" id="priv" class="tabell">
      <option value="1" selected>Admin</option>
      <option value="2">User</option>
      <option value="3">User Rig</option>
      </select></td>
      </tr>
      <tr>
      <td height="26">&nb sp;</td>
      <td><input type="submit" value="Submit" name="B1" class="button1" ></td>
      </tr>
      </table>
      </form></td>
      </tr>
      </table> </td>
      <td background="ima ges/login2_06.gif"> &nbsp; </td>
      </tr>
      <tr>
      <td height="19"> <img src="images/login2_07.gif" width="23" height="19" alt=""></td>
      <td background="ima ges/login2_08.gif"> &nbsp; </td>
      <td> <img src="images/login2_09.gif" width="22" height="19" alt=""></td>
      </tr>
      </table>

      </div>
      <div align="center">
      <p>
      <span class="style20" >&copy; 2005-2006, Peertamina - Lekom Maras Allright Reserved</span><br>
      </p>
      </div>
      </body>
      </html>[/PHP]

      Comment

      • burut
        New Member
        • Dec 2006
        • 6

        #4
        connection.php

        [PHP]<html>
        <head><title> PT PERTAMINA hex hex - LEKOM MARAS</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
        <!--
        body {
        background-image: url();
        }
        -->
        </style></head>
        <body bgcolor="#BAC4D 2">
        <?
        require_once ("module/koneksi_db.php" );
        session_start() ;
        $user_ses=$_POS T['username'];
        $pass_ses=$_POS T['password'];
        $acc_ses=$_POST['priv'];
        ?>
        <SCRIPT>
        function openmenu( windowURL, windowName, windowFeatures ) {
        return window.open( windowURL, windowName, windowFeatures ) ;
        }
        </SCRIPT>
        <?
        if($conn) {

        $sqlstr="select * from T_USER where USERNAME='$user _ses' and PASSWORD='$pass _ses' and PRIV='$acc_ses' ";
        $sql=OCIParse($ conn, $sqlstr);
        OCIExecute($sql );
        $jmlbrs = OCIFetch($sql);

        if ($jmlbrs==1)
        {
        if ($acc_ses=="1")
        {
        $id_ses=OCIResu lt($sql, "USER_ID");
        session_registe r('id_ses');
        session_registe r('user_ses');
        session_registe r('pass_ses');
        session_registe r('acc_ses');
        ?>
        <script>openmen u('leftmenu.php ', 'Title', 'width=231,heig ht=710,left=0,t oolbar=0,locati on=0,directorie s=0,status=0,me nubar=0,scrollb ars=0,resizable =0' ); //window.close(); </script>
        <?
        ?>
        <script>//window.close()</script>
        <?
        }
        else
        if ($acc_ses=="2")
        {
        $id_ses=OCIResu lt($sql, "USER_ID");
        session_registe r('id_ses');
        session_registe r('user_ses');
        session_registe r('pass_ses');
        session_registe r('acc_ses');
        ?>
        <script>openmen u('leftmenu_use r.php', 'Title', 'width=231,heig ht=710,left=0,t oolbar=0,locati on=0,directorie s=0,status=0,me nubar=0,scrollb ars=0,resizable =0' ); //window.close(); </script>
        <?
        ?>
        <script>//window.close()</script>
        <?
        }
        else
        {
        $id_ses=OCIResu lt($sql, "USER_ID");
        session_registe r('id_ses');
        session_registe r('user_ses');
        session_registe r('pass_ses');
        session_registe r('acc_ses');
        ?>
        <script>openmen u('leftmenu_rig .php', 'Title', 'width=231,heig ht=710,left=0,t oolbar=0,locati on=0,directorie s=0,status=0,me nubar=0,scrollb ars=0,resizable =0' ); ///window.close(); </script>
        <?
        ?>
        <script>window. close()</script>
        <?
        }
        }
        else
        {
        header ("Location:inde x_wrong.php");
        }
        }
        ?>
        <br>

        </body>
        </html>[/PHP]

        Comment

        • burut
          New Member
          • Dec 2006
          • 6

          #5
          koneksi_db.php

          [PHP]<?
          $conn=OCILogon( "adminlm","l3k0 m4r4s","dblm");
          ?>[/PHP]

          Comment

          • Draicone
            New Member
            • Dec 2006
            • 2

            #6
            Sounds like this is an Apache error, not a script error. Check the php documentation for input methods.

            Comment

            • burut
              New Member
              • Dec 2006
              • 6

              #7
              what kind of apache error that possibly cause it ?

              Is something error in the conf file ?? or any module that isn't installed yet ??

              Comment

              • theRamones
                New Member
                • Nov 2006
                • 13

                #8
                on which .php file that returns post error ("Method POST not allowed")

                Comment

                • burut
                  New Member
                  • Dec 2006
                  • 6

                  #9
                  when I put username/passwd on index.php page, then I click submit....then the next page shows the "Method POST not allowed" error.

                  Comment

                  Working...