当前位置: 首页>>代码示例>>PHP>>正文


PHP Redirect::Back方法代码示例

本文整理汇总了PHP中Redirect::Back方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::Back方法的具体用法?PHP Redirect::Back怎么用?PHP Redirect::Back使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Redirect的用法示例。


在下文中一共展示了Redirect::Back方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postCreateNew

 public function postCreateNew()
 {
     $cre = ['cv_name' => Input::get('cv_name'), 'email' => Input::get('email')];
     $rules = ['cv_name' => 'required', 'email' => 'required|email'];
     $validator = Validator::make($cre, $rules);
     if ($validator->passes()) {
         $cv = new Cv();
         do {
             $random = str_random(10);
             $count = Cv::where('cv_code', $random)->count();
         } while ($count != 0);
         $cv->cv_code = $random;
         if (Auth::check()) {
             $cv->user_id = Auth::id();
         }
         $cv->cv_name = Input::get('cv_name');
         $cv->email = Input::get('email');
         $cv->save();
         $cv_id = $cv->id;
         DB::table('sections')->insert(array(array("cv_id" => "{$cv_id}", "section_name" => "Work Experience", "type" => "1", "priority" => "1", "default" => "1"), array("cv_id" => "{$cv_id}", "section_name" => "Qualfications", "type" => "0", "priority" => "2", "default" => "1"), array("cv_id" => "{$cv_id}", "section_name" => "Education", "type" => "2", "priority" => "3", "default" => "1"), array("cv_id" => "{$cv_id}", "section_name" => "NYSC", "type" => "3", "priority" => "4", "default" => "1"), array("cv_id" => "{$cv_id}", "section_name" => "Languages", "type" => "4", "priority" => "5", "default" => "1"), array("cv_id" => "{$cv_id}", "section_name" => "Passport Photo", "type" => "5", "priority" => "6", "default" => "1"), array("cv_id" => "{$cv_id}", "section_name" => "Interests", "type" => "0", "priority" => "7", "default" => "1"), array("cv_id" => "{$cv_id}", "section_name" => "References", "type" => "0", "priority" => "8", "default" => "1")));
         return Redirect::to('/cvbuilder/cv/' . $cv->cv_code);
     } else {
         return Redirect::Back()->withErrors($validator)->withInput();
     }
 }
开发者ID:vishu87,项目名称:cpr,代码行数:25,代码来源:CVController.php

示例2: postSaveadd

 public function postSaveadd()
 {
     $cre = ['name' => Input::get('name'), 'email' => Input::get('email'), 'enquiry' => Input::get('enquiry'), 'message' => Input::get('message')];
     $rules = ['name' => 'required', 'email' => 'required|email', 'enquiry' => 'required|not_in:0', 'message' => 'required'];
     $validator = Validator::make($cre, $rules);
     if ($validator->passes()) {
         require app_path() . '/mail.php';
         require app_path() . '/libraries/PHPMailerAutoload.php';
         $mail = new PHPMailer();
         $mail_text = new Mail();
         $mail->isMail();
         $mail->setFrom('info@corperlife.com', 'Corper Life');
         $mail->addAddress('questions@corperlife.com');
         $mail->addAddress('vishu.iitd@gmail.com');
         $mail->isHTML(true);
         $mail->Subject = "Advertisement Request | Corper Life";
         $mail->Body = $mail_text->advert(Input::get("name"), Input::get("email"), Input::get("enquiry"), Input::get("phone"), Input::get("message"));
         if (!$mail->send()) {
             return Redirect::Back()->with('failure', 'Mailer Error: ' . $mail->ErrorInfo);
         } else {
             return Redirect::Back()->with('success', 'Your enquiry has been submitted. We will respond to it asap.');
         }
     } else {
         return Redirect::Back()->withErrors($validator)->withInput();
     }
 }
开发者ID:vishu87,项目名称:cpr,代码行数:26,代码来源:GeneralController.php

示例3: postLogin

 public function postLogin()
 {
     $cre = ["username" => Input::get('username'), "password" => Input::get('password')];
     $rules = ['username' => 'required', 'password' => 'required'];
     $validator = Validator::make($cre, $rules);
     if ($validator->passes()) {
         if (Auth::attempt($cre)) {
             return Redirect::to('/admin');
         } else {
             return Redirect::Back()->withErrors($validator)->withInput()->with('fail', 'Username and password does not match');
         }
     } else {
         return Redirect::Back()->withErrors($validator)->withInput();
     }
 }
开发者ID:vishu87,项目名称:avyay_sms,代码行数:15,代码来源:UserController.php

示例4: store

 public function store()
 {
     $validation = Validator::make(Input::all(), Post::$rules);
     if ($validation->fails()) {
         return Redirect::Back()->withInput()->withErrors($validation->messages());
     }
     $post = new Post();
     $post->title = Input::get('title');
     $post->description = Input::get('description');
     $post->content_text = Input::get('content_text');
     $post->user_id = Auth::user()->id;
     $post->point = 0;
     $post->status = 1;
     $post->save();
     return Redirect::to('/');
 }
开发者ID:Thormod,项目名称:JusThinkGreen,代码行数:16,代码来源:PostController.php

示例5: storeProfile

 public function storeProfile()
 {
     if (Auth::check()) {
         $validation = Validator::make(Input::all(), UserProfile::$rules);
         if ($validation->fails()) {
             return Redirect::Back()->withInput()->withErrors($validation);
         }
         $profile = UserProfile::find(Auth::User()->id);
         $profile->first_name = Input::get('first_name');
         $profile->last_name = Input::get('last_name');
         $profile->save();
         return Redirect::to("user/{$profile->id}");
     } else {
         return Redirect::to('login_index');
     }
 }
开发者ID:Thormod,项目名称:JusThinkGreen,代码行数:16,代码来源:ProfileController.php

示例6: register

 public function register()
 {
     $reguser = array('regfirst' => Input::get('regfirst'), 'reglast' => Input::get('reglast'), 'reguser' => Input::get('reguser'), 'password' => Input::get('password'), 'cpassword' => Input::get('cpassword'));
     $rules = array('regfirst' => 'alpha_num|max:50', 'reglast' => 'alpha_num|max:50', 'reguser' => 'required|unique:users,username|alpha_num|min:5', 'password' => 'required|alpha_num|between:6,100', 'cpassword' => 'required|alpha_num|between:6,100|same:password');
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         return Redirect::Back()->withInput()->withErrors($validator);
     } else {
         $user = new UserModel();
         $user->firstname = Input::get('regfirst');
         $user->lastname = Input::get('reglast');
         $user->username = Input::get('reguser');
         $user->password = Hash::make(Input::get('password'));
         $user->roles = Input::get('roles');
         $user->save();
     }
     return Redirect::route('login')->with('flash_notice', 'You are successfully Register.');
 }
开发者ID:shineirvin,项目名称:projectinv.github.io,代码行数:18,代码来源:UserController.php

示例7: postSaveReply

 public function postSaveReply($topic_id)
 {
     if (Auth::check()) {
         $cre = ['reply' => Input::get('reply')];
         $rules = ['reply' => 'required'];
         $validator = Validator::make($cre, $rules);
         if ($validator->passes()) {
             $blog = new Blog();
             $blog->user_id = Auth::id();
             $blog->topic_id = $topic_id;
             $blog->reply = Input::get('reply');
             $blog->save();
             return Redirect::Back()->with('success', 'gfhfhfh');
         } else {
             return Redirect::Back()->withErrors($validator)->withInput();
         }
     }
 }
开发者ID:vishu87,项目名称:cpr,代码行数:18,代码来源:ForumController.php

示例8: loginFailed

 public function loginFailed()
 {
     return Redirect::Back()->withInput()->with('message', "Invalid email/password");
 }
开发者ID:prateekk16,项目名称:wasdbox,代码行数:4,代码来源:SessionsController.php

示例9: postForgot

 public function postForgot()
 {
     $cre = ['email' => Input::get('email')];
     $rules = ['email' => 'required|email'];
     $validator = Validator::make($cre, $rules);
     if ($validator->passes()) {
         $count = DB::table("users")->where('username', Input::get('email'))->count();
         if ($count > 0) {
             $user = User::where('username', Input::get('email'))->select('id', 'username', 'password', 'facebook_id', 'firstname')->first();
             if ($user->password != -1 && empty($user->facebook_id)) {
                 require app_path() . '/mail.php';
                 require app_path() . '/libraries/PHPMailerAutoload.php';
                 $password = str_random(8);
                 $password_hash = Hash::make($password);
                 $mail = new PHPMailer();
                 $mail_text = new Mail();
                 $mail->isMail();
                 $mail->setFrom('info@corperlife.com', 'Corper Life');
                 $mail->addAddress($user->username);
                 $mail->isHTML(true);
                 $mail->Subject = "Corper Life Forgot Password";
                 $mail->Body = $mail_text->forgot_mail($user->firstname, $user->username, $password);
                 if (!$mail->send()) {
                     return Redirect::back()->with('fail', 'Mailer Error: ' . $mail->ErrorInfo)->withInput();
                 } else {
                     $user->password = $password_hash;
                     $user->save();
                     return Redirect::back()->with('success', 'Your password is reset and sent to your email');
                 }
             } else {
                 return Redirect::back()->with('fail', 'This email is registered with Facebook Login')->withInput();
             }
         } else {
             return Redirect::back()->with('fail', 'Email not found')->withInput();
         }
     } else {
         return Redirect::Back()->withErrors($validator)->withInput();
     }
 }
开发者ID:vishu87,项目名称:cpr,代码行数:39,代码来源:UserController.php

示例10: putnyscDetails

 public function putnyscDetails()
 {
     $cre = ['serv_year' => Input::get('service_year'), 'batch' => Input::get('batch')];
     $rules = ['serv_year' => 'required|not_in:0', 'batch' => 'required|not_in:0'];
     $validator = Validator::make($cre, $rules);
     if ($validator->passes()) {
         $user = User::find(Auth::id());
         $user->serv_year = Input::get('service_year');
         $user->batch = Input::get('batch');
         $user->save();
         return Redirect::to('/profile');
     } else {
         return Redirect::Back()->withErrors($validator)->withInput();
     }
 }
开发者ID:vishu87,项目名称:cpr,代码行数:15,代码来源:UserprofileController.php

示例11: DeleteTopics

 public function DeleteTopics($id)
 {
     $del = DB::table('topics')->where('id', $id)->delete();
     return Redirect::Back()->with('success', 'Topic Deleted');
 }
开发者ID:vishu87,项目名称:cpr,代码行数:5,代码来源:AdminController.php

示例12: getmessage

 public function getmessage()
 {
     if (Payment::VeryPayment() == false) {
         return View::make('clinic.payment.renews-payment');
     }
     $data = array("message" => Input::get("message"));
     $rules = array("message" => 'required|min:3|max:255');
     $messages = array('required' => 'El campo :attribute es obligatorio.', 'min' => 'El campo :attribute no puede tener menos de :min carácteres.', 'max' => 'El campo :attribute no puede tener más de :max carácteres.');
     $validation = Validator::make(Input::all(), $rules, $messages);
     //si la validación falla redirigimos al formulario de registro con los errores
     //y con los campos que nos habia llenado el usuario
     if ($validation->fails()) {
         return Redirect::to('/doctors/profile')->withErrors($validation)->withInput();
     } else {
         $msg = new MgsAppointment();
         $msg->appointment_id = Input::get("cita_id");
         $msg->text = Input::get("message");
         $msg->save();
         return Redirect::Back();
     }
 }
开发者ID:jnicolasbc,项目名称:admin_swp_com,代码行数:21,代码来源:AppointmentsController.php

示例13: function

Route::group(['prefix' => 'cv-page', 'before' => 'auth'], function () {
    Route::get('/', 'UserprofileController@getcvpage');
    Route::get('/duplicate/{code}', 'UserprofileController@duplicatecvpage');
    Route::get('/delete/{code}', 'UserprofileController@deleteCV');
});
Route::group(['prefix' => 'content-page', 'before' => 'auth'], function () {
    Route::get('/', 'ForumController@getcontentpage');
});
Route::group(['prefix' => 'cvbuilder'], function () {
    Route::get('/', 'CVController@getIndex');
    Route::post('/createnew', 'CVController@postCreateNew');
    Route::post('/uploadCvPic/{code}', 'UserMediaController@uploadCvPic');
    Route::post('/editcv', function () {
        $count = Cv::where('cv_code', Input::get('cvcode'))->count();
        if ($count == 0) {
            return Redirect::Back()->with('fail', 'Invalid CV Code')->withInput();
        } else {
            return Redirect::to('/cvbuilder/cv/' . Input::get('cvcode'));
        }
    });
    Route::get('/cv/{id}', 'CVController@getCV');
    Route::post('/saveinfo/{id}', 'CVController@putSaveInfo');
    Route::get('/fetch_workex', function () {
        return View::make('cvbuilder.section_views.workex');
    });
    Route::get('/fetch_education', function () {
        return View::make('cvbuilder.section_views.education');
    });
    Route::get('/fetch_nysc', function () {
        return View::make('cvbuilder.section_views.nysc');
    });
开发者ID:vishu87,项目名称:cpr,代码行数:31,代码来源:routes.php

示例14: storeStudent

 public function storeStudent()
 {
     $cre = ["first_group" => Input::get('first_group'), 'name' => Input::get('name'), 'dob' => Input::get('dob'), 'gender' => Input::get('gender'), 'father_name' => Input::get('father_name'), 'month_plan' => Input::get('month_plan'), 'dor' => Input::get('dor'), 'doe' => Input::get('doe'), 'dos' => Input::get('dos')];
     $rules = ["first_group" => 'required', 'name' => 'required', 'dob' => 'required', 'gender' => 'required', 'father_name' => 'required', 'month_plan' => 'required', 'dor' => 'required', 'doe' => 'required', 'dos' => 'required'];
     $validator = Validator::make($cre, $rules);
     if ($validator->passes()) {
         $student = new Student();
         $student->name = Input::get('name');
         $student->dob = Input::get('dob');
         $student->gender = Input::get('gender');
         $student->first_group = Input::get('first_group');
         $student->dos = Input::get('dos');
         $student->doe = Input::get('doe');
         $student->added_by = Auth::User()->id;
         $student->add_date = strtotime("now");
         $student->save();
         $student_details = new StudentDetails();
         $student_details->student_id = $student->id;
         $student_details->school = Input::get('school_name');
         $student_details->status_email = Input::get('status_email');
         $student_details->status_mob = Input::get('status_mob');
         $student_details->father = Input::get('father_name');
         $student_details->mother = Input::get('mother');
         $student_details->father_mob = Input::get('father_mob');
         $student_details->father_email = Input::get('father_email');
         $student_details->mother_mob = Input::get('mother_mob');
         $student_details->mother_email = Input::get('mother_email');
         $student_details->address = Input::get('address');
         $student_details->city = Input::get('city');
         $student_details->state = Input::get('state');
         if (Input::hasFile('picture')) {
             $picture = Input::file('picture');
             $filename = Input::file('picture')->getClientOriginalName();
             Input::file('picture')->move('uploads/', 'st_' . $filename);
             $student_details->pic = 'st_' . $filename;
         }
         $student_details->father_status_email = Input::get('father_status_email');
         $student_details->father_status_mob = Input::get('father_status_mob');
         $student_details->mother_status_mob = Input::get('mother_status_mob');
         $student_details->mother_status_email = Input::get('mother_status_email');
         $student_details->save();
         $payment = new PaymentHistory();
         $payment->student_id = $student->id;
         $payment->dos = Input::get('dos');
         $payment->dor = Input::get('dor');
         $payment->doe = Input::get('doe');
         $payment->reg_fee = Input::get('reg_fee');
         $payment->sub_fee = Input::get('sub_fee');
         $payment->kit_fee = Input::get('kit_fee');
         $payment->amount = Input::get('amount');
         $payment->months = Input::get('month_plan');
         $payment->adjustment = Input::get('adjustment');
         $payment->p_remark = Input::get('p_remark');
         $payment->a_remark = Input::get('a_remark');
         $payment->date = strtotime("now");
         $payment->payment_mode = Input::get('payment_mode');
         $payment->save();
         return Redirect::Back()->with('success', 'New Student Added Successfully');
     }
     return "error";
 }
开发者ID:vishu87,项目名称:avyay_sms,代码行数:61,代码来源:StudentController.php


注:本文中的Redirect::Back方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。