Hi all
This script works properly it reads the information from a text (.txt) .
But I want it to read from ( .sql) I've tried many times but unfortunatly I couldn't because I am a new to this language (php).
who can modify this script and write it completely.
<html dir="rtl">
<head>
<title><?print $word;?></title>
</head>
<body>
<form action="trans.php" method="GET">
<center>
<div style="border:1px solid;background-color:white;width:50%">
<?print $mor1?>
<input type="text" name="word"><br>
<br>
<input type="submit" value="translate">
</div>
</center>
</form>
<hr>
<?
if($GET[word])
{
$word = addslashes($GET[word]);
$filename = 'translation.txt';
$fp = fopen($filename, "r");
$data = fread($fp, filesize($filename));
$split_data = explode("\n", $data);
print "<div style=\"background-color:white\"> The definition of the word : $word<hr>";
for($i=0;$i < sizeof($split_data);$i++)
{
list($en, $ar) = explode("=", $split_data[$i]);
if ($word === $en)
{
print $en." : <b>".$ar."</b><hr>\n";
break;
}
elseif(stristr($en,$word))
{
print $en." : <b>".$ar."</b><hr>\n";
}
}
}
?>
</div>
</body>
</html>
Thank you in advance