You are here: php/html editing help « PHP Programming Language « IT news, forums, messages
php/html editing help

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация