GetDotted Domains

Viewing Thread:
"JavaScript Query"

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.

Wed 02/04/03 at 13:55
Regular
Posts: 787
I'm sure it is, but can't remember how :)

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 :).
Wed 02/04/03 at 18:53
Regular
"It goes so quickly"
Posts: 4,083
My upmost common mistake is forgetting to make sure a loop can end :)

I've crashed my PHP and Omni Server a few times doing that. Hope I haven't done it on Freeola as well :).
Wed 02/04/03 at 18:51
Regular
"It goes so quickly"
Posts: 4,083
RastaBillySkank wrote:
> Like I said, pleasure to help, and besides you've helped me with
> scripting before so I owe you a few anyway :-D

Oh yeah .... :)

Thats the worst thing ... lines and lines of code ... one type ... and its always the last thing you think off ... because I usually blame the Server first, then the browser ... then finally my own coding :)
Wed 02/04/03 at 18:49
Regular
"You've upset me"
Posts: 21,152
cjh wrote:
> I forgot to alter the number in the "var string=urlsplit[3]"
> area :)

Heh :-)

My most common mistake when scripting is making a typo. Makes me tear my hair out trying to find where I've gone wrong and alter the whole script. Then i realise I've done something stupid like spell visibility visblity and I curse myself and become dissillusioned with the world we live in :-)

> It was very helpful, and now the Page I was working on is complete,
> sent it off to Darkus already.
>
> Cheers again for the help, made it so much easier than researching it
> :)

:-D

Like I said, pleasure to help, and besides you've helped me with scripting before so I owe you a few anyway :-D
Wed 02/04/03 at 18:45
Regular
"It goes so quickly"
Posts: 4,083
I forgot to alter the number in the "var string=urlsplit[3]" area :)

It was very helpful, and now the Page I was working on is complete, sent it off to Darkus already.

Cheers again for the help, made it so much easier than researching it :)
Wed 02/04/03 at 18:39
Regular
"You've upset me"
Posts: 21,152
cjh wrote:
> Nope. Works perfectly :) thanks again.

Did you find out what that error was?
Wed 02/04/03 at 17:36
Regular
"It goes so quickly"
Posts: 4,083
Nope. Works perfectly :) thanks again.
Wed 02/04/03 at 17:34
Regular
"It goes so quickly"
Posts: 4,083
I am told:

Line: 8
Char: 1
Error: 'secondpart.1' is null or not an object.

Any ideas what this may be caused by???

--- the page code ---


:: JetSet-Parties.com ::




You should see an alert



Wed 02/04/03 at 16:50
Regular
"You've upset me"
Posts: 21,152
Crap. I've just realised that the location.href value will have "http://" in it.

So the first part needs to be:

var urlsplit=location.href.split('/')
var string=urlsplit[3]

Completely escaped my mind earlier :-)
Wed 02/04/03 at 16:02
Regular
"Pouch Ape"
Posts: 14,499
cjh wrote:
> split(), thats a built in JavaScript function, correct??
>
> Thanks I'll give that a go.
>
> Hidden Inputs could work, but I'd prefer using Text Links rather than
> Form Buttons.

Yeah, that's cool. It's definitely the better option.
Wed 02/04/03 at 16:02
Regular
"You've upset me"
Posts: 21,152
cjh wrote:
> Wicked, thanks for that :)
>
> I owe you one.

Pleasure to help. :-)

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Great services and friendly support
I have been a subscriber to your service for more than 9 yrs. I have got at least 12 other people to sign up to Freeola. This is due to the great services offered and the responsive friendly support.
I've been with Freeola for 14 years...
I've been with Freeola for 14 years now, and in that time you have proven time and time again to be a top-ranking internet service provider and unbeatable hosting service. Thank you.
Anthony

View More Reviews

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

Go to Support Centre

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.