You are here: Re: inclosed variable heredoc « PHP Programming Language « IT news, forums, messages
Re: inclosed variable heredoc

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]


Удаленная работа для программистов  •  Как заработать на 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

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