Hello friends! I would feel better if someone would help me
here are my codes:
app.blade.php:
Captcha Test
<!-- Bootstrap -->
<!-- Latest compiled and minified CSS -->
<script src='https://www.google.com/recaptcha/api.js'></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
.image {
margin: 20px auto;
}
</style>
</head>
<body>
@yield('content')
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
and here is my form.blade.php codes;
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<h1>Who Are You?</h1>
<form action="/" method="post" id="form">
{{ csrf_field() }}
<label for="name">Name:</label>
<input type="text" name="name" class="form-control">
<label for="gender" style="margin-top:10px;">Gender:</label>
<select name="gender" class="form-control">
<option value="m">Male</option>
<option value="f">Female</option>
</select>
<!-- <div class="g-recaptcha" data-sitekey="6LdntScTAAAAAHKcukrYbrIxa-VQHhoWhN_1Ie_e"></div>
-->
<input type="submit" value="Say My Name!" class="btn btn-primary btn-block" style="margin-top:15px;">
</form>
</div>
</div>
</div>
here is my routes.blade.php
Route::get('/', 'PagesController@getForm');
Route::post('/', 'PagesController@postForm');
here is my pageController
public function getForm()
{
return view('form');
}
public function postForm()
{
$name=$request->name;
$gender=$request->gender;
return view('name')->withName($name)->withGender($gender);
}
}
here is my name.blade.php
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<h1>Hello {{ $name }}</h1>
<div class="image">
@if ($gender == 'm')
<img src="man.png">
@elseif ($gender == 'f')
<img src="woman.png">
@elseif ($gender == 'r')
<img src="robot.png">
@endif
</div>
</div>
</div>
</div>