Laravel 5-如何在表单中发送url参数
我有一个在搜索页面中有一些输入的表单,它有一个带有许多参数的URL,我想用这个表单或任何其他方式发送它们Laravel 5-如何在表单中发送url参数,laravel,laravel-5.4,Laravel,Laravel 5.4,我有一个在搜索页面中有一些输入的表单,它有一个带有许多参数的URL,我想用这个表单或任何其他方式发送它们 表格代码 {!! Form::open(['route' => ['test.mail'],'method' => 'post','files' => true]) !!} {!! Form::token() !!} <div class="box-header">
表格代码
{!! Form::open(['route' => ['test.mail'],'method' => 'post','files' => true]) !!}
{!! Form::token() !!}
<div class="box-header">
<i class="fa fa-envelope"></i>
<h3 class="box-title">Quick Email</h3>
<!-- tools box -->
<div class="pull-right box-tools">
<!--<button class="btn btn-info btn-sm" data-widget="remove" data-toggle="tooltip" title="Remove"><i class="fa fa-times"></i></button>-->
</div><!-- /. tools -->
</div>
<div class="box-body">
<div class="form-group">
<input type="text" class="form-control" name="object" placeholder="Subject" />
</div>
<div class="form-group">
<textarea class="textarea" name="textu" placeholder="Message" cols="120" rows="8"></textarea>
</div>
<div class="form-group">
<input type="file" class="form-control" name="filee" />
</div>
</div>
<div class="box-footer clearfix">
<input type="submit" name="sendEmail" class="pull-right btn btn-default" id="sendEmail" value="Send">
</div>
{!! Form::close() !!}
{!!Form::open(['route'=>['test.mail'],'method'=>'post','files'=>true])
{!!Form::token()!!}
快速电子邮件
{!!Form::close()!!}
我希望这会有所帮助
// Get the current URL without the query string...
echo url()->current();
// Get the current URL including the query string...
echo url()->full();
// Get the full URL for the previous request...
echo url()->previous();
这些方法中的每一种都可以通过URL facade访问:
use Illuminate\Support\Facades\URL;
echo URL::current();
这是获取url中所有值的方式
foreach($_GET as $key=>$value){
echo $key, ' => ', $value, "<br/>n";
}
foreach($\u获取为$key=>$value){
回显$key“=>”,$value“
n”;
}
然后,要在表单中发送它们,只需创建一个隐藏的输入类型,如下所示:
<input id="someId" name="UrlValue" type="hidden" value="$UrlValue">