$_GET url parameter not working in form?

Okay I have index.php in which i used <?php echo $_GET['name']; ?> and its working fine all over the page except a wizard form that loads on a button click.

<?php echo $_GET['name']; ?> is working on entire page text (wherever i have used this) except a wizard form which loads on a button click. All the files of that wizard form are located in my website folder (e.g. wizard.php, wizard.js & wizard.css).

here’s how wizard.php code starts:

<div class="wizard-container">
<div class="card wizard-card" data-color="green" id="wizardProfile">
<form action="">
    <div class="wizard-header">
        <h3 class="wizard-title">
            GENERATE A FRESH <?php echo $_GET['name']; ?> CODE
        </h3>
        <h5 style="margin-left: 10px; margin-right: 10px;">Our interactive generator will guide your through the process</h5>
    </div>

i want that <?php echo $_GET['name']; ?> should also work in wizard form but it shows C:\xampp\htdocs\NameGenerator\content\hbox\html\wizard.php on line 7

Sorry for my bad explanation i don’t know much about php terms so i explained it like this Please help…

but it shows `C:\xampp\htdocs\NameGenerator\content\hbox\html\wizard.php on line 7

This is just a part of an error message? What is the complete error message?

Where is the form that you show handled? I mean in which php file ?

You should never assume that a variable from the outside is available, always expect it to be not there, so use some abstraction layer that gives you a predictable result - at least NULL on empty keys - or use some logic like the null-coalesce-operator

https://www.php.net/manual/en/migration70.new-features.php

Sponsor our Newsletter | Privacy Policy | Terms of Service