Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-11-2010, 04:03 AM   PM User | #1
njfail
Regular Coder

 
Join Date: Aug 2010
Posts: 125
Thanks: 2
Thanked 0 Times in 0 Posts
njfail is an unknown quantity at this point
Forms that update a list

I have a website and we host tournaments.
I'd like to have a form for people to sign up.

From searching the web I could find how to make a form:
Code:
<form name="input" action="/solo/listpam.php" method="post">
B.net Username: <input type="text" name="user" />
Char Code #: <input type="text" name="cc#" />
<input type="submit" value="Submit" />
</form>
However, I don't know how to make the form update a list?

For example, when someone enters their name and char# and then hit submit, It then reloads the page and adds their name to the list of already registered players.

I'm familiar with html and css; trying to learn some php but just started.
njfail is offline   Reply With Quote
Old 11-11-2010, 04:19 AM   PM User | #2
DrDOS
Senior Coder

 
Join Date: Sep 2010
Posts: 1,146
Thanks: 10
Thanked 148 Times in 148 Posts
DrDOS is infamous around these parts
Well the first thing you need to decide is how big a list you need, just a text file for a few players, to be updated on a regular basis, or do you need a database to hold much data for years to come? Using $_POST or $_GET to retrieve that data at the server end is no more complicated than the form itself
PHP Code:
$user $_POST['user']; 
retrieves the user data at the other end. It's what happens with the data when you have all of it that is the complicated part.
DrDOS is offline   Reply With Quote
Old 11-11-2010, 05:00 AM   PM User | #3
njfail
Regular Coder

 
Join Date: Aug 2010
Posts: 125
Thanks: 2
Thanked 0 Times in 0 Posts
njfail is an unknown quantity at this point
Quote:
Originally Posted by DrDOS View Post
Well the first thing you need to decide is how big a list you need, just a text file for a few players, to be updated on a regular basis, or do you need a database to hold much data for years to come? Using $_POST or $_GET to retrieve that data at the server end is no more complicated than the form itself
PHP Code:
$user $_POST['user']; 
retrieves the user data at the other end. It's what happens with the data when you have all of it that is the complicated part.
It'll be a simple list, like 100 lines of just 'user name, ###'.
It'll be deleted by me after a month and a new one will be made.

I'm confused as to what your saying.

To make it clearer,
There will be a form then a list below the form.
people submit their name and # on the form, and their name shows up on the list below the form.

how would I do that?
njfail is offline   Reply With Quote
Old 11-11-2010, 02:13 PM   PM User | #4
DrDOS
Senior Coder

 
Join Date: Sep 2010
Posts: 1,146
Thanks: 10
Thanked 148 Times in 148 Posts
DrDOS is infamous around these parts
You can handle that with a plain .txt file and the explode function, or a .csv file, without any problem. PHP has several pre-made functions for doing what you want.
DrDOS is offline   Reply With Quote
Old 11-11-2010, 04:27 PM   PM User | #5
teedoff
Senior Coder

 
Join Date: Aug 2010
Location: High Point, NC
Posts: 3,325
Thanks: 5
Thanked 363 Times in 360 Posts
teedoff is on a distinguished road
What happens if after the month is over, and a new tournament begins and several of the same users want to enter this new tourney again. They have to sign up all over again correct?

My point is that maybe you should consider using databases for this application. As DrDos pointed out, a database could store many records indefinately. Once a tournament begins and everyone is signing up, the form would post the data to the db. When the tourney is over, you can just "deactivate" the members while still keeping the records of their sign up name and #.
teedoff is offline   Reply With Quote
Old 11-11-2010, 07:20 PM   PM User | #6
njfail
Regular Coder

 
Join Date: Aug 2010
Posts: 125
Thanks: 2
Thanked 0 Times in 0 Posts
njfail is an unknown quantity at this point
Well I don't really need the records, but if its easy to use a database to do that, then I don't mind?

I'm not familar with data bases though. Basically all I know is css+html and how to upload my css+html folders/files to the directory with firefox's FTP client.

what would the code be fore an explode function?
njfail is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:56 PM.


Advertisement
Log in to turn off these ads.