PDA

View Full Version : please can you help me?


wappo
07-30-2003, 08:01 PM
Hello, i am creating a website at wappo.co.uk (http://www.wappo.co.uk) and i am also creating a wap site a the same address. I was given this piece of coding below to distinguish wheather the page was written in WML or HTML and i was told to include it into an ASP page. But i don't have a clue how to do this or what file extension to use please can you help me?



<%
h1 = Request.ServerVariables("HTTP_USER_AGENT")
h2 = Request.ServerVariables("HTTP_ACCEPT")
if Left(h1, 4) = "UP.B" or _
Left(h1, 4) = "Noki" or _
Left(h1, 4) = "Eric" or _
Instr(h2, "wml") <> 0 then
Response.Redirect "home.wml"
else
Response.Redirect "home.html"
end if
%>

WA
07-30-2003, 08:30 PM
Hi:
Welcome to CodingForums.com. In the future please use a more descriptive subject for your question. See http://www.codingforums.com/postguide.htm

oracleguy
07-30-2003, 09:05 PM
Rename the file you put the code in to .asp

And since your using Response.Redirect, you need to place that block of code above all the HTML in your page. Then view it through your webserver and it should work.

wappo
07-30-2003, 09:44 PM
Thanks for your help! :)