Placing html and php in a php variable?
Posted: Mon Oct 28, 2002 4:23 am
I am working on a script that contains a form, as it is complicated and probably not possible to use headers to redirect the user to different pages I am writing this script with variables to print blocks of html, one of those blocks is a login page if a new user joins up, the problem is that I am getting parse errors with a variable that contains html and php code, is this possible to do? or can a variable not contain both?
Example:
Thanks
Example:
Code: Select all
$login_page='<STYLE TYPE="text/css">
<--
.style1 { font-size: 11px; }
.style2 { font-size: 12px; }
--></STYLE>
<script SOME_JAVASCRIPT>
<P ALIGN CENTER><?php include "footer.html";?></P></TD>
<TD HEIGHT=15 WIDTH=512 COLSPAN=2 VALIGN=TOP>
<P><?PHP
if empty($welcometext) {
$text1="Enter your password";
} else {
echo "$welcometext);
}
?>
</P></TD></TR>
<TR><TD HEIGHT=20
MORE HTML