Results 1 to 4 of 4

Thread: help me

  1. #1
    Join Date
    Dec 2005
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default help me

    how to make th script to show the number like this for the first time registration.

    Number : 1

    and then it is submitted, then another person register, then it's show like this

    Number : 2

    and so on....

    Thx... For the help

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Simply store it in a database or file.
    PHP Code:
    $newline "\n"// Newline symbol for the server.  Likely values are "\n" for *nix or "\r\n" for Windows.
    $filename "regcount.dat"// Name of the file in which to store number of registrants.

    // Function to get the number of registrants.
    function getNumRegistrants() {
      return 
    file_exists($filename) ? implode(file($filename), $newline) + 0;
    }

    // Function to increment the number of registrants.
    function incRegistrants() {
      
    $regcount getNumRegistrants();
      
    $regcount++;
      
    $file fopen($filename"w");
      
    fputs($regcount);
      
    fclose($file);

    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Dec 2005
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    After that, what shoul i put inside the php tag?
    so that it will result like this

    Number 1
    Name Alfred
    School Oxford

    and then the second time like this

    Number 2
    Name Benny
    School Oxford

    The number "1" "2" "3" and so on i want it to be inside Form tag "<input type="text" name="number">

    So it will see the number like this

    Number
    __
    |1ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ|
    ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

    like that... Thx For your help...
    Last edited by keren2; 12-03-2005 at 10:37 AM.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    PHP Code:
    <input type="text" name="number" value="<?php echo(getNumRegistrants()); ?>"/>
    I don't know about the rest, that all depends on how you have your registration script set up.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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