这是search.php查看代码:
<p class="center-align">
<a class="waves-effect waves-light btn modal-trigger hoverable" href="<?php echo base_url();?>broucher_request/<?php
echo $res->collg_id ?>/<?php
$res->pdf_name ?>">
<i class="material-icons left">arrow_downward</i>Brochure</a>
<!-- <a class="waves-effect waves-light btn orange modal-trigger" href="#modal1">Modal</a>-->
</p>
这是宣传册_request.php
<div class="input-field col s12">
<i class="material-icons prefix">pdf</i>
<input id="icon_prefix active" type="text" name="pdf_id">
<label for="icon_prefix">pdf Name</label>
<div class="white-text center"></div>
</div>
这是 Controller
public function broucher_request($id)
{
$data['college_id'] = $id;
$this->load->view('home/brochure_request',$data);
}
我有一个 anchor 标记,我试图发送 search.php 的 collg_id ,它会将我重定向到小册子_请求页面,现在我尝试在 collg_id 之后再发送一个 pdf_name ,如下所示 http://localhost/aplus/broucher_request/44/hello.pdf但在 url hello.pdf 中应该对用户隐藏,并且只有 url 的这一部分应该可见
http://localhost/aplus/broucher_request/44.
在宣传册请求页面上,我有一个输入标签 pdf 作为输入文本,在输入文本上我应该获取 pdf 的名称。
最佳答案
试试这个
<p class="center-align">
<a class="waves-effect waves-light btn modal-trigger hoverable"
href="<?php echo base_url('broucher_request/'.$res->collg_id.'/'.base64_encode($res->pdf_name));?>">
<i class="material-icons left">arrow_downward</i>Brochure</a>
</p>
Controller
public function broucher_request($id, $file)
{
$data['file'] = base64_decode($file);
$data['college_id'] = $id;
$this->load->view('home/brochure_request',$data);
}
关于javascript - 单击按钮重定向时的单个 anchor 标记,第一个 id 如 url 中所示,第二个 id 为隐藏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55740504/