自定义HTML / PHP / Mysql表单在Joomla中不起作用

时间:2015-09-27 19:31:17

标签: php html mysql joomla

我为Joomla编写了一份表格。它工作得非常好,但现在突然间PHP处理无法正常工作。我试了十几件事让它发挥作用,但它不听我的意思。为什么呢?

以下是代码:

<?php
echo '<html>
      <table>
        <form method="post" action="post">
        <tr>
          <td>Uporabniško ime</td>
          <td><input type="text" name="up_ime" id="up_ime" size="20">
          </td>
        </tr>
        <tr>
          <td>Origin ID</td>
          <td><input type="text" name="origin" id="origin" size="40">
          </td>
        </tr>
        <tr>
          <td></td>
          <td align="right"><input type="submit" name="submit" value="Prijava"></td>
        </tr>
        </form>
        </table>

</html>';

mysql_connect("localhost","username","password");
mysql_select_db("fifaslov_fut");

$up_ime = $_POST['up_ime'];  
$origin = $_POST['origin'];

if(empty($up_ime) || empty($origin)){
    echo("");
} else{
    $order = "INSERT INTO futliga_pc_prijava (up_ime, origin) VALUES ('$up_ime','$origin')";
    $result = mysql_query($order);
    echo("<br>Uspešno ste se prijavili!");
}
mysql_close;
?>

1 个答案:

答案 0 :(得分:-1)

您没有存储/var/log/mail.log

connection Variable

只是建议使用$con = mysql_connect("localhost","fifaslov_fut","bovo2978", "fifaslov_fut"); $up_ime = $_POST['up_ime']; $origin = $_POST['origin']; if(empty($up_ime) || empty($origin)){ echo(""); } else{ $order = "INSERT INTO futliga_pc_prijava (up_ime, origin) VALUES ('$up_ime','$origin')"; $result = mysql_query($con, $order); echo("<br>Uspešno ste se prijavili!"); } mysql_close($con);