Translation script

You have a php problem and need help? Please post your questions in here!
You know that you are an expert in php? You are welcome to help other programmers!

Moderator: Scooby

Translation script

Postby Anwar » Sun Jul 24, 2005 6:56 pm

I have a problem in translation script

This is the code

///////////////////////////////////////////////////////////////////////
<?

$word = "translate".$_GET[word];
if(!$word)$word="translate";
$mor1='<a href="trans.php?mor=1">advanced search</a> ';
if($_GET[mor]){
$mor2 = '
exact<input type="radio" name="w" value="w1" checked>
start with<input type="radio" name="w" value="w2">
end with<input type="radio" name="w" value="w3">
<br>';
$mor1='';
}
?>
<html dir="rtl">
<head>
<title><?print $word;?></title>
</head>
<body>
<form action="trans.php" method="GET">
<center>
<div style="border:1px solid;background-color:#EEEEEE;width:50%">
<?print $mor1?>
<input type="text" name="word"><br>
<? print $mor2;?>
<input type="submit" value="translate">
</div>
</center>
</form>
<hr>

<?
$link = mysql_connect("localhost","ba7rainc_trans","password");
$db = mysql_select_db("ba7rainc_trans");
if($_GET[word]){
$word = addslashes($_GET[word]);
if(preg_match("/[a-zA-Z]/",$word)){
$lang = "en";
print "<div style=\"background-color:#efefef\"><hr>";
}else{
$lang = "ar";
$binary = "binary ";
print "<div style=\"background-color:#efefef\"><hr>";
}
$sql = "SELECT * FROM `trans` WHERE $lang LIKE $binary'%$word%' LIMIT 30";
switch($_GET[w]){
case "w1":
$sql = "SELECT * FROM `trans` WHERE $lang = $binary'$word' LIMIT 30";
break;
case "w2":
$sql = "SELECT * FROM `trans` WHERE $lang LIKE $binary'$word%' LIMIT 30";
break;
case "w3":
$sql = "SELECT * FROM `trans` WHERE $lang LIKE $binary'%$word' LIMIT 30";
break;
}
$query = mysql_query($sql);
/*line 58*/ while($found = mysql_fetch_array($query))
($lang=="en")? print $found[en]." : <b>".$found[ar]."</b><hr>\n" : print $found[ar]." : <b>".$found[en]."</b><hr>\n";

}
?>
</div>
</body>
</html>
////////////////////////////////////////////////////////////////

when i run it i got an error message

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/******/public_html/trans/trans.php on line 58

the line 58 is

while($found = mysql_fetch_array($query))

so could u help me???
Anwar
Newbie
Newbie
 
Posts: 8
Joined: Sat Jul 23, 2005 11:45 pm

php code

Postby php » Sun Jul 24, 2005 7:11 pm

What script is the code from?

Do you have a url so i can see the site?
php
 

Postby Anwar » Sun Jul 24, 2005 11:14 pm

Anwar
Newbie
Newbie
 
Posts: 8
Joined: Sat Jul 23, 2005 11:45 pm

Well Done

Postby hand536 » Wed Oct 12, 2005 12:40 pm

What script is the code from?


:(! nice :))
[url=http://ace-online-poker-top-rated.lavoa.com]ace online poker top-rated
[/url] [url=http://ace-online-poker-easy.1fh.net]ace online poker easy
[/url]
hand536
Newbie
Newbie
 
Posts: 2
Joined: Wed Oct 12, 2005 12:38 pm

Is It Illegal To Buy Lasix Online Matpauche

Postby Matpauche » Sun Aug 12, 2018 2:34 am

Tadalis Sx Soft Affiliate cialis for sale Presentazione Levitra
Propecia Experience Hair Transplant Side Effects Of Cephalexin 500mg Viagra Precio Farmacia cialis Propecia Cost Availability
Matpauche
Newbie
Newbie
 
Posts: 12
Joined: Thu Jun 14, 2018 4:21 am
Location: Latvia

Xenical Online Bestellen Schweiz Matpauche

Postby Matpauche » Sun Aug 12, 2018 2:35 am

Acticin Tablets With Free Shipping Stendra 100mg Drugs For Sale Levaquin Levox C.O.D online cialis Buy Trazadone
Propecia Experience Hair Transplant Side Effects Of Cephalexin 500mg Viagra Precio Farmacia cialis Propecia Cost Availability
Matpauche
Newbie
Newbie
 
Posts: 12
Joined: Thu Jun 14, 2018 4:21 am
Location: Latvia

Zithromax Against Chlamydia Matpauche

Postby Matpauche » Sun Aug 12, 2018 2:35 am

Where To Buy Lasix Water Pill where to buy cialis online safely Acheter Cialis Brand
Propecia Experience Hair Transplant Side Effects Of Cephalexin 500mg Viagra Precio Farmacia cialis Propecia Cost Availability
Matpauche
Newbie
Newbie
 
Posts: 12
Joined: Thu Jun 14, 2018 4:21 am
Location: Latvia


Return to php

Who is online

Users browsing this forum: No registered users and 3 guests

cron