By GokiSoft.com|
18:28 30/10/2021|
Học Laravel
[Examination] Bài tập ôn luyện kết thúc môn - Sử dụng Laravel + Ajax
Tags:
Phản hồi từ học viên
5
(Dựa trên đánh giá ngày hôm nay)
![Trần Thị Khánh Huyền [T2008A]](https://www.gravatar.com/avatar/554e115833778e4294a01aebe228f3d6.jpg?s=80&d=mm&r=g)
Trần Thị Khánh Huyền
2021-07-16 07:47:28
#survey.php
<?php
Route::group(['prefix' => 'survey'], function () {
Route::get('/list','survey\surveyController@showList')->name('list');
Route::get('/detail','survay\surveyController@showDetail')->name('detail');
});
?>
![Trần Thị Khánh Huyền [T2008A]](https://www.gravatar.com/avatar/554e115833778e4294a01aebe228f3d6.jpg?s=80&d=mm&r=g)
Trần Thị Khánh Huyền
2021-07-16 07:47:07
#process_form.php
<?php
// var_dump($_POST);
if (isset($_POST['fullname'])){
$name = $_POST['name'];
$email = $_POST['email'];
$telephone = $_POST['telephone'];
$feedback = $_POST['feedback'];
echo 'Name : ';
echo $name;
echo '<br/>';
echo 'Email : ';
echo $email;
echo '<br/>';
echo 'Telephone : ';
echo $telephone;
echo '<br/>';
echo 'Feedback : ';
echo $feedback;
echo '<br/>';
}
![Trần Thị Khánh Huyền [T2008A]](https://www.gravatar.com/avatar/554e115833778e4294a01aebe228f3d6.jpg?s=80&d=mm&r=g)
Trần Thị Khánh Huyền
2021-07-16 07:46:44
#index.php
<!DOCTYPE html>
<html>
<head>
<title>Survey webpage</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container-fluid">
<form method="POST" action="process_form.php">
<div class="form-group">
<label for="name">Name:</label>
<input type="text" class="form-control" id="name" placeholder="Enter name" name="name">
</div>
<div class="form-group">
<label for="email">Email:</label>
<input type="email" class="form-control" id="email" placeholder="Enter email" name="email">
</div>
<div class="form-group">
<label for="telephone">Telephone:</label>
<input type="text" class="form-control" id="telephone" placeholder="Enter telephone" name="telephone">
</div>
<div class="form-group">
<label for="feedback">Feedback:</label>
<input type="text" class="form-control" id="telephone" placeholder="Enter feedback" name="feedback">
</div>
<button class="btn btn-success">Submit</button>
</form>
</div>
</body>
</html>