Hi i am looking for a script that when a user press a number from 1 to 9 it loads a page.
Like
1 = index.php
2 = about.php
3 = contact.php
so on so on.
Thanks
Hi i am looking for a script that when a user press a number from 1 to 9 it loads a page.
Like
1 = index.php
2 = about.php
3 = contact.php
so on so on.
Thanks
The web in one word.
Very simple, not tested and really sure if this is what you are looking for.Code:<?php $pageID = $_REQUEST['pageID'] - 1; $files = array('index.php', 'contact.php', 'users.php', 'faq.php' ); //notice no comma after last entry header('Location: '.$files[$pageID]); ?>
In the files array, type in all of the pages in order by which you made your buttons.
Hope this helps.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
No i don't think this is what i need. what i mean it when they press the number 1 on there keyboard it loads the page.
Like
Num Pad 1 = index.php
Num Pad 2 = about.php
Num Pad 3 = contact.php
The web in one word.
That would be a javascript then. Not quite sure how you would do it, but I think you would have to do something like onkeyup or onkeydown with the key code that was pressed. You could probably google it, or something similar on here.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
Acually, heres a tutorial that tells you what is pressed and the code for it.
http://www.javascriptkit.com/javatut...riptkey2.shtml
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
ok lets say i use this
<script type="text/javascript">
function textsizer(e){
var evtobj=window.event? event : e //distinguish between IE's explicit event object (window.event) and Firefox's implicit.
var unicode=evtobj.charCode? evtobj.charCode : evtobj.keyCode
var actualkey=String.fromCharCode(unicode)
if (actualkey=="a")
document.body.style.fontSize="120%"
if (actualkey=="z")
document.body.style.fontSize="100%"
}
document.onkeypress=textsizer
</script>
is theer anyway to make it open a URL instead of reszing
The web in one word.
Change this:
to this:Code:document.body.style.fontSize="100%"
change index.php to whatever you want.Code:window.location = "index.php"
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
Bookmarks