arithma wroteThere are a few associative array to presentation kind of views for PHP if that's what you meant. I could use a tip of that myself though.
I was thinking something like that... :-D ...
<?php
include('app.php');
include('lib/magic_form.php');
magic_form_init_db("localhost", "MySqlUser", "MySqlPass", "DbName")
?>
<script src="js/magic_form.php"></script>
<form magic_form_bind_table="tableName" magic_form_match="id=<?=$id?>">
<input magic_form_bind_field="colName">
<input magic_form_bind_field="colName2"
</form>
This is very rough, i'm think there are better ways to do this... but the idea is that by using a js include and a php include, you create placeholders in the HTML, and "bind" these to elements in the database, and then you dont need to worry about the whole POST-Query and all that sequence. It is all handled in the "magic_form" library. If the value changes in the database, then it will change in the UI, and if the user changes it and submits, then it will also be saved in the database.
Regular php variables, ex:
<?php
$var = "Hello World";
?>
<html>
<body>
<h2><?php echo $var ?></h2>
</body>
</html>
Are unidirectional, in the sense where they appear on the server-generated page, but if you want to do the same stuff but the other way round... that is have the user generate a fill a variable...then you have to go through the complicated and annoying POST stuff.
So what I'm thinking is it would be nice if it was as easy in both directions, and ever more, if the same variable (what i called placeholder earlier) could be used for both directions.
I think it can be possible if we user both PHP and JavaScript (and they communicate among themselves).