HowTo html input find/replace regex
Whenever I make a form, it’s a bit of a hassle to add in the php support. That is, if the page gets reloaded of sent back, we want to insure that all the valid data that was entered before is maintained.
And easy way to do this is:
Here is an easy way, tested in jedit, but should work with little to no modification in other regex capable editors:
Find: \<input name=”([\w]+)” value=”([\w]+)” />
Replace: <input name=”$1″ value=”<?= isset(\$_POST[‘$1’]) ? \$_POST[‘$1’] : ‘$3’ ?>” />
Related Posts via Taxonomies
- Spree Commerce, eBay Trading API, and the eBay Accelerator Toolkit from Intradesys EbatNs
- HowTo Knock it off with crazy MYSQL queries and the qTranslate plugin unistall
- Simple PHP closure/lamda/anonymous function usage.
- Rails 3 – PHP Style Global Variables, $_SESSION, $_GET, $_POST in the models, and everywhere.
- Firefox Content Encoding Error, PHP Website
- HTML5 Canvas: Smooth, variable width lines with transparency.
- HTML5 Canvas, Pixel Compositing, Transparency, and why all the trivia!
- Qt C++: Threaded Communication with Artema Hybrid on Linux
- Rails will_paginate links to wrong page
- Apache2/MySQL on Ubuntu Configuration
This entry was posted in PHP Tutorials
and tagged HowTo
. Bookmark the permalink