Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update table with form information

Status
Not open for further replies.

aaronjonmartin

Technical User
Jul 9, 2002
475
GB
Im a total newbie so please bear with me. I want to make a webpage which holds information on whether employees are currently in the office. I want it to consist of a table with the information in with a form below to allow users to change thier status (in or out). The table will display the current attendance and when employees leave the office they use the form to change thier status. Do I need to use a perl of php script to change the table when the form is submitted? If so do I need to be running IIS on the server the page will be stored on? Note this is not intended for use on the internet it is simply a local website stored on our server. Thanks for any help in advance.
 
You can use either PERL or PHP - depending on your preferences and which databse or table you want to use.

If using a databse (Access, Foxpro, etc.) I would use perl, but that's just my preference. If you don't need to keep the attendance data for historical reasons, you can just create a text file and overwrite it each day. Again, the choices are yours.

You will need to run some sort of web server (IIS, Apache, etc) if you intend to give other machines in your office access to this info.

There's always a better way. The fun is trying to find it!
 
Apache, PHP and MySQL would be the way I'd do it.

First parse the URL to see if there are any passed varibles or if the person is just veiwing the website.
If there there are passed varribles (say $user and $state) then update the database to set the state = $state where user = $user.

Then (unconiditionally) query the table:
Code:
print(&quot;<table width=95%>&quot;);
$result = mysql_query(&quot;select user, state from db&quot;);
while(list($user, $state) = mysql_fetch_row($result))
{
  print(&quot;<tr><td>&quot; . $user . &quot;</td>&quot;);
  print(&quot;<td>&quot; . $state . &quot;</td></tr>&quot;);
}
print(&quot;</table>&quot;);

Then print a form to allow the user to change their status. You may also want to add encrypted passwords to stop people from changing someone else's status.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top