|
Posted by Janwillem Borleffs on 12/20/06 21:54
hihibibihi@hotmail.com wrote:
> But i dont think i made clear enough what i was aiming at (sorry about
> that): i wrote a webform (html code stored in $text), if user hits
> submit-button without filling in required formfields, form should
> reappear with warning -message added (stored in $foo)
>
HTML code stored in $text? Why not use static HTML with inline code blocks:
<html>
<body>
<?php if (!isset($_POST['foo'])) { ?>
Foo isn't set
<?php } ?>
</body>
</html>
Anyways, you can use stringified HTML and combine it with Toby's suggestion:
<?php
$html = '<html><body>%s</body></html>';
$err = '';
if (true) $error = 'You forgot to supply foo';
printf($html, $error);
?>
JW
Navigation:
[Reply to this message]
|