在我的表單中,我試圖檢查我的url是否有一個名爲email的屬性,如果haves顯示錶單中輸入的電子郵件已填充的值,並且它沒有給出輸入電子郵件,但空。但即時通訊「未定義索引:電子郵件」。檢查url中是否有可用的參數
我的刀片HTML是:
<?php
$email = $_GET['email'];
?>
@if(isset($email))
<div class="form-group">
<label>Email:</label>
<input class="form-control" type="email" name="email_source" value="{{$email}}">
</div>
@else
<div class="form-group">
<label>Email:</label>
<input type="email" name="email_source" value="">
</div>
@endif
在我的網址有C和有2種情況:
http://domain.com/surveys/9/show (no email)
and
http://domain.com/surveys/9/[email protected] (with email)
有人有一個想法是什麼即時做錯了什麼?
請上傳返回此視圖的控制器的方法 – mrabbani