if ($_GET['part'] == ""){ if ($_GET['do'] == "edit"){ mYsql_query("UPDATE site_news SET content = '".$_POST['content']."',subject = '".$_POST['subject']."' WHERE id = '".$_POST['id']."'"); echo '
Edit done!
'; } if ($_GET['do'] == "delete"){ mYsql_query("DELETE FROM site_news WHERE id = '".$_GET['id']."'"); echo '
Delete done!
'; } if ($_GET['do'] == "create"){ $time = date("d/m/Y"); mysql_query("INSERT INTO site_news (subject, wroteby, wrotedate,content) VALUES ('".$_POST['subject']."','".$_SESSION['kal_username']."','".$time."','".$_POST['content']."')"); echo '
The news are created!
'; } echo ' Only the 5 newest news will be showed. '; $query = mysql_query("SELECT * FROM site_news ORDER BY id DESC"); while($r = mysql_fetch_array($query)){ echo ''; } echo '
Subject: Written By: Date: - New News -
'.$r['subject'].''.$r['wroteby'].' '.$r['wrotedate'].' Delete - Edit
'; } else if ($_GET['part'] == "new"){ echo '
You can use the following BBCodes: [b][/b], [i][/i], [u][/u], [center][/center] and [url=the-address]Name of like[/url]. You can\'t use any html tags.

Subject:

'; } else if ($_GET['part'] == "edit"){ $query = mysql_query("SELECT * FROM site_news WHERE id = '".$_GET['id']."'"); while($r = mysql_fetch_array($query)){ echo '
You can use the following BBCodes: [b][/b], [i][/i], [u][/u], [center][/center] and [url=the-address]Name of like[/url]. You can\'t use any html tags.

Subject:

'; } } echo '
'; ?>