I'm getting an error with this code:
$type = "DNS_" . strtoupper($_GET['type']);
$array = dns_get_record($domain, $type);
Helpful info:
$_GET['type'] = "a"
If I enter DNS_A in dns_get_record, the code works. But when entering $type, I get an error.
The type is dynamic and I get it from a URL parameter, which is why I can't hard code it in.
What am I doing wrong?
E_ALL. Same as if you enter an invalid DNS type likeDNS_XXXXX.<?php error_reporting(E_ALL); ini_set('display_errors', 1);DNS_Ais a pre defined integer not a string