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've crashed my PHP and Omni Server a few times doing that. Hope I haven't done it on Freeola as well :).
> 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 :)
> 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
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 :)
> Nope. Works perfectly :) thanks again.
Did you find out what that error was?
Line: 8
Char: 1
Error: 'secondpart.1' is null or not an object.
Any ideas what this may be caused by???
--- the page code ---
You should see an alert
So the first part needs to be:
var urlsplit=location.href.split('/')
var string=urlsplit[3]
Completely escaped my mind earlier :-)
> 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.
> Wicked, thanks for that :)
>
> I owe you one.
Pleasure to help. :-)