Results 1 to 1 of 1
Thread: js input + php
Hybrid View
-
17th January 2011 20:54 #1
js input + php
, ..
:
. , . php , , :
, , php :Code:<?php if(isset($_POST['setON'])) {setON();} if(isset($_POST['setON'])) {setOFF();} function setON() { $dom = new DOMDocument(); $dom->load('DL385.xml'); $xpath = new DOMXPath($dom); $UIDs = $xpath->query('server/UID'); foreach($UIDs as $UID) { $a = $UID->nodeValue; // shortcut $new_value = 'ON'; $UID->nodeValue = "{$new_value}"; } $dom->save('DL385.xml'); } function setOFF() { $dom1 = new DOMDocument(); $dom1->load('DL385.xml'); $xpath1 = new DOMXPath($dom1); $UIDs1 = $xpath1->query('server/UID'); foreach($UIDs1 as $UID1) { $a1 = $UID->nodeValue; // shortcut $new_value1 = 'OFF'; $UID1->nodeValue = "{$new_value1}"; } $dom1->save('DL385.xml'); } ?>
, .. , DOM xml - , .. ?!?Code:<form method="POST"> <center> <br> <input name="setON" value="Turn Unit ID On" onclick="return areYouSure( this );" type="submit"> <input name="setOFF" value="Turn Unit ID Off" onclick="return areYouSure( this );" type="submit"> </center> </form>
,
---------- 21:46 ---------- 21:09 ----------
.. , : , .. ..
?
---------- 21:54 ---------- 21:46 ----------
- .. :
...Code:header("Location: file.php");




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in