<?
$username = '';
$top="
<html><body bgcolor=white text=black>
<table border=0 cellpadding=1 cellspacing=0 width=100% hegiht=100%>
<tr>
<td colspan=2><center>
if ($username == \"\") {
echo(\"you're not logged in\");
} else {
echo(\"you're logged in as $username\");
}
</center></td>
</tr>
<tr>
<td height=100% width=200 align=top>
<table border=0 width=100% height=100%>
<tr><td width=100% height=30><a href=index.php>Login</a></td></tr>
<tr><td width=100% height=30><a href=create.php?create=>Create Account</a></td></tr>
<tr><td width=100% height=30><a href=lostpassword.php?check=>Retrieve Lost Password</a></td></tr>
<tr><td height=* width=100%>
</table>
</td><td>
";
$bottom="</td></tr></table></body></html>
";
?>
vad är fel?
ThACRoWMedlem sedan dec. 2001314 inlägg Välkommen till webForum! :bire
Du kan inte ha PHP kod inne i en sträng. Utan du få lösa det så här:
<?
$username = '';
$top="
<html><body bgcolor=white text=black>
<table border=0 cellpadding=1 cellspacing=0 width=100% height=100%>
<tr>
<td colspan=2><center>" . ( $username == '' ? 'you\\'re not logged in' : 'you\\'re logged in as ' . $username ) . "</center></td>
</tr>
<tr>
<td height=100% width=200 align=top>
<table border=0 width=100% height=100%>
<tr><td width=100% height=30><a href=index.php>Login</a></td></tr>
<tr><td width=100% height=30><a href=create.php?create=>Create Account</a></td></tr>
<tr><td width=100% height=30><a href=lostpassword.php?check=>Retrieve Lost Password</a></td></tr>
<tr><td height=* width=100%>
</table>
</td><td>
";
$bottom="</td></tr></table></body></html>
";
?>