943,936 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 633
  • PHP RSS
Aug 12th, 2009
0

Two different PHP aps for the same form data.

Expand Post »
I'm putting together a VERY simple time tracking widget to embed into my companies homepage. It's going to be broken down by individual offices and I'm formatting it as a drop-down box with no more than ten employees in it and two buttons (clock-in and clock-out) the problem is that I'm not sure how to make this same field work with both of these buttons. Can anybody give me some guidance on how to format the form so that it can use either of the submit buttons?
Similar Threads
Reputation Points: 124
Solved Threads: 36
Practically a Master Poster
OlyComputers is offline Offline
604 posts
since Jun 2008
Aug 12th, 2009
0

Re: Two different PHP aps for the same form data.

They don't have to be submit inputs, they can be button tags which set a field to say clockin or clockout and then submit the form though you could do exactly the same thing with submit inputs
Last edited by ShawnCplus; Aug 12th, 2009 at 3:37 pm.
Sponsor
Reputation Points: 520
Solved Threads: 268
Code Monkey
ShawnCplus is offline Offline
1,564 posts
since Apr 2005
Aug 12th, 2009
0

Re: Two different PHP aps for the same form data.

The problem is that, in my experience in input forms, you have to designate which PHP component it will use in the "form action" field, but I'm using two different PHP actions.

Maybe there's a way to use the clock-in and clock-out buttons as a sort of "toggle" inside the php form rather than completely separate forms.
Reputation Points: 124
Solved Threads: 36
Practically a Master Poster
OlyComputers is offline Offline
604 posts
since Jun 2008
Aug 12th, 2009
0

Re: Two different PHP aps for the same form data.

The problem is that, in my experience in input forms, you have to designate which PHP component it will use in the "form action" field, but I'm using two different PHP actions.

Maybe there's a way to use the clock-in and clock-out buttons as a sort of "toggle" inside the php form rather than completely separate forms.
If by action you mean file, don't do that. Really for something this simple this should only be one file in total (ie., the form posts to the page it exists on)
Sponsor
Reputation Points: 520
Solved Threads: 268
Code Monkey
ShawnCplus is offline Offline
1,564 posts
since Apr 2005
Aug 12th, 2009
0

Re: Two different PHP aps for the same form data.

I think I know what I have to do, I'm just a little stuck on finding the code to do it. I think it needs to be something like this:
Clock-In button (submits, adds timestamp and "IN" tag
Drop down box for field data<
Clock-Out button (submits, adds timestamp and "out" tag

Is this the best solution? and how do I format the buttons to do this.
Reputation Points: 124
Solved Threads: 36
Practically a Master Poster
OlyComputers is offline Offline
604 posts
since Jun 2008
Aug 12th, 2009
0

Re: Two different PHP aps for the same form data.

You don't need the button to add the timestamp, you can do that in PHP. All you need the buttons to do is the in or out.
Sponsor
Reputation Points: 520
Solved Threads: 268
Code Monkey
ShawnCplus is offline Offline
1,564 posts
since Apr 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Query failed: You have an error in your SQL syntax; check the manual that corresponds
Next Thread in PHP Forum Timeline: not unsetting sessions





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC