PHP - Moved: Edit Document And Print It Automatically
This topic has been moved to JavaScript Help.
http://www.phpfreaks.com/forums/index.php?topic=320005.0 Similar TutorialsI have managed to retrieve an sql query and through php create an xml document, my next aim is to get this code into actionscript so that I can use the data in Flash. One problem I am experiencing is that in creating the xml document the data within xml nodes are echoed to the screen, I do not want them to be echoed to the screen just picked up by actionscript. Is there a way to created an xml document using php that does not print to the screen? <?php include("php/dbconnect.php"); //connects to the database //sql_query $table_id = 'booking'; $query = "SELECT * FROM $table_id WHERE (booking.bookingDate = curDate()) AND roomID = 1 ORDER BY startTime"; $room1 = mysql_query($query); //create a new DOM document $doc = new DOMDocument('1.0'); //create root element $root = $doc->createElement('root'); $root = $doc->appendChild($root); //process one row at at time while($row = mysql_fetch_assoc($room1)){ //add node for each row $occ = $doc->createElement($table_id); $occ = $doc->appendChild($occ); //add achild for each field foreach ($row as $fieldname => $fieldvalue){ $child = $doc->createElement($fieldname); $child = $occ->appendChild($child); $value = $doc->createTextNode($fieldvalue); $value = $child->appendChild($value); } } $xml_string = $doc->saveXML(); echo $xml_string; mysql_free_result($room1); ?> This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=346771.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=346821.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=319994.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=306341.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=322008.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=345742.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=346728.0 This topic has been moved to Installation in Windows. http://www.phpfreaks.com/forums/index.php?topic=351150.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=354333.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=316747.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=334078.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=355885.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=358604.0 Hi, I was wondering if it is possible to have the foreign keys (FK) to automatically assign its value to the corresponding PK (primary key) it references? Let's say I have four tables (with their PK,FK and other fields) Code: [Select] TABLE document: TABLE pathway: TABLE leaf TABLE value: PK: docID PK:pathID PK:leafID PK:valueID filePath pathway FK:pathID FK:leafID fileName FK:docID value target source So when I upload a document, it is added to TABLE document, where PK docID set, and at same time I would add the filepath to TABLE pathway, and now I want TABLE leaf's FK to AUTOMATICALLY add the pathID, docID and ALSO at same time TABLE value's FK of leafID will also be added for that ONE entry that was initally added to TABLE document, pathway. Please I hope someone understand what I want to do, I know FK is for ensuring integrity of data. Please any help is appreciated. Please use my example to help me, thanks. PS: I know the formatting is off which I noticed when I went to preview the post, sorry. Hi Guys, I have the following $pattern = '<tr class="newsitem">'; when I echo this out it produces <tr class="newsitem"> </tr> Why is it automatically closing the tag? I dont want this becuase i'm using preg_replace and the tag is closed elsewhere already on the page. Hi,
I have the following function, but told I need to run it automatically. How would I do this?
<script> function replaceText() { var list = document.getElementsByTagName("UL")[22]; var list2 = list.getElementsByTagName("LI")[29]; list2.getElementsByTagName("LABEL")[0].innerHTML = "Car"; } </script>Thanks! Hello, I am new here but I hope you can help me with a problem that I've been stuck with for days. I am trying to populate the content of a website through XML files (zipped) that are located on an FTP server. I managed to get the zip file but I'm not sure if it is the correct way: Code: [Select] function ftp_copy($file) { $conn_id = ftp_connect($ftp_host) or die ("Can't connect"); $ftp_login= ftp_login($conn_id, $ftp_user, $ftp_pass) or die ("Can't login"); ftp_pasv($conn_id, true); ftp_chdir($conn_id, "/zip_files/"); return ftp_get($conn_id, $file, $file, FTP_BINARY); } ftp_copy('1001.zip'); After that I will need to extract the zip file. I'm planning to use pclzip library for it and save the contents on a database. Also this has to happen everyday so I'm thinking about using a cron job, although hourly is also preferable since the XML files could be generated more than once per day. Am I doing it the right way or is there a better solution for this? Any help will me much appreciated! Thanks a lot! Hello friends, In this topic i am getting confuse, and never know how to do work. My problem is that: 1>> I want to send SMS, by PHP pages to mobile. 2>> If user write some Quotation into the calender date, then automatically SMS send to all of those friend with the quatation metter. 3>> All work is store also in MYSQL database also. So please tell me what I do in this case because over the internet only SMS sending code is available, but automatically sms sending option is not given. Please help me then i do this job easily. Thanks Hi, I've been wondering if it is possible to load a php page according to certain time. For example at 12:00 pm a php form will pop up automatically informing an employee to fill in something in the form, another form will pop up at 4:00 pm, etc... Thanks in advance |