Posted by Toby Inkster on 11/24/46 11:46
Dustin wrote:
> <script>
> function redirect()
> {
> var domain = "exampledomain.com";
> var name = document.getElementById("name").value;
> name = name.toLowerCase(); //put everthing in lower case
> name = name.replace(" ", "");
> document.location.href = "http://" + name + "." + domain;
> }
> </script>
What if the user doesn't have Javascript enabled? Important things like
navigation shouldn't rely on client-side scripting.
What if they type in the name "John O'Groats"? Treat all user input as
hostile by default.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Navigation:
[Reply to this message]
|