GetDotted Domains

Viewing Thread:
"javascript question"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Mon 02/12/02 at 17:43
Regular
Posts: 787
could anyone show me a script so that when a button is clicked a promt comes up and if someone types in say bob then they get directed to a website but alll those people who dont write bob get redirected to a different site.
Tue 03/12/02 at 00:03
Regular
"It goes so quickly"
Posts: 4,083
I agree, go with PHP .... if your host provides it, that is, as lie Tyla say, JavaScript isn't any good if the user turns it off. PHP can't be turned of by the user, so your 'bob' redirection thing will always work for the user.

Here you go, a little PHP Script to do what your after, just in case you do do in that direction.

Basicly, just put the 9 lines of code below in notepad and save it as a .php file, (e.g. bob.php)

---------------------------------------------

$Where = trim($Where);
$Where = strtolower($Where);

if ( isset($Where) && $Where == "bob") {
header("Location:bob_page.html");
} else {
header("Location:non_bob_page.html");
}
?>

---------------------------------------------

... and use this HTML code for the Form:

---------------------------------------------

My Page










---------------------------------------------

It's simple, but it works..... I hope :o)
Mon 02/12/02 at 21:57
Regular
"l33t cs50r"
Posts: 2,956
Tyla wrote:
> All pointless if you have Javascript disabled!

Oh.. also pointless as if you really want to get to the page for "bob" you just read the source code and find the word you need!

You need php...
Mon 02/12/02 at 21:55
Regular
"l33t cs50r"
Posts: 2,956
All pointless if you have Javascript disabled!
Mon 02/12/02 at 20:32
Regular
"You've upset me"
Posts: 21,152
you'd be better writing a function.

so...



then, in the main content add:



Mon 02/12/02 at 19:57
Regular
"tinycurve.gif"
Posts: 5,857
I can't be bothered to find out about the bit where you type "bob" and it redirects, and if you don't it redirects somewhere else, but this is the code for the button and prompt:





Mon 02/12/02 at 17:43
Regular
"www.funrunner.co.uk"
Posts: 289
could anyone show me a script so that when a button is clicked a promt comes up and if someone types in say bob then they get directed to a website but alll those people who dont write bob get redirected to a different site.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Easy and free service!
I think it's fab that you provide an easy-to-follow service, and even better that it's free...!
Cerrie
My website looks tremendous!
Fantastic site, easy to follow, simple guides... impressed with whole package. My website looks tremendous. You don't need to be a rocket scientist to set this up, Freeola helps you step-by-step.
Susan

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre
Feedback Close Feedback

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.