I have a html file containing the following code:
code:
<html>
<head>
<title>Print building info</title>
</head>
<form name="Select id" action="domex1.php?action=printNode" method="post">
Write the building ID to display:
<input type="text" size="12" maxlength="12" name="idnumber">
<input name="submit" type="submit" value="Print!">
</form>
</html>
I want to call the function printNode() which should get an $id as a parameter.The function is implemented in a file domex1.php, as a method of a class
"Class manage extends domDocument { ....... my functions, including printNode($id)........}"
I've tried to do this by coding at the end of my file domex1.php, outside the class:
code:
$dom = new manage(); //my class instance
$dom->load("proprietati.xml");
if (isset($_POST['action']) && $_POST['action'] == 'printNode' && isset($_POST['idnumber']))
{
$dom->printNode($_POST['idnumber']);
}
Instead of the desired result, whitch is printing the info after the function call, I get the whole domex1.php file printed as plain text.
I don't understand why...
Maybe it's worth knowing that the function printNode($id) works just perfect.I've tested it by calling it manually. (giving a parameter on call) I received the correct display.
Can anyone help?
Thanks!