😕 Can someone see from the php script. tell me what cane of table I shoud create in MYSQL... Please...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Nyt diktat</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1 align="center">Nyt diktat</h1>
<form class="standard" action="select_audio.php?mode=create" method="post">
<p>
<label for="title">Titel:</label>
<input type="text" name="title" id="title"<? if(isset($_POST['title'])) echo " value=\"".$_POST['title']."\"";?> />
</p>
<p>
<label for="content">Indhold:</label><br />
<textarea name="content" id="content" cols="100" rows="40"><? if(isset($_POST['title'])) echo implode("",file("text/".$_POST['title'].".txt"));?></textarea>
</p>
<p>
<input type="submit" value="Vælg lyd" />
</p>
</form>
</body>
</html>
THIS IS THE 2.nd One
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<? if(file_exists("text/".$_POST['title'].".txt")) {
?>
<h1>Vælg lyd</h1>
<h3 style="color:#CC3333">Pas på! Der findes allerede et diktat med denne titel.<br />
Hvis du er ved at lave et nyt diktat, burde du gå <a href="javascript:history.back()">tilbage</a> og vælge en anden titel.
Gør du ikke det, bliver diktatet med titelen "<?=$_POST['title']?>" erstattet med dette diktat her!</h3>
<?
}
?>
<form enctype="multipart/form-data" action="save_dict.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="500000" />
<table border="0">
<?
$query = "SELECT word FROM repository";
$result = mysql_query($query) or die("Query failed ($query): " . mysql_error());
$word_start=0;
$word_stop=0;
$open=false;
$words=array();
$content=$_POST['content'];
for($i=0;$i<strlen($content);$i++) {
if(substr($content,$i,1)=="<" && !$open) {
$word_start=$i+1;
$open=true;
}
elseif(substr($content,$i,1)==">" && $open) {
$word_stop=$i;
$word=substr($content,$word_start,$word_stop-$word_start);
if(!in_array($word,$repository)) {
$words[]=$word;
?>
<tr>
<td><?=$word?></td>
<td><input type="file" name="<?=$word?>" /></td>
</tr>
<?
}
$open=false;
}
}
?>
</table>
<input type="hidden" name="words" value="<? echo implode(";",$words); ?>" />
<input type="hidden" name="content" value="<?=$_POST['content']?>" />
<input type="hidden" name="title" value="<?=$_POST['title']?>" />
<input type="submit" value="Upload & save" />
</form>
</body>
</html>