Kann mir mal irgendjemad helfen ???
In Zeile 47 & 57 --> Parse Error
In Zeile 47 & 57 --> Parse Error
Code:
<?php //Script © Matt Ford - [url]http://www.matthewford.co.uk[/url] //Free to distribute edit etc as long as this //remains. //Nun folgen die Verbindungseinstellungen $MYSQL_HOST = "localhost"; $MYSQL_USER = "root"; $MYSQL_PASS = "sql"; $DATABASE = "news"; //Verbindung zu DB-Server herstellen $db=mysql_connect($MYSQL_HOST,$MYSQL_USER,$MYSQL_PASS); mysql_select_db($DATABASE,$db); //Schreibe Formular if($write=="yes") { print("<form action=news.php method=post>"); print("Title:<input type=text name=title><br>"); print("Content:<textarea name=content cols=20 rows=5></textarea><br>"); print("Email:<input type=text name=email><br>"); print("Nickname:<input type=text name=nickname><br>"); print("Date:<input type=text name=date><br>"); print("Password:<input type=password name=pass><br>"); print("ID:<input type=text name=id><br>"); print("<input type=submit value=add>"); print("<input type=hidden name=add value=yes>"); print("</form>"); } //Daten hinzufügen if($add=="yes" && $pass=="password") { $db=mysql_connect($MYSQL_HOST,$MYSQL_USER,$MYSQL_PASS); mysql_select_db($DATABASE,$db); //add to database mysql_query("INSERT INTO news VALUES ('$title','$content','$email','$nickname','$date','$id')"); mysql_close(); } //read from database newset 5 stories $result=mysql_query("SELECT * FROM news ORDER BY id DESC LIMIT 0,5",$db); while ($myrow = mysql_fetch_row($result)) [b]<-- Zeile 47[/b] { print("<table width=100% bgcolor=FF9933 cellspacing=1>"); print("<tr><td bgcolor=808080><b>$myrow[0]</b></td></tr>"); print("<tr><td bgcolor=333333><font size=-1>$myrow[1]</font></td></tr>"); print("<tr><td bgcolor=808080 align=right><font size=-2><b>Submitted by <a href=mailto:$myrow[2]>$myrow[3]</a> on $myrow[4]</b></font></td></tr>"); print("</table>"); print("<br>"); } $result=mysql_query("SELECT * FROM news",$db); $rows = mysql_num_rows($result); [b]<-- Zeile 57[/b] print("<font color=cccccc>$rows total stories</font>"); mysql_close(); ?>
Kommentar