Php 形式(动作)错误
我有一个问题,我有一个页面和一个表单,我将它指向自己,以编辑数据库中的数据。 我需要一种方法来使用这个表单并通过action=editcinemas.php?cinema\u id=cinema的id重定向它自己Php 形式(动作)错误,php,html,Php,Html,我有一个问题,我有一个页面和一个表单,我将它指向自己,以编辑数据库中的数据。 我需要一种方法来使用这个表单并通过action=editcinemas.php?cinema\u id=cinema的id重定向它自己 <html> <body> <form name="form3" method="post" action="editcinemas.php"> //MY PROBLEM IS HERE I GUESS <td>
<html>
<body>
<form name="form3" method="post" action="editcinemas.php"> //MY PROBLEM IS HERE I GUESS
<td>
<table>
<?php
require('../classes/cinema_class.php');
$cinema=new cinema($_GET["cinema_id"]);
$cinemas = $cinema->get_all_cinemas();
foreach ($cinemas as $movie)
{
$cinema_id = $movie['cinema_id'];
$cinema_name = $movie['cinema_name'];
$cinema_location = $movie['cinema_location'];
}
echo "<input name='cinemaid' type='hidden' id='cinemaid' value=" . $cinema_id . '><br/>';
echo "Cinema Name :";
echo "<input name='cinemaname' type='text' id='cinemaname' value=" . $cinema_name . '><br/>';
echo "Cinema Location :";
echo "<input name='cinemalocation' type='text' id='cinemalocation' value=" . $cinema_location . '><br/>';
?>
</table>
<input type="submit" name="Edit" value="Edit"> <input type="reset" name="Reset" value="Reset"/><INPUT Type="button" VALUE="Back" onClick="history.go(-1);return true;">
</form>
</body></html>
<?php
$cinemaid=$_POST['cinemaid'];
$cinemaname=$_POST['cinemaname'];
$cinemalocation=$_POST['cinemalocation'];
if ($_POST) {
if(empty($cinemaname)){
echo "Cinema Name is a must"; }
else{
$update_movie=mysql_query("UPDATE `memoire`.`cinema`
SET `cinema_name`= '$cinemaname', `cinema_location`= '$cinemalocation'
WHERE `cinema_id`='$cinemaid'");
if($update_movie)
{ header("Refresh: 0;url=../listallcinemas.php");}
else
{ echo "error in registration".mysql_error(); }
}
?>
//我想我的问题在这里
只需简单地附加它,如下所示:
<form name="form3" method="post" action="editcinemas.php?cinema_id=<?php echo $_GET["cinema_id"]; ?>">