|
Posted by William Gill on 06/26/07 14:35
OK this may seem stupid, but I use this template for my php/html forms
so that processing and form are in the same document.
<?php if (array_key_exists('_submit_check',$_POST)) {
php code to process form data and html to display a message
to the user goes here.
...
...
<?php } else { ?> // close if block, open else block
html and form go here.
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="hidden" name="_submit_check" value="1"/>
...
...
<?php } ?> // close else block
In theory it's great, but after I get a whole lot of html in the gaps it
gets really hard to follow and edit, especially if I'm editing months later.
I tried indenting the html inserts, but as my php gets more involved,
and properly indented (especially in the processing block) that gets
pretty messy.
I thought about using includes, but that defeats having everything in
one place.
My html editor condenses the php to icons that can be toggled on or off
in WYSIWYG mode. Ideally an editor that does the same for the non-php
would be great.
Any suggestions on an editable style or on editors would be greatly
appreciated.
Navigation:
[Reply to this message]
|