Søgefunktion fra asp til php
Jeg har en søgefunktion hvor jeg vælger en søgemaskine i dropdown menuen og skriver min forespørgsel i et txt felt. jeg har via en online asp to php translator fået "oversat" koden til php, men den melder stadig fejl. fejlen kan ses på http://www.marzman.dk/search.phpNogen med det afgørende "touch" til koden
Koden til search.asp
---
<%
text = replace(request("search"), " ", "+")
if request("location") = "jubii" then
response.redirect "http://search.jubii.dk/cgi-bin/pursuit?cat=loc&query=" & text
elseif request("location") = "yahoo" then
response.redirect "http://search.yahoo.com/search?p=" & text & "&ei=UTF-8&n=20&fl=0&x=wrt"
elseif request("location") = "eniro" then
response.redirect "http://www.eniro.dk/query?q=" & text & "&what=dk&stq=0"
elseif request("location") = "alltheweb" then
response.redirect "http://www.alltheweb.com/search?cat=web&cs=utf8&q=" & text & "&rys=0&_sb_lang=pref"
elseif request("location") = "dejanews" then
response.redirect "http://groups.google.com/groups?oi=djq&as_q=" & text
elseif request("location") = "altavista" then
response.redirect "http://dk.altavista.com/web/results?itag=wrx&q=" & text & "&kgs=1&kls=0"
elseif request("location") = "excite" then
response.redirect "http://msxml.excite.com/info.xcite/search/web/" & text
elseif request("location") = "hotbot" then
response.redirect "http://www.hotbot.com/?SM=MC&DV=0&LG=any&DC=10&DE=2&clickSrc=search&_v=2&OPs=MDRTP&MT=" & text
elseif request("location") = "google" then
response.redirect "http://www.google.com/search?q=" & text
elseif request("location") = "dkgoogle" then
response.redirect "http://www.google.com/search?q=" & text & "&meta=lr%3Dlang_da"
elseif request("location") = "dmoz" then
response.redirect "http://search.dmoz.org/cgi-bin/search?search=" & text
elseif request("location") = "teoma" then
response.redirect "http://s.teoma.com/search?q=" & text & "&qcat=1&qsrc=0"
end if%>
Koden til search.php
---
<?php
$location = $_REQUEST[location];
?>
<?php
$text = $_REQUEST[search];
?>
<?php
if (request("$location") == "jubii") {
response.redirect "http://search.jubii.dk/cgi-bin/pursuit?cat=loc&query="echo "$text";
} elseif (request("$location") == "yahoo") {
response.redirect "http://search.yahoo.com/search?p=" echo "$text" "&ei=UTF-8&n=20&fl=0&x=wrt";
} elseif (request("$location") == "eniro") {
response.redirect "http://www.eniro.dk/query?q="echo "$text" "&what=dk&stq=0";
} elseif (request("$location") == "alltheweb") {
response.redirect "http://www.alltheweb.com/search?cat=web&cs=utf8&q="echo "$text" "&rys=0&_sb_lang=pref";
} elseif (request("$location") == "dejanews") {
response.redirect "http://groups.google.com/groups?oi=djq&as_q="echo "$text";
} elseif (request("$location") == "altavista") {
response.redirect "http://dk.altavista.com/web/results?itag=wrx&q="echo "$text" "&kgs=1&kls=0";
} elseif (request("$location") == "excite") {
response.redirect "http://msxml.excite.com/info.xcite/search/web/"echo "$text";
} elseif (request("$location") == "hotbot") {
response.redirect "http://www.hotbot.com/?SM=MC&DV=0&LG=any&DC=10&DE=2&clickSrc=search&_v=2&OPs=MDRTP&MT=" echo "$text";
} elseif (request("$location") == "google") {
response.redirect "http://www.google.com/search?q=" echo "$text";
} elseif (request("$location") == "dkgoogle") {
response.redirect "http://www.google.com/search?q=" echo "$text" "&meta=lr%3Dlang_da";
} elseif (request("$location") == "dmoz") {
response.redirect "http://search.dmoz.org/cgi-bin/search?search="echo "$text";
} elseif (request("$location") == "teoma") {
response.redirect "http://s.teoma.com/search?q="echo "$text" "&qcat=1&qsrc=0";
}?>
Hilsen Søren