Her er koden...
<?php
session_start();
//script til at lave indlæg for spillere
//Dette må gøres af alle også gæster.
// Det er vigtigt at hold_id er til stede, ellers ved systemet ikke hvilket hold indlægget tilhører.
require_once("global_user_validator.php");
require_once("db_connect.php");
$hold_id = $_REQUEST['hold'];
if (!$hold_id) {
echo "Der er opstået en fejl. Manglende Hold_ID. Kontakt Systemadministrator.";
return;
}
else {
add_post_player();
}
function add_post_player() {
$width=475;
$height=200;
$content='';
if (isset($_SESSION['username'])) {
$username = $_SESSION['username'];
}
else {
$username = "";
}
?>
<script language = "JavaScript">
function savedocument() {
document.saveform.content.value = null;
document.saveform.content.value = iView.document.documentElement.outerHTML;
}
</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<title>fcva.dk</title>
<style type="text/css">
body{
font: normal 1em/1.7em Verdana, sans-serif;
}
h1{
font: bold 1.8em Verdana, sans-serif;
}
h2{
font: bold 1.6em Verdana, sans-serif;
}
h3{
font: bold 1.4em Verdana, sans-serif;
}
h4{
font: bold 1.2em Verdana, sans-serif;
}
h5{
font: bold 1em Verdana, sans-serif;
}
h6{
font: bold .8em Verdana, sans-serif;
}
.butClass{
border: #dfdfdf 1px solid;
cursor: pointer;
}
li p,li h1,li h2,li h3,li h4,li h5,li h6{
margin:0px;
padding:0px;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body onLoad="Init()">
<form method=POST enctype="multipart/form-data" name="saveform" onSubmit="savedocument()" action="update_post_player_database.php?hold=<?php echo $_REQUEST['hold']; ?>" id="WYSIWYGUpdateForm">
<input type="hidden" name="MAX_FILE_SIZE" value="2097152">
<input type="hidden" name="content">
<script language="JavaScript" type="text/javascript" src="browserdetect.js"></script>
<script language="JavaScript" type="text/javascript" src="editor.js"></script>
Overskrift
<input type="text" value="" size="50" name="overskrift">
<br>
Bruger
<input type="text" value=" <?php echo $username; ?> " size="20" name="user">
<textarea style="display: none;" id="iView_content" name="theText" rows="1" cols="1"><?php echo $content ?></textarea>
<table cellpadding="5" cellspacing="0" border="2" bgcolor="#dfdfdf">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" colspan="2">
<div id="toolbars">
<img alt="Bold" title="Bold" class="butClass" src="images/T_bold.gif" onMouseOver="selOn(this)" onMouseOut="selOff(this)" onMouseDown="selDown(this, 'T_bold_down.gif')" onMouseUp="selUp(this, 'T_bold.gif')" onClick="DoTextFormat('bold','')">
<img alt="Italic" title="Italic" class="butClass" src="images/T_italic.gif" onMouseOver="selOn(this)" onMouseOut="selOff(this)" onMouseDown="selDown(this, 'T_italic_down.gif')" onMouseUp="selUp(this,'T_italic.gif')" onClick="DoTextFormat('italic','')">
<img alt="Underline" title="Underline" class="butClass" src="images/T_underline.gif" onMouseOver="selOn(this)" onMouseOut="selOff(this)" onMouseDown="selDown(this, 'T_underline_down.gif')" onMouseUp="selUp(this, 'T_underline.gif')" onClick="DoTextFormat('underline','')">
<img alt="|" src="images/separator.png">
<img alt="Left" title="Left" class="butClass" src="images/T_left.gif" onMouseOver="selOn(this)" onMouseOut="selOff(this)" onMouseDown="selDown(this, 'T_left_down.gif')" onMouseUp="selUp(this, 'T_left.gif')" onClick="DoTextFormat('justifyleft','')">
<img alt="Center" title="Center" class="butClass" src="images/T_center.gif" onMouseOver="selOn(this)" onMouseOut="selOff(this)" onMouseDown="selDown(this, 'T_center_down.gif')" onMouseUp="selUp(this, 'T_center.gif')" onClick="DoTextFormat('justifycenter','')">
<img alt="Right" title="Right" class="butClass" src="images/T_right.gif" onMouseOver="selOn(this)" onMouseOut="selOff(this)" onMouseDown="selDown(this, 'T_right_down.gif')" onMouseUp="selUp(this, 'T_right.gif')" onClick="DoTextFormat('justifyright','')">
<img alt="|" src="images/separator.png">
<img alt="Ordered List" title="Ordered List" class="butClass" src="images/T_orderedlist.gif" onMouseOver="selOn(this)" onMouseOut="selOff(this)" onMouseDown="selDown(this,'T_orderedlist_down.gif')" onMouseUp="selUp(this, 'T_orderedlist.gif')" onClick="DoTextFormat('insertorderedlist','')">
<img alt="Bulleted List" title="Bulleted List" class="butClass" src="images/T_bulletedlist.gif" onMouseOver="selOn(this)" onMouseOut="selOff(this)" onMouseDown="selDown(this, 'T_bulletedlist_down.gif')" onMouseUp="selUp(this, 'T_bulletedlist.gif')" onClick="DoTextFormat('insertunorderedlist','')">
<img alt="Indent" title="Indent" src="images/T_indent.gif" class=butClass onMouseOver="selOn(this)" onMouseOut="selOff(this)" onMouseDown="selDown(this, 'T_indent_down.gif')" onMouseUp="selUp(this, 'T_indent.gif')" onClick="DoTextFormat('indent','')">
<img alt="Outdent" title="Outdent" src="images/T_outdent.gif" class=butClass onMouseOver="selOn(this)" onMouseOut="selOff(this)" onMouseDown="selDown(this, 'T_outdent_down.gif')" onMouseUp="selUp(this, 'T_outdent.gif')" onClick="DoTextFormat('outdent','')">
<img alt="|" src="images/separator.png">
<img alt="Horizontal Rule" title="Horizontal Rule" class="butClass" src="images/T_line.gif" onMouseOver="selOn(this)" onMouseOut="selOff(this)" onMouseDown="selDown(this, 'T_line_down.gif')" onMouseUp="selUp(this, 'T_line.gif')" onClick="DoTextFormat('inserthorizontalrule','')">
</div>
</td>
</tr>
</table>
<iframe id="iView" style="margin-left: 3px; background-color: white; color: black; width:<?php echo $width ?>px; height:<?php echo $height ?>px"></iframe>
<table width="<?php echo $width ?>" border="0" cellspacing="0" cellpadding="0" bgcolor="#dfdfdf">
<tr>
<td>
</td>
<td align="right">
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<input type=submit value="Submit" name="WYSIWYG_submit"><br><br>
</form>
</body>
</html>
<?php } ?>