首先,我是一个绝对的初学者,刚开始使用jQuery mobile进行编码。
工作正常,但我创建了一个带有普通提交按钮的html表单。当我点击它时,没有发生......也许是s.o.可以帮我解决这个问题吗?!无法找到我的错误......
这是我的HTML表格:
<form id='myform' action ='./update.php' method='POST'>";
while($daten = mysql_fetch_array($re, MYSQL_ASSOC))
{
echo "<b>Titel:</b><br><input name=titelbox type=text value=" . $daten["Titel"] . "><br>";
echo "<b>Beschreibung:</b><br><input name=beschreibungbox type=text value=" . $daten["Beschreibung"] . "><br>";
echo "<b>Kunde:</b><br><input name=kundebox type=text value=" . $daten["Kunde"] . "><br>";
echo "<b>Baustelle:</b><br><input name=baustellebox type=text value=" . $daten["Baustelle"] . "><br>";
echo "<b>Ort:</b><br><input name=ortbox type=text value=" . $daten["Ort"] . "><br>";
echo "<b>Conainergrösse:</b><br><input name=cont_grbox type=text value=" . $daten["Cont_Gr"] . "><br>";
echo "<b>Inhalt:</b><br><input name=inhaltbox type=text value=" . $daten["Inhalt"] . "><br>";
echo "<b>Bemerkung:</b><br><input name=bemerkungbox type=text value=" . $daten["Bemerkung"] . "><br>";
echo "<b>Zugewiesen:</b><br><input name=zugewiesenbox type=text value=" . $daten["Zugewiesen"] . "><br>";
echo "<b>Status:</b><br><input name=statusbox type=text value=" . $daten["Status"] . ">";
echo "<b>ID:</b><br><input name=idbox type=text value=" . $daten["ID"] . ">";
}
}
echo"</div>";
mysql_close($link);
?>
<br>
<input type='submit' name='my_button' value='save'>
<br>
</div><!-- /content -->
</body>
</html>
这是我和她之间的关系。头&gt;标签:
<link rel="stylesheet" href="css/themes/damke_mobile.min.css" />
<link rel="stylesheet" href="css/themes/jquery.mobile.icons.min.css" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile.structure-1.4.2.min.css" />
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>
---- ---- UPDATE 当我注释掉.js文件时,它工作正常,但这不是解决方案....
这是我的整个页面:
<!DOCTYPE html>
<html>
<head>
<title>Damke Mobile</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/themes/damke_mobile.min.css" />
<link rel="stylesheet" href="css/themes/jquery.mobile.icons.min.css" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile.structure-1.4.2.min.css" />
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>
<link rel="stylesheet" href="mobile.css">
</head>
<body>
<div data-role="header">
<h1>Damke Portal - Details</h1>
<a href="mobile.php">Home</a>
</div><!-- /header -->
<div role="main" class="ui-content">
<?php
$ID = $_GET["ID"];
$server = "localhost";
$datenbank = "****e";
$username = "****e";
$passwort = "*****1";
$link = mysql_connect($server, $username, $passwort);
if (!$link) die(mysql_error());
$db = mysql_select_db($datenbank, $link);
if ($db)
{
$re = mysql_query("SELECT * FROM Termine_Test where ID='$ID'", $link);
echo"<div id='myform'><table width='90%'><form id='myform' action ='./update.php' method='POST'>";
while($daten = mysql_fetch_array($re, MYSQL_ASSOC))
{
echo "<b>Titel:</b><br><input name=titelbox type=text value=" . $daten["Titel"] . "><br>";
echo "<b>Beschreibung:</b><br><input name=beschreibungbox type=text value=" . $daten["Beschreibung"] . "><br>";
echo "<b>Kunde:</b><br><input name=kundebox type=text value=" . $daten["Kunde"] . "><br>";
echo "<b>Baustelle:</b><br><input name=baustellebox type=text value=" . $daten["Baustelle"] . "><br>";
echo "<b>Ort:</b><br><input name=ortbox type=text value=" . $daten["Ort"] . "><br>";
echo "<b>Conainergrösse:</b><br><input name=cont_grbox type=text value=" . $daten["Cont_Gr"] . "><br>";
echo "<b>Inhalt:</b><br><input name=inhaltbox type=text value=" . $daten["Inhalt"] . "><br>";
echo "<b>Bemerkung:</b><br><input name=bemerkungbox type=text value=" . $daten["Bemerkung"] . "><br>";
echo "<b>Zugewiesen:</b><br><input name=zugewiesenbox type=text value=" . $daten["Zugewiesen"] . "><br>";
echo "<b>Status:</b><br><input name=statusbox type=text value=" . $daten["Status"] . ">";
echo "<b>ID:</b><br><input name=idbox type=text value=" . $daten["ID"] . ">";
}
}
echo"</div>";
mysql_close($link);
?>
<br>
<input type='submit' name='my_button' value='save'>
</form>
<br>
</div><!-- /content -->
</body>
</html>
答案 0 :(得分:0)
我不确定,但我认为如果你在某处添加关闭表单标签会更好
答案 1 :(得分:0)
查看您的代码和您的部门,您的部门未正确关闭:
这是您目前代码中的内容:
<div role="main" class="ui-content">
<div id='myform'>
<table width='90%'>
<form id='myform' action ='./update.php' method='POST'>
</div>
<input type='submit' name='my_button' value='save'>
</form>
</div><!-- /content -->
在旁注中,您应该重新考虑这一行:
$re = mysql_query("SELECT * FROM Termine_Test where ID='$ID'", $link);
对于SQL注入是开放的,你的$ ID直接来自$ _GET