php xml
Posted: Tue Sep 08, 2009 8:43 pm
I'm trying to get the value of an src attribute for an img element by getting the element using its id. I keep getting:
Fatal error: Call to undefined function getelementbyid() in /home/myavatar/public_html/getteamlogo.php on line 9
When i try it.
Heres my code:
Fatal error: Call to undefined function getelementbyid() in /home/myavatar/public_html/getteamlogo.php on line 9
When i try it.
Heres my code:
Code: Select all
<?php
//Load in user profile
$u = $_GET["u"];
$p = new DOMDocument();
$p->validateOnParse = true;
@$p->load( $u );
$logo_id="team-logo";
$logo_element = getElementById($logo_id);
$logo = $logo_element->getAttribute("src");
//Make in html...
$html_output = '<img src="' . $logo . '"' . 'id="logo" />';
//Final output:
echo $html_output;
?>