OK, więc to mam w <head> na ustawianie div'a z danych w pliku:
<?
$records = file($plik, FILE_IGNORE_NEW_LINES
); foreach($records as $key => $row){
++$line;
list
($tmp['id'], $tmp['left'], $tmp['top']) = explode('|', rtrim($row)); $tmp['line'] = $line-1;
$records[$key] = $tmp;
}
foreach($records as $row){
#%s {
width: 200px;
height: 140px;
left: %spx;
top: %spx;
}
</style>', $row['id'], $row['left'], $row['top']);
}
?>
To jest <form>:
<form action="#" method="post">
TOP
<input type="text" name="1" id="1" size="30" value="" class="text-input" /> LEFT:
<input type="text" name="2" id="2" size="30" value="" class="text-input" /> <input type="submit" onclick='changeTextbox();' name="wyslij" id="wyslij" value="Send" />
No i kodzik na dodawanie:
<?php
if(isset($_POST['wyslij'])){ $cos = $_POST['1'];
$cos2 = $_POST['2'];
$file=fopen(''.$ip.'.txt', 'a'); fwrite($file, "cos3|$cos|$cos2\n"); echo 'plik nadpisano! - Zapisno cos3 '.$cos.' na '.$cos2.'<br>'; $records = file($plik, FILE_IGNORE_NEW_LINES
); foreach($records as $key => $row){
++$line;
list
($tmp['id'], $tmp['left'], $tmp['top']) = explode('|', rtrim($row)); $tmp['line'] = $line-1;
$records[$key] = $tmp;
}
foreach($records as $row){
echo sprintf('ID: %s. Left: %spx. Top: %spx.', $row['id'], $row['left'], $row['top']);
}
}else{
$file=fopen(''.$ip.'.txt', 'a'); echo'plik utworzono<br>'; }
}
?>
No i funkcja JS na pobieranie pozycji:
<script type="text/javascript"> function cos123321(){
d = document.getElementById("cos3");
topPos = d.offsetTop;
leftPos = d.offsetLeft;
document.getElementById("cos3").innerHTML=topPos+"na"+leftPos;
var notify2 = document.getElementById ('1');
if (notify2)
notify2.value = topPos;
var notify = document.getElementById ('2');
if (notify)
notify.value = leftPos;
setTimeout("cos123321()",1000 );
}
Może ktoś mi pomoże

Błagam