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
<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.
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.
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.
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.
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.
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.