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.
I'm after a little bit of code that can take in any query string from the Web Address, and store it as a normal variable, ready for use in the script.
For example: index.php?User=Chris&Age=20
I'd like to be able to get the info from User (in this case, Chris) and be able to use it in the script.
Can anyone shed some light onto the possible code??
I know PHP would do this in a sinch, but this particular host doens't have PHP.
Thanks :).
I owe you one.
to split the url it would just be:
var urlsplit=location.href.split('/')
urlsplit[1] would then be what I've defined as string above.
:-D
How would I implement the split() function to get the Site Address ... is there a pre-defined var for the address the browser is currently at??
eg:
var this_site = doccument.url;
an_array = split(this_site);
????
Thanks :)
Thanks I'll give that a go.
Hidden Inputs could work, but I'd prefer using Text Links rather than Form Buttons.
var name=address[4] or whatever. Would take some working out to narrow the split down to the name and age but it would work. As M_m said, a bit clunky but it'll do what it needs to.
Address given is: index.php?name=Chris&age=20
Hidden input forms on page:
These are filled with the values, then use Javascript:
That should work.
I'm after a little bit of code that can take in any query string from the Web Address, and store it as a normal variable, ready for use in the script.
For example: index.php?User=Chris&Age=20
I'd like to be able to get the info from User (in this case, Chris) and be able to use it in the script.
Can anyone shed some light onto the possible code??
I know PHP would do this in a sinch, but this particular host doens't have PHP.
Thanks :).