PSP Page Password

Gigabyte / Nvdaacpi
May 9, 2009 at 03:21:59
Specs: OS 9.1, 333 GHz / 128 MB
My server site has been put to a slight halt
until i get my (tech) friend to help me do
something so in the mean, ive been
working on a page for my PSP.

The (small site-like) Collection of pages
are all in working condition (Yeah! I
actually got something to work by myself
for once!) But now i have come across a
small dilemma in creating version 1.1.

I need to put a password prompt on one
of my pages to keep people away from
my... links... . I cant seem to figure out this
part though. I tested my code on 3
different browsers (Not my PSP) and it
didnt work on any, though with my small
knowledge of Javascript, i cant seem to
be able to spot the problem. Searching
the net didn't help either, a code on the
first google search was so close to
mine... well... the only major difference
was the password.

This is on a PSP and its really only me
who is going to be using it.
Although it would be nice to on the first
run to be able to set a custom
password... but thats another thing in its
self and i doubt it is possible because its
off the PSP-Browser.

I figure i would be easiest if i just post my
whole script. I wrote this in notepad (Don't
Bag It!) seems its all i have, i cant really
test to see if its all right. Though i havent
spotted any probs.

<script language="Javascript">
var password = "935515"
var y prompt("password"," ")
if (y.toLowerCase() == password) {
alert("Access Granted")
else {
document.location = "wpwd.htm";
<p/>Page Content</p>

Could someone please fix this and
explain what i did wrong? I probably have
the complete wrong idea, or ive put some
batch in somewere and just cant pick it.

This might not work in my psp, if it doesnt,
ill probly be back :P

Thanks ahead.

EDIT: Fixed a %RANDOM% Capital i put in there...??? What is it with me today?
EDIT2: Closed My <HTML> tag.

See More: PSP Page Password

Report •

May 12, 2009 at 17:20:07
Authenticating a user with that isn't going to do you much good since anyone can view your source for the password. :P

Your opening and closing tags should be all the same case, html and head don't want a trailing a slash, and prompt is a value returning function so it needs an assignment operator. Its value will either be null (cancel) or the user's value.

<script language="Javascript">

var password = "935515"
var y = prompt("password"," ")
if (y.toLowerCase() == password) {
alert("Access Granted")
else {
document.location = "wpwd.htm";


Page Content</p>

My work in progress. I hate JS. :P

Report •

May 16, 2009 at 21:50:47
Once again, Thanks a heap shutat, you cease to amaze me.

I am incredibly sorry about not replying. I had personal
matters to attend to therefore, i havent had access to a
computer for several days.

Viewing the source is not a severe problem, as i suggested in
my previous post, its designed to be used in a PSPs web-
browser and from what i know, it is impossible to view the
source from such a thing.

Thank you once again for your help. I did not realise that it
was case-sensitive, nor what you said about prompt.

Report •

May 16, 2009 at 23:15:31
No worries; you're quite welcome. :)

Since you intend to use this with a psp, you can add sort of a crude check to psp traffic by checking to see if it has a user agent string, and if it does, use a unique part of the string that identifies it as a psp. It isn't 100% reliable though as user agents can be spoofed.

alert(navigator.userAgent); // check if psp has ua

If you can get the ua string, look for something unique to the psp - sony, psp, playstation, etc. As an example, perhaps the ua has psp in it.

if(navigator.userAgent.match(/psp/i) == null) {
   // redirect user
} else if(password == ...) {
   // grant access
} else {
   window.location = "wpwd.htm";

Good luck Atoru

My work in progress. I hate JS. :P

Report •

Related Solutions

May 17, 2009 at 23:16:11
Wow. Thanks again. That is a brilliant idea.
It took me a while to figure out exactly what
you meant but I understand it now.

Thanks again for your awesomeness

Report •

Ask Question