is there a code that forces someone to put in a pw in order to see a page (meanwhile hiding said page from being seen)
is there a code that forces someone to put in a pw in order to see a page (meanwhile hiding said page from being seen)
You can use this script here http://www.dynamicdrive.com/forums/s...183#post292183
See a few posts down for password only adaptation.
Should work with everything on/redirecting to the same page (give or take a few tweaks). Have a play and see how it goes.
Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) |
The only limit to creativity is imagination: JemCon.org
ok i am waaaaaaaaaaaaaaaaaaaaaaaayyyyyyyy past confused....lol
i want to have this page
http://bfvr.biz/neopets/Restockument%20Graph.html
unseeable w/o having the pw... this is all jibberish to me... lol i'm so lost... helllllllp... i'm sry if i'm sounding noobish... jus ya... lol
Ok - I'm on iPhone so I can't do much but basically, you would create the "admin-login.php" page from the other thread (include both the PHP and HTML parts with the PHP going right at the very top of the file, before absolutely anything else), and then for arguments sake, create the "another-page.php" file too, but paste the entire markup from your Restockument%20Graph.html page where it says to "put all your content to be protected". You can remove the sample code and just replace it with your own. When you try to view the "another-page.php" page in a browser, you will be prompted to login using the myUsername and myPassword details as defined in the PHP $logins array from the "admin-login.php" file (you can change these to whatever you like).
Once you've got that setup and can see it working you can change all references to "another-page.php" to some other file name, but you'd need to keep the .php extension so the login code works.
Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) |
The only limit to creativity is imagination: JemCon.org
It's okay if you don't understand it - after all, none of us knew anything before we learned it.
If you want help, you need to give it a try and then explain which part(s) you don't understand (even if, at first, you only get as far as "what is PHP?") so we can help you figure it out. We're happy to help!
If, on the other hand, you want someone to "do it for you," you should say so and post in the Paid Work forum.
Adrian ~ facebook | gist/github
['66.215.156.37','208.75.149.97'] // ip,ip array!
"Take that sticker *off* your hat; you look stupid" --Wil Wheaton
well see the thing is i will be posting said codeing into a pet page on neopets and i don't have the ability to create files on there servers... so i'm jus really confused... lol i tried to put all that into an almost finished product of said page but it didn't work, not sure what i'm doing wrong.
While you may not understand all of the details, here is a summary that you should be able to understand:
There are three options:
1. Restrict access to a location on the server overall. (This method uses something called ".htaccess", or similar tools.)
This requires direct access to the server (changing the configuration), so you cannot use this for your current goals.
2. Use a server-side language (like PHP) to alternatively hide the content or show it if the password has been sent.
This requires that you can use a server-side language (with at least limited access to files on the server, so this option is not available for you either.
Important: you can't use the PHP script that Beverley suggested. (And therefore, you can't actually make it impossible to access without a password.)
3. Use Javascript.
You can do this as long as you can access the HTML code for the page. Can you? Or can you access only text/content.
The real problem here is that Javascript does not provide security. It provides optional extra features. So your users might allow the 'extra feature' of hiding the content, but they could (if they were really motivated) disable it or somehow work around it. NEVER rely on Javascript for security. Assume it'll work 95% of the time, but be prepared to accept 5% failure. That's probably overestimating the failure rate. It would be less than .1% if it's something the users want and it is programmed well. But it might be 5% (or more) if it's something the users don't want-- maybe they have a popup blocker, or maybe they really want to steal your content without the password. (I have no idea what your content is, so you'd need to figure out their motivation on your own.)
In short, you can use the Javascript method if you want (unless you have no access to the HTML code). But it won't be guaranteed to work, so don't rely on it for security. Otherwise, just leave it as it is.
(There is also an alternative kind of Javascript password script, which works by using a second page that is not password protected but with an unknown address-- then the password script just takes you to that page if you know the password. But I don't think that will work for you because they already know your webpage address and you may not have two pages available. Either way, both this script and the other type are available on Dynamic Drive-- just take a look, then let us know if you have questions.)
The best answer: don't post sensitive information on neopets. (There are, however, free webhosting services out there, some of which would allow you to add passwords.) I should also mention: I have no idea how neopets accounts work. There is a possibility you could change a setting on your account (like on facebook) so that only some users could see your page, but you'd have to check with their tech support or help website for information about that.
Daniel - Freelance Web Design | <?php?> | <html>| Deutsch | italiano | español | português | català | un peu de français | Ninasoma Kiswahili | 日本語の学生でした。| درست العربية
Do you know if you are even allowed to add javascript code to your page? You might be out-of-luck entirely. If the neopets site has an admin or tech staff, ask them.
As Daniel pointed out, even if you *can* use javascript, javascript is only for the user's convenience and cannot provide any real security.
Adrian ~ facebook | gist/github
['66.215.156.37','208.75.149.97'] // ip,ip array!
"Take that sticker *off* your hat; you look stupid" --Wil Wheaton
it's moreless for a couple friends who keep shops on neopets... and i can access the HTML. each pet comes w/ a free page. not really sensitive info, jus wna try keep it so that other shop keepers don't pick up our tricks to stocking and pricing our shops. i can accept a 5% failure rate... i have coded a no highlight and no right click code into the page just trying to find a way to kinda have it pw'd. thanks for all the help you guys are giving me.
to test it out i'll try to put a default (non customized) copy of it on a page in neopets and see if the javascript coding i have will work like its supposed to![]()
Bookmarks