|
|
I need to be able to open my web site using a keyboard command. Does anyone have any idea how to code that?
|
|
|
|
|
Hey...
what I can help you with is a little Javascript that executes a specific comandad after a certain string of letters or keys are pressed in the correct order on your keyboard.
Place this in the <head> of your file(s) and substitute "word" in the SpecialWord variable for any string of characters that you wish to use. The SpecialUrl can be any page where you would like to be redirected after typing your secret word.
SO here it goes..
<br />
<SCRIPT LANGUAGE="JavaScript"><br />
var SpecialWord = "word",SpecialUrl = "http://www.yoursite.com/secrete_server/",SpecialLetter = 0;<br />
<br />
function getKey(keyStroke) {<br />
var isNetscape=(document.layers);<br />
<br />
<br />
var eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;<br />
var which = String.fromCharCode(eventChooser).toLowerCase();<br />
if (which == SpecialWord.charAt(SpecialLetter)) {<br />
SpecialLetter++;<br />
if (SpecialLetter == SpecialWord.length) window.location = SpecialUrl;<br />
}<br />
else SpecialLetter = 0;<br />
}<br />
document.onkeypress = getKey;<br />
</script><br />
with a small modification you could execute a specific JScript, VBScript..or pretty much anything else..
hope that works...
luck..
Jon
X-ZD Designs
|
|
|
|
|
Does anyone know how I can get my servers time/date. I have a register form in my site, and I want to capture the time the form was sent,..but what I want to avoid is capturing the time/date in the persons PC because then, if by any chance the person has the wrong time/date or is in a different time/date zone, then I'd be saving all sorts of useless info.
I could use one of two things, the current time by TIME ZONES, or the time/date in my server...
thanks guys!
GET TO KNOW ME
|
|
|
|
|
In ASP it would be easy, just call VBScript's Now() function and you'll get it
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
Microsoft used to have a prog (aclist.exe) that would list all the ActiveX controls on the machine it was on. Does anyone know if there is something similar that will work on my Win XP machine OR is there a feature in Visual Studio.Net that will do it. I would like to have a list of all the built-in ActiveX controls on my computer along with their class id's.
"It has become appallingly obvious that our technology has exceeded our humanity."
- Albert Einstein (1879-1955)
"I think there is a world market for maybe five computers."
- Thomas Watson (1874-1956), Chairman of IBM, 1943
"640K ought to be enough for anybody."
- Bill Gates (1955-), in 1981
"Half this game is ninety percent mental."
- Yogi Berra
|
|
|
|
|
Well, OLEView should do the work, this is the one I'm using and it comes with VS and VS.NET (found in Common/Tools folder)
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
Hello All,
I have a validation, replacing quotation mark in my dll as soon as surname or first name has been passed from my form.
The code is : CStr(Replace(Trim(surname), " ' ", "$0"))
The problem is when I type a surname = "O'Brian" the data does not go to the database and has internal server error.
Can anybody suggest any other way I can liminate this problem?
Many Thanks
Bravo Two Zero
A pen is mighter then a sword.
|
|
|
|
|
To place a single quotation mark into database, just repeat it, e.g. to use "O'Brian " in your SQL statement, you should replace it with "O''Brian ". You do not need to do that though if you are using ADO's Recordest("field") = "O'Brian"
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
It looks like you probably used the variable surname as part of a SQL statement. With SQL, the value has to be quoted by ' such as:
<br />
select * from myTable where name = 'John Smith'<br />
If the name value itself contains a ', the SQL statement is invalid:
<br />
select * from myTable where name = 'John's Smith'<br />
What you need to do is replace ' with two consecutive ', like the following:
<br />
select * from myTable where name = 'John''s Smith'<br />
<br />
CStr(Replace(Trim(surname), "'", "''"))<br />
Good luck.
|
|
|
|
|
Hi
how do you create a link to the top of your page from down under? i know the bottom part should look something like href = "#tothetop", but the top part?
tx
|
|
|
|
|
At the top, you need something like:
<a name="start">This is the start of the page</a>
Then at the bottom:
<a href="#start">Go back to the start</a>
Hope this helps
|
|
|
|
|
Hi
Who Can I work With Sockets in ASP?
Iman Ghasrfakhri
|
|
|
|
|
AFAIK, there is no such interface to work with sockets. You should build either your own COM object, ot use ServerXMLHTTP of XML (if it is suitable for you)
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
Hi, everyone!
I think the function of fieldset tag of HTML is just adding
a frame around a form. Am I corrrect? Does the tag have some
other functions?
Thanks in advance,
George
|
|
|
|
|
George (me again)
basically,...thats pretty much its function, but to put in a better way...the purpose of the FIELDSET tag and its complementary tags is to supply context with logical groupings of form elements (personal info on one block, credit card info in another and so on).
Hope this helped you out.
CYA,
Luck,
Jon
GET TO KNOW ME
|
|
|
|
|
Thanks, Jonavis buddie!
George
|
|
|
|
|
Hi, everyone!
What is the funtion of <legend> tag of HTML? I
have searched a lot of help but they still makes
me puzzled.
Who can give me a simple explanation? Better with an
example.
Thanks in advance,
George
|
|
|
|
|
Hey George...
the <legend> tag, is basically designed to save you some formating and time..
this tag works along with the <fieldset></fieldset>, giving a small description to each input, textarea, select, button, radio or checkbox in a <form>
example:
<form method="post" action="here.asp">
<fieldset>
<legend align="right">
Legendo goes here
</legend>
<input type="TEXT" value="HERE">
</fieldset>
</form>
just paste that code in an html page, and start playing around with the alignment, tables etc..
but thats basically it.
CYA
luck
Jon
<a href="http://www.radiostatic.net/jon/index.html" target=_new>GET TO KNOW ME</a>
|
|
|
|
|
Thanks, Jonavis buddie!
I have just posted another question about
fieldset tag of HTML. Please help me out.
Cheers,
George
|
|
|
|
|
I'm rebuilding a static HTML site to use ASP, and to populate the content of each page from a database. If I use a config.asp file to create a database connection, then #include it in all the site's pages, will it create a new connection each time a page is loaded, or will it reuse the same connection for all pages? What I'm attempting to do is to create just one connection, created when a page requiring it is first visited, but to make that connection persistent and available across all pages visited during a single session. Recordsets will be created and destroyed by each page as needed. What's the best approach to this?
It is ok for women not to like sports, so long as they nod in the right places and bring beers at the right times.
Paul Watson, on Sports - 2/10/2003
|
|
|
|
|
If your database is SQL Server don't manage the connections the DTC does that for you by pooling database connections.
So just get a connection in your code when you want one and release it on the first line of code after your done with it
var conn = Server.CreateObject(....);
... do ur db io
conn.Close();
conn = null;
... do the rest of ur page
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
Sadly, the hosting service doesn't support SQL Server without an additional charge, and this site is for a charity that can't afford it. On the bright side, using an Access DB, by stuffing the connection object into the global.asa file I seem to be getting lucky. I haven't started constructing recordsets yet, but it hasn't choked on opening the connection. The connection object seems to be accessible from all the pages, as well. I think I may be on the right track here - wish me luck!
It is ok for women not to like sports, so long as they nod in the right places and bring beers at the right times.
Paul Watson, on Sports - 2/10/2003
|
|
|
|
|
You might want to research that a bit. I don't believe that your approach is recommended. I think it will actually work but it won't scale since all your requests will block on access to that single connection object.
I think a search on msdn.microsoft.com for keywords ASP ADO Access MDB will find several articles discussing this isssue.
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
You're right. I searched through the PSDK docs and found what I need; unfortunately it doesn't work. According to the docs, creating an object in global.asa with session scope makes an object that is accessible from any page visited during a session. They even use a ADODB.Connection as an example! But when I actually try it (I copied the code and pasted it in my .asa file, changing only the name of the connection), it fails every time. The actual failure occurs when opening a recordset. Again following the PSDK example for opening multiple recordsets on a connection, I tried both the rst.Open and conn.Execute techniques given. Neither works, and the message reports that one or more required parameters is missing. The Recordset docs state that the parameters are all optional, though I did provide a SQL string to define the recordset, and the name of the connection object to use.
Back to square one, as always when I try to make anything work from the MS instructions...
It is ok for women not to like sports, so long as they nod in the right places and bring beers at the right times.
Paul Watson, on Sports - 2/10/2003
|
|
|
|