Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Aug 2010
    Posts
    133
    Thanks
    2
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,971
    Thanks
    15
    Thanked 229 Times in 229 Posts
    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.

  • #3
    Regular Coder
    Join Date
    Aug 2010
    Posts
    133
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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?

  • #4
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,971
    Thanks
    15
    Thanked 229 Times in 229 Posts
    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.

  • #5
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,338
    Thanks
    5
    Thanked 363 Times in 360 Posts
    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 #.

  • #6
    Regular Coder
    Join Date
    Aug 2010
    Posts
    133
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •