Solved

HTML Code that will provide Authentication to i site

Posted on 2007-03-29
8
181 Views
Last Modified: 2010-04-16
I am trying to get some code that allows me to have a user Type in an Employer Number 54321009876512 and then the code would check to make sure the firts 7 Didget were 5432100 and that the number was 14 Charicters  long and the would forwared them to a web link

Example : Type in  543210098765412  Submit   www.google.com window would open.
0
Comment
Question by:LOGTECHSERV
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
8 Comments
 
LVL 4

Expert Comment

by:mukhtar2t
ID: 18817539
if substr($str,0,7) = '5432100' and length($str) == 14
0
 

Author Comment

by:LOGTECHSERV
ID: 18817568
I Have no clue what that means im sorrry i am the farthest ting from a programer  im just looking for somethiing to cut and paste in to a html page.

Thanks
0
 
LVL 4

Expert Comment

by:mukhtar2t
ID: 18817594
you can not do this by html
HTML just display the text
0
Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

 
LVL 4

Expert Comment

by:mukhtar2t
ID: 18817603
However you can use PHP
if(substr($str,0,7) = '5432100' ) and (length($str) == 14)
{
do whatever you want
}
0
 
LVL 1

Accepted Solution

by:
veiko_1001 earned 500 total points
ID: 18817666
Insert this Javascript code between you <head> tags:

<script type="text/javascript">
      function verifyCode() {
            var codeToCheck = document.myForm.myTextField.value;
            if(codeToCheck.length != 14 || codeToCheck.substr(0,7) != "5432100")
                  alert("Incorrect code");
            else
                  window.location = "http://www.google.com";
      }
</script>

And then the following form in your page:

      <form name="myForm">
            <input type="text" name="myTextField" value="54321009876512" /><br />
            <input type="button" name="myButton" value="Submit" onclick="javascript: verifyCode();" />
      </form>
0
 
LVL 1

Expert Comment

by:veiko_1001
ID: 18817674
Sorry remove the value="54321009876512" part from the text field, I was just using that to try it out. So the form should actually look like this:

      <form name="myForm">
            <input type="text" name="myTextField" /><br />
            <input type="button" name="myButton" value="Submit" onclick="javascript: verifyCode();" />
      </form>
0

Featured Post

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question