Can someone see by the PHP what Table in the SQL database I have to make??
[PHP]<?
require("databa se.inc.php");
connectDatabase ();
?><!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><?=$_G ET['title']?></title>
<script type="text/javascript">
function playAudioClip(i d) {
document.AudioB ox.playSoundtra ck("audio/"+id+".au") ;
}
</script>
<link href="style.css " rel="stylesheet " type="text/css" />
</head>
<body class="dictate" >
<form class="dictate" action="result. php" method="post">
<input type="hidden" name="title" value="<?=$_POS T['title']?>" />
<h1><?=$_POST['title']?></h1>
<?
$ids="";
$word_start=0;
$word_stop=0;
$open=false;
$words=array();
$content=file(" text/".$_POST['title'].".txt");
foreach($conten t as $line) {
echo "<p>";
for($i=0;$i<str len($line);$i++ ) {
if(substr($line ,$i,1)=="<" && !$open) {
$word_start=$i+ 1;
$open=true;
}
elseif(substr($ line,$i,1)==">" && $open) {
$word_stop=$i;
$word=substr($l ine,$word_start ,$word_stop-$word_start);
$result=mysql_q uery("SELECT id FROM repository WHERE word='".$word." ';");
list($id)=mysql _fetch_array($r esult);
$ids.="audio/".$id.".au# ";
?> <input type="text" name="word_<?=$ id?>" value="" size="<?=strlen ($word)?>" onclick="playAu dioClip(<?=$id? >)" onfocus="playAu dioClip(<?=$id? >)" /> <?
$open=false;
}
elseif(!$open) {
echo substr($line,$i ,1);
}
}
echo "</p>";
}
?>
<input type="submit" value="Vis resultat" />
</form>
<applet code="AudioBox. class" name="AudioBox" width="0" height="0">
<param name="ab0" value="<?=$ids? >">
</applet>
</body>
</html>
[/PHP]
Here are the second PHP.....
[PHP]<?
require("databa se.inc.php");
connectDatabase ();
?><!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>Gem diktat</title>
<link href="style.css " rel="stylesheet " type="text/css" />
</head>
<body>
<?
$words=explode( ";",$_POST['words']);
foreach($words as $word) {
mysql_query("IN SERT INTO repository SET `word`='".$word ."';");
move_uploaded_f ile($_FILES[$word]['tmp_name'],"audio/".mysql_insert_ id().".au");
}
$handle=fopen(" text/".$_POST['title'].".txt","w+" );
fputs($handle,$ _POST['content'],strlen($_POST['content']));
fclose($handle) ;
?>
Diktatet er gemt!
</body>
</html>
[/PHP]
[PHP]<?
require("databa se.inc.php");
connectDatabase ();
?><!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><?=$_G ET['title']?></title>
<script type="text/javascript">
function playAudioClip(i d) {
document.AudioB ox.playSoundtra ck("audio/"+id+".au") ;
}
</script>
<link href="style.css " rel="stylesheet " type="text/css" />
</head>
<body class="dictate" >
<form class="dictate" action="result. php" method="post">
<input type="hidden" name="title" value="<?=$_POS T['title']?>" />
<h1><?=$_POST['title']?></h1>
<?
$ids="";
$word_start=0;
$word_stop=0;
$open=false;
$words=array();
$content=file(" text/".$_POST['title'].".txt");
foreach($conten t as $line) {
echo "<p>";
for($i=0;$i<str len($line);$i++ ) {
if(substr($line ,$i,1)=="<" && !$open) {
$word_start=$i+ 1;
$open=true;
}
elseif(substr($ line,$i,1)==">" && $open) {
$word_stop=$i;
$word=substr($l ine,$word_start ,$word_stop-$word_start);
$result=mysql_q uery("SELECT id FROM repository WHERE word='".$word." ';");
list($id)=mysql _fetch_array($r esult);
$ids.="audio/".$id.".au# ";
?> <input type="text" name="word_<?=$ id?>" value="" size="<?=strlen ($word)?>" onclick="playAu dioClip(<?=$id? >)" onfocus="playAu dioClip(<?=$id? >)" /> <?
$open=false;
}
elseif(!$open) {
echo substr($line,$i ,1);
}
}
echo "</p>";
}
?>
<input type="submit" value="Vis resultat" />
</form>
<applet code="AudioBox. class" name="AudioBox" width="0" height="0">
<param name="ab0" value="<?=$ids? >">
</applet>
</body>
</html>
[/PHP]
Here are the second PHP.....
[PHP]<?
require("databa se.inc.php");
connectDatabase ();
?><!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>Gem diktat</title>
<link href="style.css " rel="stylesheet " type="text/css" />
</head>
<body>
<?
$words=explode( ";",$_POST['words']);
foreach($words as $word) {
mysql_query("IN SERT INTO repository SET `word`='".$word ."';");
move_uploaded_f ile($_FILES[$word]['tmp_name'],"audio/".mysql_insert_ id().".au");
}
$handle=fopen(" text/".$_POST['title'].".txt","w+" );
fputs($handle,$ _POST['content'],strlen($_POST['content']));
fclose($handle) ;
?>
Diktatet er gemt!
</body>
</html>
[/PHP]
Comment