HTML PHP Presentation and Logic
- From: richard.hyett@xxxxxxxxx
- Date: 29 Sep 2005 07:10:53 -0700
I'm trying to keep presentation and logic seperate.
my application pulls out data from a MYSQL database and displays it on
a web page.
If there is a certain string in one of the displayed fields then I want
to output a whole load of html with a single php variable in the
middle, the obvious way to do this is to is to stack all the html in a
$variable, but then I am mixing up the presentation and logic. Any
suggestions
function($databasefieldcontent)
if (strpos($databasefieldcontent, 'needle')) {
$html="<a href=". <?echo $url?> . ">
<img height=22 alt="Awarding Body Information"
src="graphics/arrow_right.gif" width=30 border=0></a>"}
else {$html="";}
return $html;
}
end function
.
- Follow-Ups:
- Re: HTML PHP Presentation and Logic
- From: spkersten
- Re: HTML PHP Presentation and Logic
- Prev by Date: Re: Call to a member function on a non-object
- Next by Date: Convert numbers to letters in frensh
- Previous by thread: Re: PHP,PEAR DB numRows Hack for Oracle Not Working
- Next by thread: Re: HTML PHP Presentation and Logic
- Index(es):