2013-07-04 46 views
0

下面是我的问题的解释。将表单值从一个表单/页传递到另一个表单 - Laravel

我有2种形式: 添加& ADD1

2页: add.php & add1.php

2功能: 功能post_add &功能post_add1 时用户填写并提交表单添加,函数post_add自动重定向到用户add1。

我想传递的值(用户后,填写并提交)从形式添加

"echo Form::text('name', Input::get('name'));"

形成ADD1,因为你需要输入下一个表格上的同样的事情。

在此先感谢!

+0

发布一些代码,将真正帮助!谢谢! – hungerstar

+0

您如何将用户从一种表单重定向到另一种表单? – hungerstar

+0

这是一个重定向功能:return Redirect :: to_action('products @ add1');在成功完成表单后,重定向到另一个页面。 – Alex

回答

1

只要使用Session :: flash();

是这样的...

function post_add(){ 
//blah blah your code. 
$passvalues = Input::all(); 
Session::flash('values', $passvalues);  
Redirect::to('/add1'); 

    } 

    function post_add1(){ 
    //Now you have access to that input... 

    $oldinput = Session::get('values'); 
    //do whatever you need to with the old/passed input 
    } 

或者你可以做一个与()....

 function post_add(){ 
//blah blah your code. 
$passvalues = Input::all(); 

Redirect::to('/add1')->with('values', $passvalues); 

    } 
+0

没问题.... – KyleK

+0

非常感谢:) –

相关问题