mardi 21 février 2017

Check if parameter available in url

In my form im trying to check if my url have a property called email, and if haves show me the input email in the form with the value already filled, and in case it doesnt give a input email but empty. But im getting "undefined index: email".

My blade html is:

<?php
                $email = $_GET['email'];
            ?>
            @if(isset($email))

                <div class="form-group">
                    <label>Email:</label>
                    <input class="form-control" type="email" name="email_source" value="">
                </div>

            @else
                <div class="form-group">
                    <label>Email:</label>
                    <input type="email" name="email_source" value="">
                </div>
             @endif

In my url there cand have 2 situations:

http://ift.tt/2lJ8myU   (no email)
and
http://ift.tt/2kW5OJy   (with email)

Someone have a idea what im doing wrong?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2lJ5oKX
via IFTTT

Aucun commentaire:

Enregistrer un commentaire