[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3

Why is WScript that detects user name failing for some pins

Asked by mar_e_yyy in Windows Management Instrumentation (WMI), JScript, JavaScript

We are on a LAN and have an Intranet site.  I wrote this little script on the index.php page so it the user PIN would be recognized and the user would be directed to the appropriate page according to their needs.  Once on the page they have been redirected to,  two scripts would greet them according to the time of day and their name.  
<?php require_once('scripts/time.js'); ?>
<?php require_once('scripts/user_names.js');?>
For example: Good morning Groucho
All PINs are redirecting, but the problem is that once redirected some PINs are not being picked up by the user_names.js script and the else clause of the else/else if command is being called.  The problem only occurs in users with PINs starting with 0.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
<script> 'this script directs user to appropriate page resides on index.php
var user = new ActiveXObject("WScript.Network"); 
document.write('User Pin: ' + user.UserName + '<p />'); 
if (user.UserName == 014389) {
	window.location.href = "http://servernamehere/roothere/managment.php?" +user.UserName;
} else if (user.UserName == 020010) {
	window.location.href = "http://servernamehere/roothere/general.php?" +user.UserName;
} else if (user.UserName == 042282) {
	window.location.href = "http://servernamehere/roothere/medical.php?" +user.UserName;
} else {
	window.location.href = "http://servernamehere/roothere/index_general.php?" +user.UserName;
 
} 
</script>
 
<script> 'this script assigns user name to PIN, filename is user_names.js
var user = new ActiveXObject("WScript.Network"); 
 if (user.UserName ==014389) {
	document.write('Groucho');
}  else if (user.UserName ==020010) {
	document.write('Harpo');
}  else if (user.UserName ==042282) {
	document.write('Zeppo');
}  else {
	document.write('your PIN is lost in cyberspace!');
} 
</script>
[+][-]06/18/09 01:13 PM, ID: 24661354Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Windows Management Instrumentation (WMI), JScript, JavaScript
Sign Up Now!
Solution Provided By: wilq32
Participating Experts: 1
Solution Grade: A
 
 
Loading Advertisement...
20091118-EE-VQP-93 - Hierarchy / EE_QW_3_20080625