Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $doc = new DOMDocument();
- $doc->load( 'things.xml' );
- $things = $doc->getElementsByTagName( "thing" );
- ?>
- <html>
- <body>
- <h1>List of things</h1>
- <ul>
- <?php foreach( $things as $thing ){ ?>
- <li>
- <?php echo $thing->nodeValue; ?>
- </li>
- <?php } ?>
- </ul>
- <form action="submit.php" method="post">
- New thing: <input type="text" name="thing" />
- <input type="submit" value="Create" name="create"/><br>
- <input type="submit" value="Clear things" name="clear"/>
- </form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment