I am creating a website. In this website, I have created a Form. In this form, users can type their details and submit. When someone clicks submit button all the data stores into the database. But, Now I want to show User Inputs after registration is completed. I mean, there is page A which users can input and when this user clicks submit button I want to redirect that user to page B and show him, his inputs. I have tried this way, and it gives me this error -
ErrorException (E_ERROR) Undefined variable: date (View: D:\wamp64\www\FinalProjectesources\views\addmoney\paywithpaypal.blade.php)
How can I Fix this ??
Form View Page Book.blade.php
<form class="form-horizontal" id="form1" method="POST" action="{{ route('booktsinsert') }}"
enctype="multipart/form-data">
{{ csrf_field() }}
<h4><span id="success_message" class="text-success"></span></h4>
<br>
<h4 style="font-family: Times New Roman;font-size:200%;color:blue;"> Book {{ $bk->title }} Movie </h4> <br>
<input type="hidden" name="Movieid" value="{{ $bk->id }}">
<div class="form-group row">
<label for="example-date-input" class="col-2 col-form-label">Select Date :</label>
<div class="col-10">
<input class="form-control" type="date" name="date" placeholder="mm-dd-yyyy"
id="example-date-input">
</div>
</div>
</form>
Redirect View page. ( paywithpaypal.blade.php )
<h1> {{$date}} </h1>
Controller page. ( BookSeatController.php )
public function booktsinsert(Request $request)
{
$Mid = $request->input('Movieid');
$date = $request->input('date');
$st = $request->input('st');
$sendemail = $request->input('email');
$user = new BookSeat();
$user->Movie_id = $Mid;
$user->sdate = $date;
$user->stime = $st;
$user->email = $sendemail;
$user->save();
}
return redirect('paywithpaypal')->with("date", $date);
}
}
Routes.
Route::post('booktsinsert', [
'uses' => 'BookSeatController@booktsinsert',
'as' => 'booktsinsert'
]);
Route::get('paywithpaypal', array('as' => 'addmoney.paywithpaypal','uses' => 'AddMoneyController@payWithPaypal',));