Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////////////////////////////////////// ERREUR ////////////////////////////////////////////////////
- ErrorException in Response.php line 339:
- Header may not contain more than a single header, new line detected
- in Response.php line 339
- at HandleExceptions->handleError('2', 'Header may not contain more than a single header, new line detected', '/app/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/vendor/symfony/http-foundation/Response.php', '339', array('this' => object(RedirectResponse), 'values' => array('http://local.dev/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/public/HTTP/1.0 302 Found Cache-Control: no-cache Location: http://local.dev/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/public/ <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <meta http-equiv="refresh" content="1;url=http://local.dev/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/public/" /> <title>Redirecting to http://local.dev/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/public/</title> </head> <body> Redirecting to <a href="http://local.dev/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/public/">http://local.dev/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/public/</a>. </body> </html>'), 'name' => 'Location', 'value' => 'http://local.dev/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/public/HTTP/1.0 302 Found Cache-Control: no-cache Location: http://local.dev/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/public/ <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <meta http-equiv="refresh" content="1;url=http://local.dev/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/public/" /> <title>Redirecting to http://local.dev/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/public/</title> </head> <body> Redirecting to <a href="http://local.dev/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/public/">http://local.dev/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/public/</a>. </body> </html>'))
- at header('Location: http://local.dev/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/public/HTTP/1.0 302 Found Cache-Control: no-cache Location: http://local.dev/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/public/ <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <meta http-equiv="refresh" content="1;url=http://local.dev/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/public/" /> <title>Redirecting to http://local.dev/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/public/</title> </head> <body> Redirecting to <a href="http://local.dev/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/public/">http://local.dev/web/Tuto/php/Framework/Social-Network/3_sn-signup_controller_model/public/</a>. </body> </html>', false, '302') in Response.php line 339
- at Response->sendHeaders() in Response.php line 373
- at Response->send() in index.php line 56
- //////////////////////////////////////////////////// ERREUR ////////////////////////////////////////////////////
- //////////////////////////////////////////////////// Contrôleur ////////////////////////////////////////////////////
- <?php
- namespace App\Http\Controllers;
- use App\User;
- use Illuminate\Http\Request;
- class UserController extends Controller
- {
- /*
- * creation de la fonction d'enregistrement du client
- */
- public function signup(Request $request)
- {
- // accesseur pour la requete a travers les variables
- $email = $request['email'];
- $name = $request['name'];
- $password = bcrypt($request['password']);
- $user = new User();
- // le mode user accedera au email, nom et mot de pass.
- $user->email = $email;
- $user->name = $name;
- $user->password = $password;
- // tout ceci sera sauvegarder.
- $user->save();
- return redirect( back() );
- }
- /*
- * creation de la fonction de connection du client
- */
- public function signin()
- {
- }
- }
- //////////////////////////////////////////////////// Contrôleur ////////////////////////////////////////////////////
- //////////////////////////////////////////////////// Route ////////////////////////////////////////////////////
- Route::get('/', function () {
- return view('home');
- });
- Route::post('/login', function () {
- return view('app.login');
- });
- Route::post('/signup', [
- 'uses' => 'UserController@signup',
- 'as' => 'signup',
- ]);
- //////////////////////////////////////////////////// Route ////////////////////////////////////////////////////
- //////////////////////////////////////////////////// View ////////////////////////////////////////////////////
- @extends('layouts.app')
- @section('title', 'Bienvenue')
- @section('content')
- @include('includes.nav')
- <div class="row">
- <div class="col-md-6">
- <h1>s'enregistrer et se connecter</h1>
- <p>
- <li> creation de model et migration <strong>php artisan make:model User -m</strong></li>
- <li> creation du controller <strong>php artisan make:controller UserController</strong></li>
- </p>
- <hr>
- <h4> Connection au Dashboard</h4>
- <a href="{{ url('login')}}" class="btn btn-info"> Connection </a>
- </div>
- <div class="col-md-6">
- <h3 class="text-center"> S'enregistrer </h3>
- {!! Form::open([ 'route' => 'signup', 'method' => 'post']) !!}
- <input type="hidden" name="_token" value="{{ Session::token() }}"></input>
- <div class="form-group">
- {!! Form::text('email', null, ['class' => 'form-control', 'id' => 'email' ,'placeholder' =>'Votre email.'] ) !!}
- </div><!-- form group -->
- <div class="form-group">
- {!! Form::text('name', null, ['class' => 'form-control', 'id' => 'name' ,'placeholder' =>'Votre nom prenom ou pseudo.'] ) !!}
- </div><!-- form group -->
- <div class="form-group">
- {!! Form::password('password', ['class' => 'form-control', 'id' => 'password' ,'placeholder' =>'Entrer votre mot de passe.'] ) !!}
- </div><!-- form group -->
- {!! Form::submit('S\'enregister', ['class' => 'btn btn-primary'])!!}
- {!! Form::close() !!}
- </div>
- </div>
- @endsection
- //////////////////////////////////////////////////// View ////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement