KW Design Posted November 25, 2010 Posted November 25, 2010 I threw this together quickly, I thinks its about there, let me know... <html> <head> <title>Create XML</title> </head> <body> <?php if (isset($_POST['Submit'])) { // Collect post data from submitted form $name = $_REQUEST['name']; $val1 = $_REQUEST['val1']; $val2 = $_REQUEST['val2']; $val3 = $_REQUEST['val3']; // Creates a new document according to 1.0 specs $document = domxml_new_doc("1.0"); // Lets create an element and call it root, we will then append it to the new document. $rootElement = $document->create_element($name); $new_node = $document->append_child($rootElement); // Lets create a new node called "Items" and append that to the root node. $itemsElement = $document->create_element("movie"); $items_node = $new_node->append_child($itemsElement); // Now go into a for loop in which we will create, set, and add five nodes to our Items node. $item = $document->create_element("1st"); $item->set_content($val1); $items_node->append_child($item); $item = $document->create_element("2nd"); $item->set_content($val2); $items_node->append_child($item); $item = $document->create_element("3rd"); $item->set_content($val3); $items_node->append_child($item); // Lets dump this structure out to a file called output.xml $document->dump_file("output.xml"); } ?> <form action="" id="form" method="post"> Enter your name and top 3 movies <label>Name:</label><input type="text" name="name" /> <label>1st Place</label><input type="text" name="val1" /> <label>2nd Place</label><input type="text" name="val2" /> <label>3rd Place</label><input type="text" name="val3" /> <input type="submit" name="Submit" value="Submit" /> </form> </body> </html>
alteisenriese Posted December 19, 2010 Posted December 19, 2010 I think this post was meant to reply my topic which i had closed. Thanks anyway. By the way, i need a little help of php coding. How to write this code, lets say i have a bunch of numbers. And if something matches with one of those numbers then it will do something. Sorry for my bad english . I hope you guys know what i mean.
Guest Geoff Posted December 20, 2010 Posted December 20, 2010 You could use the in_array() function to determine if your number is in an array of those numbers.
alteisenriese Posted January 13, 2011 Posted January 13, 2011 Can anybody teach me how to use SOAP? or maybe give me some tutorial articles.
Guest Geoff Posted January 13, 2011 Posted January 13, 2011 If you use PHP, here is a good tutorial: http://www.codewalkers.com/c/a/Miscellaneo...-SOAP-with-PHP/. I haven't really used SOAP in any of my applications, so I'm not an expert.
alteisenriese Posted January 14, 2011 Posted January 14, 2011 Now i need to know how to use the PEAR Package. Do i have to write the full include_path or only by using the require('package/class.php') function?
Guest Geoff Posted January 14, 2011 Posted January 14, 2011 First, you (of course) need to install the PEAR package using CPanel. Some people assume it will just magically install itself, and of course this assumption is false. Do i have to write the full include_path or only by using the require('package/class.php') function? You should not have to use the full include path, since PHP will search in the include path if it does not find the file in the current directory.
alteisenriese Posted January 15, 2011 Posted January 15, 2011 First, you (of course) need to install the PEAR package using CPanel. Some people assume it will just magically install itself, and of course this assumption is false. Do i have to write the full include_path or only by using the require('package/class.php') function? You should not have to use the full include path, since PHP will search in the include path if it does not find the file in the current directory. Yes, I know that i have to install it by myself. I just dont know how to include it into php codes. I found on google that we should change the include_path to home/account/php to get the right path. Is this right?
Guest Geoff Posted January 19, 2011 Posted January 19, 2011 When you install PEAR packages, cpanel willautomatically set the include path to that folder.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now