PDA

View Full Version : help me



keren2
12-02-2005, 08:41 AM
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

Twey
12-02-2005, 10:35 AM
Simply store it in a database or file.


$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 : 0;
}

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

keren2
12-03-2005, 09:31 AM
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...

Twey
12-04-2005, 06:01 PM
<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.