Thursday, December 24, 2009

Coding question...java maybe...?

I know html fairly well, but am coming up with a small problem. I have searched the web for the solution but have found nothing so far and am hoping yall can help.





I need to create a textbox on my page where they type in any text and it redirects them to a subdomain with that same text.





For example...In the textbox, they type 'bgates' and then it redirects them to http://bgates.maindomain.com . I don't want to have to hardcode each subdomain into a form, I need the script to just tack it on to xxxx.maindomain.com automatically.





Java maybe? Any help is appreciated!Coding question...java maybe...?
You could use Javascript. In the example below, submitting ';answers'; would take you to answers.yahoo.com';.





%26lt;html%26gt;


聽聽%26lt;input type=';text'; onchange=


聽聽聽聽';window.location='http://' + this.value+'.yahoo.com'';%26gt;


聽聽%26lt;input type=';submit'; value=';Redirect';%26gt;


%26lt;/html%26gt;Coding question...java maybe...?
You can try Servlets - Doget() or Dopost() for placing the value of the Text box in the Servlets methods and calling the same which redirects to your link.
  • oil production
  • cream
  • medicine cream
  • motorcycle oil
  • No comments:

    Post a Comment