I want to make a block for the Vandale. Its a dutch wordsbook.
But when i want to post the vars.. i cant see them return..
Below is the code i put into a PHP block
Code
/*Naam: vandale woordenboek
Gemaakt door: Ruud Slaats(script@nitthoes.com
Datum: 10 februari 2004
www.nitthoes.com
versie 1.0*/
$zoekwoord=$HTTP_POST_VARS["zoekwoord"];
$zoekwoord=stripslashes($zoekwoord);
$keyword=htmlspecialchars($zoekwoord);
//echo'<form action="';print $PHP_SELF;echo'" method="post">'
echo'<form action="index.php" method="post">'
.'<table cellspacing="0" cellpadding="4" border="0">'
.'<tr>'
.'<td colspan="2" align="left">Zoek in de VanDale<br /></td>'
.'</tr>'
.'<tr>'
.'</tr>'
.'<tr>'
.'<td><input type="text" size="18" id="zoekwoord2" name="zoekwoord" style="width: 100px;">'
.'<input name="submit" type="submit" value="Zoek!"></td>'
.'</tr>'
.'<tr>'
.'<td>';
//if (strlen($zoekwoord) > 0){
$resultaat=searchVandale($zoekwoord);
print $resultaat;
//}
function searchVandale($zoekwoord)
{
$searchStatus=0;
$searchFor=$zoekwoord;
$vandaleCon=fopen("http://www.vandale.nl/opzoeken/woordenboek/?zoekwoord=$searchFor","r");
if(!$vandaleCon)
{
return "could not connect with vandale";
}
else
{
while(!feof($vandaleCon))
{
$currentString=fgetss($vandaleCon,4096);
if(preg_match("/\bRESULTAAT\b/i",$currentString))
{
$searchStatus=1;
fgets($vandaleCon);
fgets($vandaleCon);
fgets($vandaleCon);
$result=trim(fgetss($vandaleCon,4096));
//$result=html_entity_decode($result);
$result=ereg_replace("·","·",$result);
$result=ereg_replace("~","~",$result);
$result=ereg_replace("é","é",$result);
$result=ereg_replace("ï","ï",$result);
// argh
}
}
fclose($vandaleCon);
if($searchStatus==0) return "niets gevonden over $searchFor";
else return $result;
}
}
echo'</td></tr>'
.'</table>'
.'</form>';
Gemaakt door: Ruud Slaats(script@nitthoes.com
Datum: 10 februari 2004
www.nitthoes.com
versie 1.0*/
$zoekwoord=$HTTP_POST_VARS["zoekwoord"];
$zoekwoord=stripslashes($zoekwoord);
$keyword=htmlspecialchars($zoekwoord);
//echo'<form action="';print $PHP_SELF;echo'" method="post">'
echo'<form action="index.php" method="post">'
.'<table cellspacing="0" cellpadding="4" border="0">'
.'<tr>'
.'<td colspan="2" align="left">Zoek in de VanDale<br /></td>'
.'</tr>'
.'<tr>'
.'</tr>'
.'<tr>'
.'<td><input type="text" size="18" id="zoekwoord2" name="zoekwoord" style="width: 100px;">'
.'<input name="submit" type="submit" value="Zoek!"></td>'
.'</tr>'
.'<tr>'
.'<td>';
//if (strlen($zoekwoord) > 0){
$resultaat=searchVandale($zoekwoord);
print $resultaat;
//}
function searchVandale($zoekwoord)
{
$searchStatus=0;
$searchFor=$zoekwoord;
$vandaleCon=fopen("http://www.vandale.nl/opzoeken/woordenboek/?zoekwoord=$searchFor","r");
if(!$vandaleCon)
{
return "could not connect with vandale";
}
else
{
while(!feof($vandaleCon))
{
$currentString=fgetss($vandaleCon,4096);
if(preg_match("/\bRESULTAAT\b/i",$currentString))
{
$searchStatus=1;
fgets($vandaleCon);
fgets($vandaleCon);
fgets($vandaleCon);
$result=trim(fgetss($vandaleCon,4096));
//$result=html_entity_decode($result);
$result=ereg_replace("·","·",$result);
$result=ereg_replace("~","~",$result);
$result=ereg_replace("é","é",$result);
$result=ereg_replace("ï","ï",$result);
// argh
}
}
fclose($vandaleCon);
if($searchStatus==0) return "niets gevonden over $searchFor";
else return $result;
}
}
echo'</td></tr>'
.'</table>'
.'</form>';
when i use it standalone it works perfectly.. But in a block it wont work..
Please help..
