Staredit Network > Forums > Technology & Computers > Topic: Lookin for a PAssword Script
Lookin for a PAssword Script
Dec 19 2008, 9:10 pm
By: Riney  

Dec 19 2008, 9:10 pm Riney Post #1

Thigh high affectionado

SImply put, I want to write a code to allow a link to be displayed only if you're an admin on a forum, which will change an Iframe to a different shoutbox (For admins only).

Im aware of the security risks (I mean the link to the shoutbox is gonna be in the source) but Im doing this just for fun. Anybody mind helping? Heres my current work, also It needs to use the OnCLick property or something similar

Code
<TABLE BORDER="1" style="border: 1 solid #0415FB" ><TR style="border: 1 solid #0415FB" ><TD WIDTH="200" style="border: 1 solid #0415FB" ><MARQUEE bgcolor="BLACK" loop="-1" scrollamount="2" width="100%"><FONT COLOR="CYAN">Teh Shoutbox :D</FONT></MARQUEE><TD style="border: 1 solid #0415FB"  BGCOLOR="BLACK"><A HREF="http://40705.shoutbox.us/" TARGET="Shoutbox"><FONT COLOR="LIME">Normal Chat</FONT></A></TD><TD style="border: 1 solid #0415FB"  BGCOLOR="BLACK"><A HREF="http://tinyurl.com/leetcrewtrade" TARGET="Shoutbox"><FONT COLOR="PINK">Trade Chat</FONT></A></TD><TD style="border: 1 solid #0415FB"  BGCOLOR="BLACK"><A HREF="http://drift.ijji.com" TARGET="Shoutbox"><FONT COLOR="ORANGE">IJJI</FONT></A></TD>
</TR></TABLE>
<iframe name="Shoutbox" src="http://40705.shoutbox.us/" width="85%" height="200" frameborder="0" style="border: 1 solid #0415FB" allowTransparency="true"></iframe>


Post has been edited 4 time(s), last time on Dec 19 2008, 10:08 pm by Dark_Marine.



.riney on Discord.
Riney on Steam (Steam)
@RineyCat on Twitter

Sure I didn't pop off on SCBW like I wanted to, but I won VRChat. Map maker for life.

Dec 19 2008, 10:06 pm Devourer Post #2

Hello

The code you listed is kinda useless (for me)
I would to it like this:

create a table [mysql-table] and put there a column "admin-flags" standart->no make em to 1 whoever will be the admin
then check if you are the admin via if-script [seassions requires (recommented to make a login-script)

so... if ($_SESSION['admin-flags'] = yes) { LOLOL DISPLAY LINK! } else { LOLOL DON'T DISPLAY LINK }

hope that kinda helped you ;)



Please report errors in the Staredit.Network forum.

Dec 19 2008, 10:10 pm Riney Post #3

Thigh high affectionado

Just visit this http://tinyurl.com/LeetCrew and look at it, I need to figure out how to make a integrated onclick function make a box pop up where you can type in a password and itll change the IFrame if it is accepted, else it says "EFF YOU" and does nothing.



.riney on Discord.
Riney on Steam (Steam)
@RineyCat on Twitter

Sure I didn't pop off on SCBW like I wanted to, but I won VRChat. Map maker for life.

Dec 19 2008, 10:13 pm Devourer Post #4

Hello

Quote from name:Dark_Marine
Just visit this http://tinyurl.com/LeetCrew and look at it, I need to figure out how to make a integrated onclick function make a box pop up where you can type in a password and itll change the IFrame if it is accepted, else it says "EFF YOU" and does nothing.

so... you know what javascripts are?
I think you can make it via javascript... button onclick=admin()
etc. visit: http://www.w3schools.com to learn it ;)

EDIT: here is a script [i made by myself ages ago]
this sohuld be in the head section:


<script type="text/javascript">
function AdminFormular ()
{
if (document.Formular.Admin.value != "test") {
alert("Wrong Password");
document.Formular.Admin.focus();
return False; }
else { location.href = "1a2sadhi2hsdajsaodsajosadnoasd.php"; }
}


</script>



and this where the button should be:
<input type="password" size="20" name="Admin"> <input type="button" value="Login" onclick="AdminFormular()">


this just has an input field at the site... but there is a way to make a pop-up box with an input field, too

Post has been edited 1 time(s), last time on Dec 19 2008, 10:19 pm by DeVouReR.



Please report errors in the Staredit.Network forum.

Dec 19 2008, 10:41 pm Riney Post #5

Thigh high affectionado

Now what is the password for the login button?



.riney on Discord.
Riney on Steam (Steam)
@RineyCat on Twitter

Sure I didn't pop off on SCBW like I wanted to, but I won VRChat. Map maker for life.

Dec 19 2008, 10:48 pm Devourer Post #6

Hello

Quote from name:Dark_Marine
Now what is the password for the login button?

here is a (updated) code:

<html>
<head>
<script type="text/javascript">
function disp_prompt()
{
var password=prompt("Enter the Password","");
if (password!=PASSWORD)
{
alert("Wrong Password");
document.Formular.Admin.focus();
return False; }
else { location.href = "1a2sadhi2hsdajsaodsajosadnoasd.php"; }
}

</script>
</head>
<body>

<input type="button" onclick="disp_prompt()" value="Login as an admin lol" />

</body>
</html>


that should work...^^
the password here is "PASSWORD"

Post has been edited 1 time(s), last time on Dec 19 2008, 10:54 pm by DeVouReR.



Please report errors in the Staredit.Network forum.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[04:15 am]
DarkenedFantasies -- you eat lots of beans
[03:46 am]
IskatuMesk -- how do i get gas
[11:43 pm]
Moose -- you don't
[10:06 pm]
Zoan -- how do i get minerals
[2026-4-14. : 11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
[2026-4-13. : 10:07 pm]
NudeRaider -- ya why phone people when you can just write letters
[2026-4-13. : 9:37 pm]
IskatuMesk -- I have never and will never own a phone
[2026-4-13. : 9:15 pm]
NudeRaider -- Vrael ranting still is though
[2026-4-13. : 9:14 pm]
ClansAreForGays -- anticapitalism isnt edgy anymore
Please log in to shout.


Members Online: itofodicypil, Roy