Jump to content

load the xml file from the submited input value I mean xml file name


thokchom

Recommended Posts

Hi all ..... am a beginer in this field. its request anyone to help me....
I have 5000 pages as name 1.xml, 2.xml, 3.xml, ............. 5000.xml, so m trying to load the file name which sumited as value in input box.

<?php
// $page ='1.xml'; this is working
$page =$_POST['pagename']; //but why here not able to load from the given input value (file name)
$doc = new DOMDocument();
$doc->load($page);
$contains = $doc->getElementsByTagName("contains");
foreach ($contains as $don) {
foreach($don->childNodes as $child) {
if ($child->nodeType == XML_CDATA_SECTION_NODE) {
echo $child->textContent . "<br/>";
}
}
}


?>
<form action=" " method="post">
<input name="pagename" value=" "/>

<input type="submit" name="my_form_submit_button"
value="Click here to desire page"/>

</form>
</body>

Edited by thokchom
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...