Hello,
I am trying to setup a user controllable display for my company, i have figured out how to make the php edit my xml file but it seems to just keep adding the data to the xml and i cant use spry:get on the lcd html to load the latest info. Basically i need my loading guys to be able to update the index page on an iphone and then have the data show up on the lcd. I would also greatly appreciate if someone could help me code that if there is a blank entry the xml doesnt update that line of information. here is what i am using.
Thanks in advance
Index.php
[code]
3Js Load Form <?php if(isset($_REQUEST['submit'])){ $xml = new DOMDocument("1.0","UTF-8"); $xml->load("a.xml");$rootTag = $xml->getElementsByTagName("document")->item(0);
$dataTag = $xml->createElement("data");
$aTag = $xml->createElement("a",$_REQUEST['a']);
$bTag = $xml->createElement("b",$_REQUEST['b']);
$cTag = $xml->createElement("c",$_REQUEST['c']);
$dTag = $xml->createElement("d",$_REQUEST['d']);
$eTag = $xml->createElement("e",$_REQUEST['e']);
$fTag = $xml->createElement("f",$_REQUEST['f']);
$gTag = $xml->createElement("g",$_REQUEST['g']);
$hTag = $xml->createElement("h",$_REQUEST['h']);
$iTag = $xml->createElement("i",$_REQUEST['i']);
$jTag = $xml->createElement("j",$_REQUEST['j']);
$kTag = $xml->createElement("k",$_REQUEST['k']);
$lTag = $xml->createElement("l",$_REQUEST['l']);
$dataTag->appendChild($aTag);
$dataTag->appendChild($bTag);
$dataTag->appendChild($cTag);
$dataTag->appendChild($dTag);
$dataTag->appendChild($eTag);
$dataTag->appendChild($fTag);
$dataTag->appendChild($gTag);
$dataTag->appendChild($hTag);
$dataTag->appendChild($iTag);
$dataTag->appendChild($jTag);
$dataTag->appendChild($kTag);
$dataTag->appendChild($lTag);
$rootTag->appendChild($dataTag);
$xml->save("a.xml");
}
?>
Loading 1 | Loading 2 | ||
Door | Door | ||
Trailer | Trailer | ||
Store | Store | ||
Loading 3 | Loading 4 | ||
Door | Door | ||
Trailer | Trailer | ||
Store | Store |
a.xml
<?xml version="1.0"?>
<document>
<data><a>1</a><b>1</b><c>1</c><d>1</d><e>1</e><f>1</f><g>1</g><h>1</h><i>1</i><j>1</j><k>1</k><l>1</l></data>
</document>
loads.html(this is the lcd’s html)
[code]
3Js Loading SiteLoading 1 |
Loading 2 |
||
---|---|---|---|
Door |
{a} |
Door |
{d} |
Trailer |
{b} |
Trailer |
{e} |
Store |
{c} |
Store |
{f} |
Loading 3 |
Loading 4 |
||
Door |
{g} |
Door |
{j} |
Trailer |
{h} |
Trailer |
{k} |
Store |
{i} |
Store |
{l} |