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

问题描述 投票:-1回答:1

我为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;
?>
php html mysql joomla
1个回答
-1
投票

你没有存储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);

只是一个建议使用mysqli

© www.soinside.com 2019 - 2024. All rights reserved.