我已经提交了表单,我想在提交后做出简单的成功消息(例如:我提交了这个表单,我想自动重定向到所有行,然后上面所有行都将成为我的成功消息)。 / p>
<?php
//Gauname duomenis iš formos
$date = mysql_real_escape_string($_POST['date']);
$author = mysql_real_escape_string($_POST['author']);
$sport = mysql_real_escape_string($_POST['sport']);
$event = mysql_real_escape_string($_POST['event']);
$pick = mysql_real_escape_string($_POST['pick']);
$status = mysql_real_escape_string($_POST['status']);
//Vykdome užklausa
$sql = "INSERT INTO $table (date, author, event, sport, pick, status) VALUES ('$date', '$author', '$event', '$sport', '$pick', '$status')";
//Gauname atsakyma
if (mysql_query($sql)) {
echo "Sekimngai iterpta <br /> ";
} else {
echo "Ivyko klaida" . mysql_error();
}
?>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<h2 class="sub-header">Statymo pridėjimas</h2>
<form class="form-horizontal" action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
<div class="form-group">
<label for="date" class="control-label col-xs-2">Data</label>
<div class="col-xs-10">
<input type="text" class="form-control" id="date" name="date">
</div>
</div>
<div class="form-group">
<label for="" class="control-label col-xs-2">Autorius</label>
<div class="col-xs-10">
<input type="text" class="form-control" id="author" name="author">
</div>
</div>
<div class="form-group">
<label for="event" class="control-label col-xs-2">Įvykis</label>
<div class="col-xs-10">
<input type="text" class="form-control" id="event" name="event">
</div>
</div>
<div class="form-group">
<label for="sport" class="control-label col-xs-2">Sportas</label>
<div class="col-xs-10">
<select name="sport" id="sport" class="form-control">
<option value="/darbas/images/football.png">Futbolas</option>
<option value="/darbas/images/basketball.png">Krepšinis</option>
<option value="/darbas/images/tennis.png">Tenisas</option>
<option value="/darbas/images/hockey.png">Ledo ritulys</option>
</select>
</div>
</div>
<div class="form-group">
<label for="pick" class="control-label col-xs-2">Pasirinkimas</label>
<div class="col-xs-10">
<input type="text" class="form-control" id="pick" name="pick">
</div>
</div>
<div class="form-group">
<label for="status" class="control-label col-xs-2">Statusas</label>
<div class="col-xs-10">
<select name="status" id="status" class="form-control">
<option value="Laukiama">Laukiama</option>
<option value="Laimėta">Laimėta</option>
<option value="Pralaimėta">Pralaimėta</option>
<option value="Grąžinta">Grąžinta</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-xs-offset-2 col-xs-10">
<input type="submit" name="Submit" class="btn btn-primary" value="Pridėti statymą">
</div>
</div>
</form>