dcsimg
www.webdeveloper.com
Results 1 to 8 of 8

Thread: PHP Keypad... Looking for direction

  1. #1
    Join Date
    Feb 2006
    Location
    Hedgesville WV
    Posts
    140

    Question PHP Keypad... Looking for direction

    I currently have a website that requires you enter a pin number to access the next page. It has a on-screen keypad numbered 0-9 and uses java-script to populate a textbox each time you touch a number on the screen and an enter button for when you are finished. The textbox is updated with each touch to a button so the person can see what has already been entered. By now you have noticed this is on a touch screen monitor.

    I would like to replace the javascript with a php script if someone has or knows how to make such a script. Please let me know any ideas you may have.

    Robert Ketter, www.RobertKetter.com

  2. #2
    Join Date
    Jul 2004
    Location
    West Coast, Canada
    Posts
    665
    Quote Originally Posted by robertketter
    I currently have a website that requires you enter a pin number to access the next page. It has a on-screen keypad numbered 0-9 and uses java-script to populate a textbox each time you touch a number on the screen and an enter button for when you are finished. The textbox is updated with each touch to a button so the person can see what has already been entered. By now you have noticed this is on a touch screen monitor.

    I would like to replace the javascript with a php script if someone has or knows how to make such a script. Please let me know any ideas you may have.

    Robert Ketter, www.RobertKetter.com
    In terms of replacing the keypad characters/digits from the keypad to the textbox, I think it's best that you're going with Javascript. As for the transfer between different pages, you could use php to handle those interactions.

    Do you have a live example? A lot of people here can help you out and provide you with advice if you have a working example to show us.

    "Everything in a web browser."

  3. #3
    Join Date
    Feb 2006
    Location
    Hedgesville WV
    Posts
    140

    Will post a working sample within the hour...

    The website is actually on an intranet at a daycare center. I had a working sample online but the hosting has expired. I will repost in a short while to let all know it is back online.

  4. #4
    Join Date
    Jul 2004
    Location
    West Coast, Canada
    Posts
    665
    You said that the entered digits in the textbox determine whether they can proceed to the next page, correct? If that's the case, for your form action, use this:

    PHP Code:
    <form id='frmGeneric' method='post' action='keypadaction.php'
    Inside your keypadaction.php:
    PHP Code:
    <?php
    //retrieve form value
    $input mysql_escape_string($_POST['inputChars']);

    //do some checking
    //some code here

    //use the input to decide where the person should go and header()
    //some code here
    ?>

    "Everything in a web browser."

  5. #5
    Join Date
    Feb 2006
    Location
    Hedgesville WV
    Posts
    140
    Removed... Old Content
    Last edited by robertketter; 01-11-2007 at 06:40 PM.

  6. #6
    Join Date
    Feb 2006
    Location
    Hedgesville WV
    Posts
    140
    Removed... Old Content
    Last edited by robertketter; 01-11-2007 at 06:41 PM.

  7. #7
    Join Date
    Jul 2004
    Location
    West Coast, Canada
    Posts
    665
    Well, if you get the chance to post the code, then that'd be great.

    "Everything in a web browser."

  8. #8
    Join Date
    Feb 2006
    Location
    Hedgesville WV
    Posts
    140

    Keypad Code

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    
    <html lang="en">
    <head><title>Almost Home Keypad</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
    <meta http-equiv="Content-Script-Type" content="text/javascript"> 
    <meta http-equiv="Content-Style-Type" content="text/css">
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="refresh" content="16; url=http://www.robertketter.com/almosthome/timeout.php">
    
    <script language="JavaScript"><!--
    document.myform.reset();
    //--></script>
    
    <script type="text/javascript">
    <!--
    function init() {
    var df = document.forms[0];
    for (i=0; i<df.length; i++) {
    if (df[i].type == "button") { df[i].onclick = function() { df.UserID.value += this.value; } }
    }
    }
    //-->
    </script>
    
    </head>
    <body onload="init(); setTimeout(window.close, 15000); document.myform.UserID.focus()">
    
    <div id="keypad" align="center">
    <form name="myform" method="POST" action="http://www.robertketter.com/almosthome/keypad.php" style="margin:0px 0px; padding:0px 0px">
    <table border="0" cellpadding="0" cellspacing="0" width="100%" id="table1">
    	<tr>
    		<td align="center"><input name="UserID" type="text" size="8" style="font-size: 24pt"></td>
    	</tr>
    	<tr>
    		<td align="center">
    		<table border="0" cellpadding="2" cellspacing="0" id="table2">
    
    			<tr>
    				<td><input type="button" value="1" style="font-size: 60pt; font-weight: bold"></td>
    				<td><input type="button" value="2" style="font-size: 60pt; font-weight: bold"></td>
    				<td><input type="button" value="3" style="font-size: 60pt; font-weight: bold"></td>
    			</tr>
    			<tr>
    				<td><input type="button" value="4" style="font-size: 60pt; font-weight: bold"></td>
    				<td><input type="button" value="5" style="font-size: 60pt; font-weight: bold"></td>
    				<td><input type="button" value="6" style="font-size: 60pt; font-weight: bold"></td>
    
    			</tr>
    			<tr>
    				<td><input type="button" value="7" style="font-size: 60pt; font-weight: bold"></td>
    				<td><input type="button" value="8" style="font-size: 60pt; font-weight: bold"></td>
    				<td><input type="button" value="9" style="font-size: 60pt; font-weight: bold"></td>
    			</tr>
    			<tr>
    				<td><input type="submit" value="*" style="font-size: 60pt; font-weight: bold"></td>
    				<td><input type="button" value="0" style="font-size: 60pt; font-weight: bold"></td>
    
    				<td><input type="button" value="#" style="font-size: 60pt; font-weight: bold"></td>
    			</tr>
    		</table>
    		</td>
    	</tr>
    	<tr>
    		<td align="center">
    		<table border="0" cellpadding="6" cellspacing="0" id="table3">
    			<tr>
    
    				<td><input type="submit" value="Enter" style="font-size: 24pt; font-weight: bold"></td>
    			</tr>
    		</table>
    		</td>
    	</tr>
    	</table>
    <input type="hidden" name="ActionToTake" value="PassCheck">
    </div>
    </form>
    <div align="center"><INPUT type="button" value="Cancel" onClick="window.close()" style="font-size: 24pt; font-weight: bold"></div>
    </body>
    
    </html>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center