I have a main webpage in PHP and it calls an AJAX page. In that AJAX page I have it doing a bunch of SQL queries. From one of the queries I get a result that I need to use in an HREF statement that has to dynamically change anytime the AJAX script is called. I used
$dom = new DOMDocument();
on the main page and this in the AJAX page
$dom->getElementById('ACGFM')->setAttribute('href', 'domain.com/acgfm.php?q=' . $q2);
But I'm getting an error "call to a member function getElementById() on a non-object"
Thanks - Zack