|
|
#1 (permalink) |
|
Üyelik Tarihi: 12.01.2008
Yer: ordu
Yaş: 24
Mesaj: 7
|
İmage not taki php yi asp koduna çevirebilir miyiz.
Kod:
<?PHP /****** PARAMS ***********/ $filename = "pn_table.PHP"; /*************************/ if (isset($_POST['str'])){ $str = trim( htmlspecialchars($_POST['str'], ENT_QUOTES) ); $ptn = '/c=(.*?)_l=(.*?)_t=(.*?)_w=(.*?)_h=(.*?)_/is'; if (preg_match_all($ptn, $str, $noteary)){ //The length of the second components of the two-dimensional array $n_max = count($noteary[0]); $fp = fopen($filename, 'w'); fwrite($fp, '<script>'); ob_start(); for ($i=0; $i<$n_max; $i++){ $c = $noteary[1][$i]; $l = $noteary[2][$i]; $t = $noteary[3][$i]; $w = $noteary[4][$i]; $h = $noteary[5][$i]; write_code($i,$c,$l,$t,$w,$h); } $jscode = ob_get_clean(); fwrite($fp, $jscode); fwrite($fp, '</script>'); fclose($fp); } else { exit('No data to be saved.'); } echo 'Data saved.'; } else { exit('No data sending.'); } ?> <?PHP //Write JS code for each PhotoNoteRect function write_code($i,$c,$l,$t,$w,$h){ ?> noteAry[<?PHP echo $i;?>] = new PhotoNote('<?PHP echo $c;?>',3,new PhotoNoteRect(<?PHP echo $l;?>,<?PHP echo $t;?>,<?PHP echo $w;?>,<?PHP echo $h;?>)); noteAry[<?PHP echo $i;?>].onsave = function (note) { return 1; }; noteAry[<?PHP echo $i;?>].ondelete = function (note) {this.text = "";return true;}; notes.AddNote(noteAry[<?PHP echo $i;?>]); <?PHP }/* END */ ?> |
|
|
|
Zoque'a hoşgeldiniz!