I am working on a website for my job and I've come to an impass.
I need a simple script that will take the time (on the system clock) and send to a variable so whenever someone fills in the form, they dont have to key in the time.
Also one for the date would be nice.
And also if there is one that can read who is logged into the computer and put the account name into a variable.
I'm working on an issue logging system
+ Reply to Thread
Results 1 to 30 of 37
-
-
Code:
<?php if ($_POST['submit']) { $formTime = $_POST['time']; $formDate = $_POST['date']; // TODO: validate data // TODO: store data } else { $time = date("H:i:s"); $date = date("F d, Y"); } ?> <html> <head> <title>Date and time form</title> </head> <body> <form method="POST" action="<?php echo $_SERVER['PHP_SELF'] ?>"> Time: <input type="text" name="time" value="<?php echo $time ?>"> Date: <input type="text' name="date" value="<?php echo $date ?>"> <input type="submit" name="submit" value="Submit"> </form> </body> </html>
For capturing the user, it depends on how the user is accessing the page and how you've got things set up. -
How do you put that into the page? can I give you the page and you inject it?
http://tiger.towson.edu/~gprimr1/WWW.rar
(must be in caps)
That is a rar of the website
e-mail it back to me at gprimr1 at towson.edu if you can do that please -
You have to have PHP installed on the web server to use that script... I assume that since you didn't recognize it as PHP then you probably don't have PHP installed on your server (since you would have had to explicitly install PHP).
-
We have a php server i just dont know how to insert the code into the page
-
If you can run ASP, http://www.aspronline.com/learn/lessons/2/4.asp might help. It uses VBScript. I seem to recall that there's a whole heap of SERVER_VARIABLES (I think that's what they're called) that you could tap into.
If in doubt, Google it. -
We can't run ASP.net at all and we can't run Front Page and PHP on the same server.
-
Donate the fiver to Videohelp.
Code:<script type="text/javascript"> var d = new Date() TimeVal = d.getHours() + ":" + d.getMinutes() DateVal = d.getDate() + "/" + (d.getMonth() + 1) + "/" + d.getYear() </script> <form> <script type="text/javascript" language="JavaScript"><!-- document.write('<input '); document.write(' type=\"text\" '); document.write(' name=\"time\" '); document.write(' value=\"' + TimeVal + '\">'); document.write(' '); document.write('<input '); document.write(' type=\"text\" '); document.write(' name=\"time\" '); document.write(' value=\"' + DateVal + '\">'); //--> </script> </form>
-
<HTML>
<HEAD>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<TITLE>Issue Tracker</TITLE>
</HEAD>
<BODY>
<H1 align="center">SCS Online Issue Tracker</H1>
<HR>
If you need help using this form or are not sure which options to use,
click here. </P>
<FORM METHOD="POST" ACTION="--WEBBOT-SELF--">
<input TYPE="hidden" NAME="VTI-GROUP" VALUE="0">
Enter <font color="#FF0000" size="5">YOUR</font> username
<INPUT NAME="Contact_FullName" SIZE=7></P>
<BLOCKQUOTE>
<script type="text/javascript">
var d = new Date()
TimeVal = d.getHours() + ":" + d.getMinutes()
DateVal = d.getDate() + "/" + (d.getMonth() + 1) + "/" + d.getYear()
</script>
<script type="text/javascript" language="JavaScript"><!--
document.write('<input ');
document.write(' type=\"text\" ');
document.write(' name=\"time\" ');
document.write(' value=\"' + TimeVal + '\">');
document.write('
');
document.write('<input ');
document.write(' type=\"text\" ');
document.write(' name=\"time\" ');
document.write(' value=\"' + DateVal + '\">');
//-->
</script>
</P>
</BLOCKQUOTE>
User's Issue</P>
<BLOCKQUOTE>
<SELECT NAME="issue" size="1">
<option>Tiger Password Reset</option>
<option>Tiger Account Activation</option>
<option>Tiger username lookup</option>
<option>Tiger e-mail forwarding</option>
<option>Tiger POP3 or IMAP</option>
<option>Tiger Front Page Enable</option>
<option>Tiger Front Page Repair</option>
<option>TU ID Lookup</option>
<option>Ancy Freshmen requesting account information</option>
<option>Webdisk</option>
<option>Webmail Inquiry</option>
<option>Webmail 20meg bump</option>
<option>Webmail 100meg bump</option>
<option>Webmail Deleting Mail</option>
<option>PeopleSoft8 Multiple Server Error</option>
<option>PeopleSoft8 Session Expired</option>
<option>PeopleSoft8 Regestration</option>
<option>AD Birthday Incorrect</option>
<option>AD Birthday spaced by / not - </option>
<option>Wireless Networking Configuration</option>
<option>Wireless Network Info Request</option>
<option>Wireless Network -other-</option>
<option>BBWEB Account Creation</option>
<option>BBWEB Password reset</option>
<option>BBWEB enrollment help</option>
<option>BBWEB page timeout</option>
<option>BBWEB issue -other-</option>
<option>Triton Account Creation</option>
<option>Oracle Account creation</option>
<option>Oracle password reset</option>
<option>Lab printer issue</option>
<option>MS Word Support</option>
<option>MS Excel Support</option>
<option>MS Front Page support</option>
<option>MS Access Support</option>
<option>MS Front Page Support</option>
<option>MS Office Issue -other-</option>
<option>Windows Support</option>
<option>Lab Specific Program support -enter prog name in other-</option>
<option>Dorm router incorrectly connected</option>
<option>Dorm Issue -Other-</option>
<option>Floppy Disk Repair</option>
<option>SPSS Issue</option>
<option>Dial Up Networking</option>
<option>MacAfee Issue</option>
<option>Other</option>
<option>Severe Diarrhea</option>
</SELECT>
</P>
</BLOCKQUOTE>
Means of Contact</P>
<BLOCKQUOTE>
<INPUT TYPE=RADIO NAME="contact" VALUE="Telephone" CHECKED>
Telephone
<INPUT TYPE=RADIO NAME="contact" VALUE="E-mail">
E-mail
<INPUT TYPE=RADIO NAME="contact" VALUE="Walk-up">
Walk-up
<INPUT TYPE=RADIO NAME="contact" VALUE="Lab User">
Lab User
</P>
</BLOCKQUOTE>
Did you fix it?</P>
<BLOCKQUOTE>
<INPUT TYPE=RADIO NAME="resolved" VALUE="Resolved on Contact" CHECKED>
Resolved on Contact
<INPUT TYPE=RADIO NAME="resolved" VALUE="Follow-up needed">
Follow-up needed
<INPUT TYPE=RADIO NAME="resolved" VALUE="Maget Ticket Required">
Magic Ticket Required
<INPUT TYPE=RADIO NAME="resolved" VALUE="Issue SCS does not handle">
Issue SCS does not handle
<INPUT TYPE=RADIO NAME="resolved" VALUE="Repaired">
Repaired
<INPUT TYPE=RADIO NAME="resolved" VALUE="Unable to Repair">
Unable to Repair
<INPUT TYPE=RADIO NAME="resolved" VALUE="Data Recovered">
Data Recovered
<INPUT TYPE=RADIO NAME="resolved" VALUE="Unable to Recover Data">
Unable to Recover Data
</P>
</BLOCKQUOTE>
Other (use when selecting "other" issues)</P>
<BLOCKQUOTE>
<TEXTAREA NAME="other" ROWS=5 COLS=35></TEXTAREA>
</P>
</BLOCKQUOTE>
<INPUT TYPE=SUBMIT VALUE="Submit Form">
<INPUT TYPE=RESET VALUE="Reset Form">
</FORM>
<HR>
<H5>
Copyright © 2003 [Greg Primrose]. All rights reserved.
Revised:
<!--WEBBOT BOT=TimeStamp
S-Type="EDITED"
S-Format="%m/%d/%y"
--></H5>
</p>
</BODY>
</HTML> -
Also I will donate 10 dollars if you can make the user logged into the system appear in the username field and record the information like the date and time
-
First of all, I would need to know the system that you are using (php, perl, asp, etc.)
Also, it may get too involved for me to do all that. If that's you're job, you should know way more than anyone here, especially about the logins and such. That may take more than your system will allow (getting the value of the user and passing it to the server/page). Do you possibly have an actual tech support guy who knows a bit more about web programming?
I'm not sure if you want to pass the time and date to another page, but they are altready in a value (DateVal and TimeVal) -
Alright. I just want to say I really apperciate your help. I am a student manager at this tech support place. I am trying to do this because it needs to get done and no one else will do it. I have a basic understanding of HTML but not the complexity I need. I have asked my boss for help from the professional staff but they are to busy.
What the form does now is everytime someone hits submit, it records the results into a text file that is delimited. When I use this script, it does not send the date and time to the form. I need it to do this.
Right now we are using simple HTML with a front page bot. I am working on a form in PHP (I cannot figure out how to use that script i got in the beginning of the thread, everytime i insert it, it just says PHP echo time in the form field.
We cannot use ASP, the server doesn't support it.
The user logs on and it is a domain based login.
I wish we did have a tech support guy I could go to but your the only person who's offered any real advice. -
Will stamp the form for you but with the users clock in a hidden field (remove the try me button), to stamp with the system clock I think you need to add the field in the script that it's getting posted to. Javascript is client side so any information submitted will be client side.
<HTML>
<HEAD>
<SCRIPT Language = "JavaScript">
function stampForm() {
rightnow = new Date()
document.myForm.timestamp.value = rightnow
}
function showSecret() {
msg = "hidden field contains"
msg += document.myForm.timestamp.value
alert (msg)
}
</SCRIPT>
</HEAD>
<BODY onLoad = "stampForm()">
<FORM name = "myForm">
<INPUT type = "hidden" name = "timestamp">
<INPUT type = "button" value = "Try Me" onClick = "showSecret()">
</FORM>
</BODY>
</HTML> -
If your server does not support PHP (like ASP), the PHP pages/scripts will not work.
I don't know how that bot works. It may be looking for a straight value, rather than a variable (value="May 1, 2005"). If that's the case, it's fairly unworkable.
Find out how the bot works. It may have a pre-defined date and time routine, and it may be able to stamp the forms itself.
Alternately, try it this way to see if it works:
<form name="test1">
<input type="text" name="time">
<script>test1.time.value = TimeVal;</script>
<input type="text" name="date">
<script>test1.date.value = DateVal;</script>
</form>
Also, jim
Usage Note: Irregardless is a word that many mistakenly believe to be correct usage in formal style, when in fact it is used chiefly in nonstandard speech or casual writing. Coined in the United States in the early 20th century, it has met with a blizzard of condemnation for being an improper yoking of irrespective and regardless and for the logical absurdity of combining the negative ir- prefix and -less suffix in a single term. Although one might reasonably argue that it is no different from words with redundant affixes like debone and unravel, it has been considered a blunder for decades and will probably continue to be so. -
OMG Thank you everyone. the date and time fields work great. The username and IP fields dont but the time does
-
How hard would it be to create a login page and set a cookie and then have the cookie be read to get the username?
-
Originally Posted by Greg12
-
Originally Posted by Greg12
If you extract both files from the zip and put them in the same directory, leaving the filenames untouched, it should just work. Works for me on a standalone with IIS5.1 installed, anyway. You need to make sure that the Frontpage Server Extensions are installed also.
Took me about 30 minutes using google to develop my script, tooIf in doubt, Google it. -
Date_Submitted: 6/5/2005
Time_Submitted: 11:52:55 AM
IP_Address:
Username:
Issue: Tiger Password Reset
Contact: Telephone
Resolved: Resolved on Contact -
I got that when I renamed it to HTML. If you leave it as SHTML, and your server has the Frontpage Server Extensions installed, and you put that .class file in the same directory as the SHTML file, it will work, I guarantee.
After all, works perfectly on my machineIf in doubt, Google it. -
I uploaded the file untouched and the class to the WWW directory on my account using SSH Shell. It did not work. The file is .shtml and the .class is there. We have front page server extensions, maybe just not the right ones.
Similar Threads
-
Sticky: MVP scripts!
By cwb in forum Media Center PC / MediaCentersReplies: 0Last Post: 15th Sep 2011, 10:11 -
Is there a way to see actions done by scripts?
By Marc01FR in forum ffmpegX general discussionReplies: 1Last Post: 21st Jan 2011, 14:27 -
About using AviSynth scripts with MeGUI 0.3.5.0.
By Nagashi in forum DVD RippingReplies: 56Last Post: 15th Jul 2010, 10:15 -
Are these scripts right?
By php111 in forum Newbie / General discussionsReplies: 7Last Post: 21st Jan 2008, 17:10 -
Scripts for Conversion
By jwfc in forum Newbie / General discussionsReplies: 2Last Post: 6th Nov 2007, 06:50