Jump to content

help and ideas needed on inserting users data...


runnerjp

Recommended Posts

im trying to make an area of my profile site where users can add there running times to there profile... an example is shown below:

 

event            pb

100m        9.98 seconds

5000m        15min 32 seconds

10000m      32min 15 seconds

 

but im not sure whats the best way for users to add there data?

any one have some ideas that users could enter there personal bests whilst keeping them in the same format so time can be compared??

Ask them to enter their data in seconds. Restrict anything that isn't numerical with:

 

is_numeric()

 

Restrict fullstop signs. And make it clear to them that its to be entered in seconds. OR

Have one text field for minutes and another one for seconds. Then do the math yourself.

ok but what about on how many pbs they want to enter... how would i go about having a button that adds fields??

 

an example would be that used on phpmyadmin,, where you select how many more fields you want to add and it shows the allready filled in fields??

Have a submit button inside a form allow them to add fields. Set the submit button to something such as "add_pbs" or something. Then have a check on the page to see if:

 

if(isset($_POST['add_pbs'])){
//echo field
}

 

Thats a pretty simple example but you can probably work it out from there.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.