Warning: Use of undefined constant

I am using a php script for some purpose earlier it was running without any error but now it is displaying some errors mentioned below also an example of script is given.

$getty = $_GET[emladr];
echo $getty;

it displays output as following

Warning: Use of undefined constant emladr - assumed 'emladr' in C:\W3Sites\dummyweb\www\msntr.php on line 2

my page link is :


plese help me to resolve warning message why warning is displayed.


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

should be
$getty = $_GET['emladr'];

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Actually I would recommend $HTTP_GET_VARS['emladr']; over $_GET as it helps to secure the site a bit better.

>  Actually I would recommend $HTTP_GET_VARS['emladr']; over $_GET as it helps to secure the site a bit better.

The PHP Manual says that superglobals are preferred, and that the $HTTP_*_VARS arrays are deprecated and likely to go away in a future release. (You will be able to turn them off in PHP5. This isn't and won't be the case with superglobals.)
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Found this from PHP manual:

Since PHP 4.1.0, the preferred method for retrieving external variables is with the superglobals mentioned below. Before this time, people relied on either register_globals or the long predefined PHP arrays ($HTTP_*_VARS). As of PHP 5.0.0, the long PHP predefined variable arrays may be disabled with the register_long_arrays directive.
That's exactly what I was referring to, thanks.
emladr should be in double or single quotes
Single, though I don't think that should actually matter in the code...

It wasnt a question.
Double, if you want to use variable interpolation:

$i = 2;
$_GET["something$i"] -->> $_GET["something2"]
$_GET['something' . $i] -->> $_GET["something2"]
$_GET['something$i'] -->> error (probably)

At any rate, keewooi pointed that out in the first response to this question.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.