In wcms i have included the search-php by
[PHP]
include('search.php');
[/PHP]
which works well. The search.php looks like this:
Code: Select all
<?php
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("bibliographie") or die(mysql_error());
if(isset($_GET['s'])){
echo "<title>Suche nach: \"".$_GET['s']."\"</title>Suche nach: \"".$_GET['s']."\"<br><hr>";
$q = mysql_query("SELECT * FROM `literaturrecherche` WHERE `Titel` LIKE '%$_GET[s]%' OR `Autor` LIKE '%$_GET[s]%' OR `ln` LIKE '%$_GET[s]%' OR `Hrsg` LIKE '%$_GET[s]%' OR `Jahr` LIKE '%$_GET[s]%' OR `Untertitel` LIKE '%$_GET[s]%' OR `Ort_Verlag` LIKE '%$_GET[s]%' OR `Land` LIKE '%$_GET[s]%' OR `Abstract` LIKE '%$_GET[s]%' OR `Schlagworte` LIKE '%$_GET[s]%' OR `Art_Sprache` LIKE '%$_GET[s]%'") or die(mysql_error());
if(!is_array(mysql_fetch_array($q))){
echo "<br><BR>Es wurde kein Datensatz gefunden.";
}else{
$q = mysql_query("SELECT * FROM `literaturrecherche` WHERE `Titel` LIKE '%$_GET[s]%' OR `Autor` LIKE '%$_GET[s]%' OR `ln` LIKE '%$_GET[s]%' OR `Hrsg` LIKE '%$_GET[s]%' OR `Jahr` LIKE '%$_GET[s]%' OR `Untertitel` LIKE '%$_GET[s]%' OR `Ort_Verlag` LIKE '%$_GET[s]%' OR `Land` LIKE '%$_GET[s]%' OR `Abstract` LIKE '%$_GET[s]%' OR `Schlagworte` LIKE '%$_GET[s]%' OR `Art_Sprache` LIKE '%$_GET[s]%'") or die(mysql_error());
while($r = mysql_fetch_array($q)){
echo "<strong>".$r['Autor']." ".$r['Jahr']."</strong><br>".$r['Hrsg']."<br>".$r['Titel']."<br>".$r['Untertitel']."<br>".$r['ln']."<br>".$r['Ort_Verlag']."<br>".$r['Abstract']."<br>".$r['Schlagworte']."<br>".$r['Art_Sprache']."<br><hr>";
}}
}else{
[b]echo "<form method=get action=index.php><input type=text name=";echo"id=0,166,0,0,1,0&s;";echo"><input type=submit value=\"Search\"></form><br>";
}[/b]
?>
my problem is, that the searchform answers with a new link in the form of search.php?s=searchterm which is incompatible with the wcms pageform (e.g.) index.php?id=0,166,0,0,1,0. By handtyping the URL index.php?id=0,166,0,0,1,0&s=searchterm i get the correct results, thats why i tried to displace the "s" by "index.php?id=0,166,0,0,1,0" into the code (i separated it in my code with additionally echo commands to make it more visible for my own -> Bold) but in action it echos id%3D0%2C166%2C0%2C0%2C1%2C0%26s%C3%84=searchterm.
As i am not so familiar with php coding, i dont know how to enter the correct form. I know its possible to "translate" the sign (e.g.) "=" by "3D" in hex (which is proceeded by the form), but how to enter it into the code?
Mybe there is a very simple conclusion i didnt find yet.
Many thanx in advance!!