Advertisement
Guest User

Untitled

a guest
Jun 15th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.59 KB | None | 0 0
  1. //////////////////////////////////////////////////// ERREUR ////////////////////////////////////////////////////
  2. ErrorException in Response.php line 339:
  3. Header may not contain more than a single header, new line detected
  4. in Response.php line 339
  5. 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>'))
  6. 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
  7. at Response->sendHeaders() in Response.php line 373
  8. at Response->send() in index.php line 56
  9. //////////////////////////////////////////////////// ERREUR ////////////////////////////////////////////////////
  10.  
  11.  
  12.  
  13. //////////////////////////////////////////////////// Contrôleur ////////////////////////////////////////////////////
  14. <?php
  15.  
  16. namespace App\Http\Controllers;
  17.  
  18. use App\User;
  19. use Illuminate\Http\Request;
  20.  
  21. class UserController extends Controller
  22. {
  23. /*
  24. * creation de la fonction d'enregistrement du client
  25. */
  26. public function signup(Request $request)
  27. {
  28. // accesseur pour la requete a travers les variables
  29. $email = $request['email'];
  30. $name = $request['name'];
  31. $password = bcrypt($request['password']);
  32.  
  33. $user = new User();
  34.  
  35. // le mode user accedera au email, nom et mot de pass.
  36. $user->email = $email;
  37. $user->name = $name;
  38. $user->password = $password;
  39.  
  40. // tout ceci sera sauvegarder.
  41. $user->save();
  42.  
  43. return redirect( back() );
  44. }
  45.  
  46. /*
  47. * creation de la fonction de connection du client
  48. */
  49. public function signin()
  50. {
  51.  
  52. }
  53. }
  54. //////////////////////////////////////////////////// Contrôleur ////////////////////////////////////////////////////
  55.  
  56.  
  57.  
  58.  
  59. //////////////////////////////////////////////////// Route ////////////////////////////////////////////////////
  60.  
  61.  
  62. Route::get('/', function () {
  63. return view('home');
  64. });
  65.  
  66.  
  67. Route::post('/login', function () {
  68. return view('app.login');
  69. });
  70.  
  71. Route::post('/signup', [
  72. 'uses' => 'UserController@signup',
  73. 'as' => 'signup',
  74. ]);
  75. //////////////////////////////////////////////////// Route ////////////////////////////////////////////////////
  76.  
  77.  
  78.  
  79. //////////////////////////////////////////////////// View ////////////////////////////////////////////////////
  80. @extends('layouts.app')
  81.  
  82. @section('title', 'Bienvenue')
  83. @section('content')
  84. @include('includes.nav')
  85.  
  86. <div class="row">
  87. <div class="col-md-6">
  88. <h1>s'enregistrer et se connecter</h1>
  89. <p>
  90. <li> creation de model et migration <strong>php artisan make:model User -m</strong></li>
  91. <li> creation du controller <strong>php artisan make:controller UserController</strong></li>
  92. </p>
  93. <hr>
  94. <h4> Connection au Dashboard</h4>
  95. <a href="{{ url('login')}}" class="btn btn-info"> Connection </a>
  96. </div>
  97.  
  98. <div class="col-md-6">
  99. <h3 class="text-center"> S'enregistrer </h3>
  100. {!! Form::open([ 'route' => 'signup', 'method' => 'post']) !!}
  101. <input type="hidden" name="_token" value="{{ Session::token() }}"></input>
  102.  
  103. <div class="form-group">
  104. {!! Form::text('email', null, ['class' => 'form-control', 'id' => 'email' ,'placeholder' =>'Votre email.'] ) !!}
  105. </div><!-- form group -->
  106.  
  107. <div class="form-group">
  108. {!! Form::text('name', null, ['class' => 'form-control', 'id' => 'name' ,'placeholder' =>'Votre nom prenom ou pseudo.'] ) !!}
  109. </div><!-- form group -->
  110.  
  111. <div class="form-group">
  112. {!! Form::password('password', ['class' => 'form-control', 'id' => 'password' ,'placeholder' =>'Entrer votre mot de passe.'] ) !!}
  113. </div><!-- form group -->
  114. {!! Form::submit('S\'enregister', ['class' => 'btn btn-primary'])!!}
  115.  
  116. {!! Form::close() !!}
  117. </div>
  118. </div>
  119. @endsection
  120. //////////////////////////////////////////////////// View ////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement