WordPress.org

Ready to get started?Download WordPress

Forums

Problem with sql when I want to GET and POST (1 post)

  1. ciosub
    Member
    Posted 5 years ago #

    Hy,
    First I want to say that I am new in wordpress. So , untill now I made My own php solutions, but wordpress semms to be the most complete one and secure. My problem is the next one :
    I have a website made on my workplace. It`s an Intranet one.
    I have a contact form inserted in html code of one of my page :

    <form id="orar" style="margin:0px" action="send.php" method="post">
    <table border="0" width="559" align="center">
    <tbody>
    <tr>
    <td width="369"><textarea cols="30" rows="5" name="comment">Orar 15 - 21 Septembrie.</textarea></td>
    <td width="386">
    <table border="0">
    <tbody>
    <tr>
    <td>Luni</td>
    <td><select name="luni"> <option selected="selected">OFF</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> <option>11</option> <option>12</option> <option>13</option> <option>14</option> <option>15</option> <option>16</option> <option>17</option> <option>18</option> <option>19</option> <option>CO</option> <option>CFS</option> <option>CM</option> </select></td>
    </tr>
    <tr>
    <td>Marti</td>
    <td><select name="marti"> <option selected="selected">OFF</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> <option>11</option> <option>12</option> <option>13</option> <option>14</option> <option>15</option> <option>16</option> <option>17</option> <option>18</option> <option>19</option> <option>CO</option> <option>CFS</option> <option>CM</option> </select></td>
    </tr>
    <tr>
    <td>Miercuri</td>
    <td><select name="miercuri"> <option selected="selected">OFF</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> <option>11</option> <option>12</option> <option>13</option> <option>14</option> <option>15</option> <option>16</option> <option>17</option> <option>18</option> <option>19</option> <option>CO</option> <option>CFS</option> <option>CM</option> </select></td>
    </tr>
    <tr>
    <td>Joi</td>
    <td><select name="joi"> <option selected="selected">OFF</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> <option>11</option> <option>12</option> <option>13</option> <option>14</option> <option>15</option> <option>16</option> <option>17</option> <option>18</option> <option>19</option> <option>CO</option> <option>CFS</option> <option>CM</option> </select></td>
    </tr>
    <tr>
    <td>Vineri</td>
    <td><select name="vineri"> <option selected="selected">OFF</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> <option>11</option> <option>12</option> <option>13</option> <option>14</option> <option>15</option> <option>16</option> <option>17</option> <option>18</option> <option>19</option> <option>CO</option> <option>CFS</option> <option>CM</option> </select></td>
    </tr>
    <tr>
    <td>Sambata</td>
    <td><select name="sambata"> <option selected="selected">OFF</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> <option>11</option> <option>12</option> <option>13</option> <option>14</option> <option>15</option> <option>16</option> <option>17</option> <option>18</option> <option>19</option> <option>CO</option> <option>CFS</option> <option>CM</option> </select></td>
    </tr>
    <tr>
    <td>Duminica</td>
    <td><select name="duminica"> <option selected="selected">OFF</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> <option>11</option> <option>12</option> <option>13</option> <option>14</option> <option>15</option> <option>16</option> <option>17</option> <option>18</option> <option>19</option> <option>CO</option> <option>CFS</option> <option>CM</option> </select></td>
    </tr>
    </tbody></table>
    </td>
    </tr>
    </tbody></table>
    <input name="submit" type="submit" value="Trimite" /> </form>

    What I am looking for is the page who make the get and post in sql.
    I mean that when an user (becouse my page is under individual user and password for each member) push submit button, the page is loking for "send.php" page and it should make an update in sql.
    The page "send.php" is my problem.
    I make something like this

    <?

    $sql= 'UPDATE $wpdb->users SET luni="'.$_POST['luni'].'", marti="'.$_POST['marti'].'", miercuri="'.$_POST['miercuri'].'", joi="'.$_POST['joi'].'", vineri="'.$_POST['vineri'].'", sambata="'.$_POST['sambata'].'", duminica="'.$_POST['duminica'].'", comment="'.$_POST['comment'].'", orar="1" WHERE ID= '$user_id'';

    echo '

    <center>ORARUL A FOST INSERAT IN BAZA DE DATE ... VEI FI REDIRECTIONAT CATRE PRIMA PAGINA</center>

    MULTUMIM!

    <META HTTP-EQUIV=Refresh CONTENT="0; URL=index.php">';

    ?>

    But it doesn`t work.
    Please help me to make a good one.
    I don`t want to use plugins becouse I need to update the tablete with users.
    My hostname is "localhost", my db name is "minicosm_crow" and my tabelete is "crow_users". There are saved all users and passwords and I made some coloums with the name "luni", "marti".....etc just like de exemple of "send.php"
    Please help me urgent

Topic Closed

This topic has been closed to new replies.

About this Topic