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.
[08:09 am]
Zycorax -- Greed
[03:25 am]
Symmetry -- why do the oligarchs want our mapping strategies???
[03:24 am]
Symmetry -- the question is why though
[01:10 am]
Butch -- made me feel really sad and stupid and fat
[01:10 am]
Butch -- I got duped by one and replied and then realized after
[11:26 pm]
Sie_Sayoka -- the turings have tested
[03:07 pm]
UndeadStar -- https://staredit.net/topic/18961/ <= wow, if there wasn't a capital letter on almost every word in the title, and a link in the signature, I may not have guesses it's an AI bot. I don't know much about map editing, but the content may even be relevant enough to be kept.
[2026-11-10. : 4:16 am]
lil-Inferno -- fart screen
[2026-11-09. : 3:49 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: :wob: maybe not replaced, just add a discord applet below the shoutbox imo
split screen. Left side shoutbox, right side discord meme channel
[2026-11-08. : 10:23 pm]
Ultraviolet -- :wob: maybe not replaced, just add a discord applet below the shoutbox imo
Please log in to shout.


Members Online: MetalGear, RussellWalker106, Oh_Man, GerdinaMeer303