<?
include'functions.php';
//echo '<pre>'.print_r($_POST,TRUE).'</pre>';
if (isset($_POST['felvesz'])) {
$hany=file_get_contents('/tmp/cnt.txt');
$hany++;
file_put_contents('/tmp/cnt.txt',$hany);
HTML_Response('sorok.php',TRUE);
}
if (isset($_POST['js'])) {
JS_Response("alert('".JS_EnCode('<p>Paragraph</p>'.chr(10).'<span>Hibás tag-ek</div>')."')");
}
if (isset($_POST['ertek'])) {
if ($_POST['ertek']==111) {
HTML_Response($_POST['ertek'],TRUE);
} else {
JS_Response("alert('".JS_EnCode($_POST['ertek'])."')");
}
}
if (isset($_POST['delsor'])) {
$id=intval($_POST['delsor']);
// Törlés az adatbázisból
JS_Response("$('#elem".$id."').remove()");
}
header('Content-Type: text/html; charset=utf-8');
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jqForm</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://github.com/malsup/form/raw/master/jquery.form.js"></script>
<script type="text/javascript" src="js.php"></script>
<link type="text/css" href="style.css" rel="stylesheet"/>
</head>
<body>
<form method="post" action="<?=$_SERVER['PHP_SELF']?>" enctype="multipart/form-data">
<p><input type="file" name="adat"/></p>
<p><input type="text" name="ujsor"/> <?ElKuld('Felvesz','felvesz',"$('#sorok')",FALSE,FALSE,TRUE)?> <?ElKuld('JS','js')?></p>
<p><?ElKuld('Érték 1',array('ertek'=>111),"$('#ide')")?> <?ElKuld('Érték 2',array('ertek'=>'Másik érték'),"$('#ide')")?></p>
<h1 id="ide"></h1>
<table border="1">
<tbody id="sorok"><?
$hany=5;
file_put_contents('/tmp/cnt.txt',$hany);
include'sorok.php';
?></tbody>
</table>
</form>
<div><?highlight_file(__FILE__)?></div>
</body>
</html>