•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 402,603 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,240 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 3395 | Replies: 18 | Solved
![]() |
Easy, Easy Tefflox..... All generalizations are wrong, Besides I dont know what ur complaning about (PS... Man invented language to satisfy his deep need to complain) coz U have solved your own problem and thats clever If I may say, U know posting a predicament code and come up with your own solution thats genius dude worse when there is rumor and evidence that says the code is not your original work.... and as Im sitting peperndicular to the floor and horizontal to the wall I say BRAVO keep it up man....
Some people get so rich they lose all respect for humanity. That's how rich I want to be.
Now let's back up a bit. I joined almost two years ago. For the very first post I made, a moderator insulted me by saying this is a "professional" forum and that I should capitalize sentences and use proper spelling and grammar. I brushed it off, but heeded the words. Now read your entry...
Second, you enter with a sweeping generalization of your own: "all generalizations are wrong." That is a personal credo, not any sort of instruction or insight.
Third, I make it abundantly clear my complaint.
Fourth, Rumor + Witticism + Evidence = Hearsay Evidence. Immaterial Evidence.
Fifth, pseudo-sly humor does not impress me, or anyone, particularly.
Sixth, the fact is that the moderators are under review because of my complaints to the admins, who have been gracious and forthright from the beginning. I have not encountered a personable moderator on this site yet. The only thing I've seen of moderators is condescension and neo-conservatism. I appreciate your attempt to undo some damage, but it's just backpedaling, not genuine concern for your members beyond covering your own tracks. (As yes, the moderators have deleted some entries in this thread, when I proved them inane.)
Seventh, and in conclusion, look at the number of views to this thread, and I wonder, why has no one asked to see my functioning, useful solution? Let's ask ourselves that, the next time we search for 20 minutes for similar code, from "some genius dude." That's the whole point of coming here, to see people make connections and solve problems, not to witness petty power struggles.
Good day.
Jess Crockett
<URL snipped>
Second, you enter with a sweeping generalization of your own: "all generalizations are wrong." That is a personal credo, not any sort of instruction or insight.
Third, I make it abundantly clear my complaint.
Fourth, Rumor + Witticism + Evidence = Hearsay Evidence. Immaterial Evidence.
Fifth, pseudo-sly humor does not impress me, or anyone, particularly.
Sixth, the fact is that the moderators are under review because of my complaints to the admins, who have been gracious and forthright from the beginning. I have not encountered a personable moderator on this site yet. The only thing I've seen of moderators is condescension and neo-conservatism. I appreciate your attempt to undo some damage, but it's just backpedaling, not genuine concern for your members beyond covering your own tracks. (As yes, the moderators have deleted some entries in this thread, when I proved them inane.)
Seventh, and in conclusion, look at the number of views to this thread, and I wonder, why has no one asked to see my functioning, useful solution? Let's ask ourselves that, the next time we search for 20 minutes for similar code, from "some genius dude." That's the whole point of coming here, to see people make connections and solve problems, not to witness petty power struggles.
Good day.
Jess Crockett
<URL snipped>
Last edited by peter_budo : May 16th, 2008 at 6:43 am. Reason: Keep It Spam-Free - Do not spam, advertise, plug your website, or engage in any other type of self promotion.
MMMmmm.... thats quite hash and please forgive my mistakes... but for the sake of Daniweb and its Precious fellows lets be civil.... Why... Because
1. I thought I was helping you with ur thread but I was way far out of what u were looking for
2. U said U solved ur own thread, And for a second there I said mmmmm this guys is a genius and I suggested that u marked ur thread as solved to eliminate the time ur fellow Gurus that are going to waste in ur so complex thread, that was fair
3. Again someone came up with a idea that ur trying to make other ppls heads dizzy by mixing What and JavaScript... I cant remember, well again that might invited ur wreth.... And of cause as crazy as I am I thought it was a joke so I took it on and laugh at it, My apology again Sir
4. I am not a moderator, neither I am hoping to be one, but dude those guys have done incredible job so far, Im not complaining, Im impressed and I just wish that the world was full of people like them.
5. Lastly I am really sorry for ur ill-lucky of not being taken serious, really I am and this time around Im not joking, Making a long story very short, please accept my apology on behalf of whoever had seriously cozed you to spit anger on Daniweb as a whole, Im sure they never meant it that way, they are here to help us after all not to make us feel belittled or anything less than that
I am sorry once again
1. I thought I was helping you with ur thread but I was way far out of what u were looking for
2. U said U solved ur own thread, And for a second there I said mmmmm this guys is a genius and I suggested that u marked ur thread as solved to eliminate the time ur fellow Gurus that are going to waste in ur so complex thread, that was fair
3. Again someone came up with a idea that ur trying to make other ppls heads dizzy by mixing What and JavaScript... I cant remember, well again that might invited ur wreth.... And of cause as crazy as I am I thought it was a joke so I took it on and laugh at it, My apology again Sir
4. I am not a moderator, neither I am hoping to be one, but dude those guys have done incredible job so far, Im not complaining, Im impressed and I just wish that the world was full of people like them.
5. Lastly I am really sorry for ur ill-lucky of not being taken serious, really I am and this time around Im not joking, Making a long story very short, please accept my apology on behalf of whoever had seriously cozed you to spit anger on Daniweb as a whole, Im sure they never meant it that way, they are here to help us after all not to make us feel belittled or anything less than that
I am sorry once again
Some people get so rich they lose all respect for humanity. That's how rich I want to be.
I marked the thread solved, per your suggestion; on second thought, who can call so much of this a "solution" to anything?
Give me a few days to cool down, and I will post a new thread with the full code, that yes, in part I did borrow from someone -- the authentication page. Then I added JS code that virtually enables any page on a site accessible by changing one token of text in any number of authentication pages. It's not genius, unless you count getting it done under fire, such as we see here.
Peace out
Give me a few days to cool down, and I will post a new thread with the full code, that yes, in part I did borrow from someone -- the authentication page. Then I added JS code that virtually enables any page on a site accessible by changing one token of text in any number of authentication pages. It's not genius, unless you count getting it done under fire, such as we see here.
Peace out
Thanx for understanding and please cool down soon
Some people get so rich they lose all respect for humanity. That's how rich I want to be.
Following is a solution that requires very little modification to employ any number of radio button redirections from a login page. It includes fieldset / legend styling that is IE7 certified.
Attached is the md5 file that is required to run the script. I have renamed it out of personal concerns to 'jmd5.js', but credit to authors remains intact.
Overview ::
A basic login screen which validates against selected radio buttons, which alters the login to redirect the user to their desired place of action..
Context view ::
This script requires several pages. For each authentication-only page, you will need a corresponding 'authenticate[a].php' page, where a is for convenience an integer value.
login page 'index.php'
'authenticate[zero to many].php'
"common page" required for authentication, 'common.php'
your authentication-only pages... such as 'inventory_control.php', 'options_control.php', etc.
Attached is the md5 file that is required to run the script. I have renamed it out of personal concerns to 'jmd5.js', but credit to authors remains intact.
Overview ::
A basic login screen which validates against selected radio buttons, which alters the login to redirect the user to their desired place of action..
Context view ::
This script requires several pages. For each authentication-only page, you will need a corresponding 'authenticate[a].php' page, where a is for convenience an integer value.
login page 'index.php'
<?php
/////////////////////////////////////////////////////////////////////////////
//
// LOGIN PAGE
//
// Server-side:
// 1. Start a session
// 2. Clear the session
// 3. Generate a random challenge string
// 4. Save the challenge string in the session
// 5. Expose the challenge string to the page via a hidden input field
//
// Client-side:
// 1. When the completes the form and clicks on Login button
// 2. Validate the form (i.e. verify that all the fields have been filled out)
// 3. Set the hidden response field to HEX(MD5(server-generated-challenge + user-supplied-password))
// 4. Submit the form
//////////////////////////////////////////////////////////////////////////////////
session_start();
session_unset();
srand();
$challenge = "";
for ($i = 0; $i < 80; $i++) {
$challenge .= dechex(rand(0, 15));
}
$_SESSION[challenge] = $challenge;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Administration</title>
<script type="text/javascript" src="/admin/jmd5.js"></script>
<script type="text/javascript">
function login() {
var loginForm = document.getElementById("loginForm");
if (loginForm.username.value == "") {
alert("Please enter your user name.");
return false;
}
if (loginForm.password.value == "") {
alert("Please enter your password.");
return false;
}
var submitForm = document.getElementById("submitForm");
submitForm.username.value = loginForm.username.value;
submitForm.response.value =
hex_md5(loginForm.challenge.value+loginForm.password.value);
submitForm.submit();
}
function changeAction() {
var homePanel = document.getElementById("home");
var inventoryPanel =document.getElementById("inventory");
var informationPanel =document.getElementById("information");
var optionsPanel =document.getElementById("options");
var submitFormAction = document.getElementById("submitForm");
if(homePanel.checked) {
submitFormAction.action="authenticate.php";
login();
}
else if(inventoryPanel.checked) {
submitFormAction.action="authenticate1.php";
login();
}
else if(informationPanel.checked) {
submitFormAction.action="authenticate2.php";
login();
}
else if(optionsPanel.checked) {
submitFormAction.action="authenticate3.php";
login();
}
else {
alert("Please select an administration panel.");
return false;
}
}
</script>
<style type="text/css">
body {
background: #CCCC99;
}
// IE7 hacks firefox ignores
html fieldset {
position: relative; margin-top: 1em; padding-top: 0.75em;
}
html legend {
position: absolute; top: -0.84em; left: 2em;
}
</style>
</head>
<body>
<br/>
<fieldset style="background: #FFFFCC; margin: auto; height: auto; width: auto;">
<legend style="background: #669966; height: auto; width: auto; padding: 5px; border: 1px solid #222; color: #fff; letter-spacing: 3px; font-weight: bold; font-size: 18px; font-family: Arial, Helvetica, sans-serif;">
Please Login
</legend>
<form id="loginForm" action="#" method="post">
<table width="381" height="244">
<?php if (isset($_REQUEST[error])) { ?>
<tr>
<td>Error</td>
<td style="color: red;"> </td>
<td style="color: red;"> </td>
<td style="color: red;"><?php echo $_REQUEST[error]; ?></td>
</tr>
<?php } ?>
<tr>
<td>User Name</td>
<td> </td>
<td> </td>
<td><input type="text" size="28" name="username"/></td>
</tr>
<tr>
<td>Password</td>
<td> </td>
<td> </td>
<td><input type="password" size="28" name="password"/></td>
</tr>
<tr>
<td> Select Control Panel </td>
<td> </td>
<td> </td>
<td><label>
<input type="radio" name="select_panel" value="home" id="home" />
Home</label></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td><label>
<input type="radio" name="select_panel" value="inventory" id="inventory" />
Inventory</label></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td><label>
<input type="radio" name="select_panel" value="information" id="information" />
Information</label></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td><label>
<input type="radio" name="select_panel" value="options" id="options" />
Options</label></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td style="text-align: right; padding-right: 30px;">
<input type="hidden" name="challenge" value="<?php echo $challenge; ?>"/>
<input type="button" name="submit" value="Login" onclick="changeAction();"/></td>
</tr>
</table>
</form>
<form id="submitForm" action="index.php" method="post">
<div>
<input type="hidden" name="username"/>
<input type="hidden" name="response"/>
</div>
</form>
</fieldset>
</body>
</html>'authenticate[zero to many].php'
<?php
/////////////////////////////////////////////////////////////////////////////
//
// AUTHENTICATE PAGE
//
// Server-side:
// 1. Get the challenge from the user session
// 2. Get the password for the supplied user (local lookup)
// 3. Compute expected_response = MD5(challenge+password)
// 4. If expected_response == supplied response:
// 4.1. Mark session as authenticated and forward to secret.php
// 4.2. Otherwise, authentication failed. Go back to index.php
//////////////////////////////////////////////////////////////////////////////////
$userDB = array("log" => "pass"); // array values for demonstration only, not for practical use !
// the following code works, never mind how, just that it works, and for multiple redirect,
// you only need to append one of these authentication pages to a radio button (as demonstrated)
// and then change the last line before exit() is called, to any page you want to make authentication-only
function getPasswordForUser($username) {
// get password from a simple associative array
// but this could be easily rewritten to fetch user info from a real DB
global $userDB; return $userDB[$username];
}
function validate($challenge, $response, $password) {
return md5($challenge . $password) == $response;
}
function authenticate() {
if (isset($_SESSION[challenge]) &&
isset($_REQUEST[username]) &&
isset($_REQUEST[response])) {
$password = getPasswordForUser($_REQUEST[username]);
if (validate($_SESSION[challenge], $_REQUEST[response], $password)) {
$_SESSION[authenticated] = "yes";
$_SESSION[username] = $_REQUEST[username];;
unset($_SESSION[challenge]);
} else {
header("Location:index.php?error=".urlencode("Failed authentication"));
exit;
}
} else {
header("Location:index.php?error=".urlencode("Session expired"));
exit;
}
}
session_start();
authenticate();
/* * * * */ /* * * * */ /* * * * */
header("Location:home_page_control.php"); /* * * * */ /* change location for each radio button redirect */
/* * * * */ /* * * * */ /* * * * */
exit();
?>"common page" required for authentication, 'common.php'
<?php
////////////////////////////////////////////////////////////////////////////////
//
// COMMON PAGE
//
// Defines require_authentication() function:
// If the user is not authenticated, forward to the login page
//
////////////////////////////////////////////////////////////////////////////////
session_start();
function is_authenticated() {
return isset($_SESSION[authenticated]) &&
$_SESSION[authenticated] == "yes";
}
function require_authentication() {
if (!is_authenticated()) {
header("Location:index.php?error=".urlencode("Not_authenticated"));
// NOTE :: if the login page has been renamed from 'index.php', make the change here, above as well
exit;
}
}
?>your authentication-only pages... such as 'inventory_control.php', 'options_control.php', etc.
<?php
////////////////////////////////////////////////////////////////////////////////
//
// SECRET PAGE
//
// Invokes require_authentication() to ensure that the user is authenticated
//
////////////////////////////////////////////////////////////////////////////////
require("common.php");
require_authentication();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
Logged in users only !
</body>
</html> At the risk of driving the thread even further off course, I'd like to address some of the issues raised concerning the moderators.
>For the very first post I made, a moderator insulted me by saying this is a "professional"
>forum and that I should capitalize sentences and use proper spelling and grammar.
The very fact that you consider it an insult suggests that you're not viewing the request objectively. I've been through the better part of your early posts and saw nothing about this, so I assume it was through a private message and thus, can't verify the "insult". However, we do ask that posts be made in full sentence English for the sake of professionalism. This is clearly stated in the community rules.
>the fact is that the moderators are under review because of my complaints
Moderators are always under review. It's my job to keep an eye on them and make sure that everything is running smoothly. Taking complaints into account is simply a variable in the constant "quality assurance".
>to the admins, who have been gracious and forthright from the beginning
Being gracious and forthright doesn't mean they'll actually do anything. Any complaints about a moderator will get redirected to me, and I'll ultimately handle them. As such, you'll get faster results by following the chain of command. Complaints about a regular member go to any of the moderators, complaints about a moderator go to the super moderator, and complaints about the super moderator go to an admin.
>I have not encountered a personable moderator on this site yet.
I make it very clear to anyone who cares to ask that a moderator's behavior is governed by the same rules as everyone else. As long as they do their job well and don't break any rules, I really don't care how they act. Doing the job well and not breaking any rules is sufficient to keep behavior within acceptable norms.
>As yes, the moderators have deleted some entries in this thread, when I proved them inane.
I'll kindly ask that you refrain from making such accusations unless you have sufficient proof. What you describe is an abuse of power that if true, would likely lead the the removal of the moderator in question. As such, it's a very serious accusation that shouldn't be made lightly.
Because it's so serious, I've carefully checked the history of changes in this thread. There are no deleted posts, one edit by a moderator that adds text to his own post, and one edit that removes a single url in post #12, which constituted a violation of the rules. I see nothing that justifies your accusation.
>For the very first post I made, a moderator insulted me by saying this is a "professional"
>forum and that I should capitalize sentences and use proper spelling and grammar.
The very fact that you consider it an insult suggests that you're not viewing the request objectively. I've been through the better part of your early posts and saw nothing about this, so I assume it was through a private message and thus, can't verify the "insult". However, we do ask that posts be made in full sentence English for the sake of professionalism. This is clearly stated in the community rules.
>the fact is that the moderators are under review because of my complaints
Moderators are always under review. It's my job to keep an eye on them and make sure that everything is running smoothly. Taking complaints into account is simply a variable in the constant "quality assurance".
>to the admins, who have been gracious and forthright from the beginning
Being gracious and forthright doesn't mean they'll actually do anything. Any complaints about a moderator will get redirected to me, and I'll ultimately handle them. As such, you'll get faster results by following the chain of command. Complaints about a regular member go to any of the moderators, complaints about a moderator go to the super moderator, and complaints about the super moderator go to an admin.
>I have not encountered a personable moderator on this site yet.
I make it very clear to anyone who cares to ask that a moderator's behavior is governed by the same rules as everyone else. As long as they do their job well and don't break any rules, I really don't care how they act. Doing the job well and not breaking any rules is sufficient to keep behavior within acceptable norms.
>As yes, the moderators have deleted some entries in this thread, when I proved them inane.
I'll kindly ask that you refrain from making such accusations unless you have sufficient proof. What you describe is an abuse of power that if true, would likely lead the the removal of the moderator in question. As such, it's a very serious accusation that shouldn't be made lightly.
Because it's so serious, I've carefully checked the history of changes in this thread. There are no deleted posts, one edit by a moderator that adds text to his own post, and one edit that removes a single url in post #12, which constituted a violation of the rules. I see nothing that justifies your accusation.
I'm a programmer. My attitude starts with arrogance, holds steady at condescension, and ends with hostility. Get used to it.
I'm gone. Any site with moderator, super moderator, and admin (four level pyramidal hierarchy, including the members, is a dated system.)
If the best you can demonstrate are some flashy yellow stars and post meaningless infractions, rummaging through 20 month old posts to support your partners in crime, well then I'm not the only one with better ideas, and better things to do.
If you have nothing constructive to offer, you are wasting the time of the people here for the solution to the original problem, not to listen to all the reasons why they should not come to daniweb, due to the now painfully obvious neo-conservative bent of her bored moderators.
If the best you can demonstrate are some flashy yellow stars and post meaningless infractions, rummaging through 20 month old posts to support your partners in crime, well then I'm not the only one with better ideas, and better things to do.
If you have nothing constructive to offer, you are wasting the time of the people here for the solution to the original problem, not to listen to all the reasons why they should not come to daniweb, due to the now painfully obvious neo-conservative bent of her bored moderators.
Last edited by tefflox : May 16th, 2008 at 10:46 am. Reason: stitching up the Emperor's New Clothes . . .
>I'm gone.
Don't let the door hit you on the way out. I gave you the benefit of the doubt and offered a serious reply to your rant, but it's obvious at this point that you're simply trying to garner as much attention as possible due to some imagined insult. If you want to act like a child, I'll treat you like one.
Don't let the door hit you on the way out. I gave you the benefit of the doubt and offered a serious reply to your rant, but it's obvious at this point that you're simply trying to garner as much attention as possible due to some imagined insult. If you want to act like a child, I'll treat you like one.
Last edited by Narue : May 16th, 2008 at 1:07 pm.
I'm a programmer. My attitude starts with arrogance, holds steady at condescension, and ends with hostility. Get used to it.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: suckerfish hover or submit on IE
- Next Thread: Pull down menue using getElemntById --Help Please


Linear Mode