webForumDet fria alternativet

hjälp

PHPur PHP

2 svar · 119 visningar · startad av fearphage

fearphageMedlem sedan maj 20023 inlägg
#1

<?
$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?

fearphageMedlem sedan maj 20023 inlägg
#2

det blir bara helt vitt... http://213.66.135.110/testor/config.php

ThACRoWMedlem sedan dec. 2001314 inlägg
#3

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> 

"; 
?>
132 ms totalt · 3 externa anrop · v20260731065814-full.29ac60f6
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
128 ms — hämta tråd, inlägg och bilagor (db)