php - The $_GET[] variables become null after form is submitted -
$emailgot
, $codepass
printed fine before submitting form. after submitting $emailgot
printed blank.
the action part of form refers same page.
undefined variables code , email after submitting form.
do need pass them somehow in form?
thanks.
url has email , code fields filled.
<body> <header style="padding-top: 2em;padding-left: 2em;"> <h2> password reset </h2> <div> <header id="messagebox" style="padding-left: 3em;"> <?php if($_post) { echo $message; } ?> </header> </div> </header> <section class="50% row uniform" style="padding-top: 2em;"> <form action='passreset.php?code='$codepass'&email='$emailgot'' method="post" class="12u 50% row uniform"> <div class="8u 6u$(3) 12u$(3) -1u"> <p>password : </p> </div> <div class="8u 6u$(2) 12u$(3) -1u"> <input type="password" name="password" id="password" value="" placeholder="password" required=""/> </div> <div class="8u 6u$(3) 12u$(3) -1u"> <p>confirm password : </p> </div> <div class="8u 6u$(2) 12u$(3) -1u"> <input type="password" name="cpassword" id="cpassword" value="" placeholder="confirm password" required=""/> </div> <div class="12u$"> <ul class="actions"> <li><input value="submit" class="special big" type="submit"></li> </ul> </div> </form> </section> </body>
<form action='passreset.php?code=<?= $codepass ?>&email=<?= $emailgot ?>' method="post" class="12u 50% row uniform">
if don't open code block, using literal $codepass
, $emailgot
instead of values of in php.
<?= ... ?>
short open tag <?php echo ... ?>
update: have no use single quotes. ending attribute action @ passreset.php?code=
because of usage of single quote.
Comments
Post a Comment