Need a little programing help here...

88 Worgen Druid
8990
OK first off I've dabbled a little with HTML and php so not sure if that's the best tools to make what i want to make, so here is what im trying to do...
Make some input boxes for the user, example : "input name here" then next to that one say "input DOB", and another box say "input school" , last say "input how many years" . Then have that info saved someplace (database) after its all inputted allowing it so once your done you can go back and keep re-inputting the information multiple times. then create a report which will display a list of all inputs from all the users...

example:

Tom smith sept 8 1978 MSU 3 years
Tory smith aug 24 1982 Wis 2 years
Kim smith feb 20 1985 UCLA 4 years

ect..course then allow me to show the report from different ways, like say i want a list shown from everything that was inputted from last tuesday..or show the report with every last name that was named "brown" or "smith" :-)

Any help with this would be great, I'm thinking ill need more then just HTML for all this, if there is a site out here that will help with what im trying to accomplish then please pass it on, im having little luck finding info on what id like to do...thanks again!
Reply Quote
85 Blood Elf Paladin
5330
You can use something like mysql to set up the database but if you want to stay within html and php then you can create a simple php database using a plain text file. Note that this is very primitive-ish but it can still come in useful sometimes. You wouldn't want to store sensitive information using this method because it's stored in an unencrypted plain text file.

Use this as your reference: http://us2.php.net/manual/en/ref.filesystem.php
things like file_put_contents will be very useful.

Then you can easily just display the table using php and html like so:


<?php
$fp = fopen('example.txt','r');
if (!$fp) {echo 'ERROR: Unable to open file.'; exit;}
$loop = 0;
while (!feof($fp)) {
$loop++;
$line = fgets($fp, 2048); //use 2048 if very long lines
$field[$loop] = explode ('|', $line);
echo '
<table padding="0" width="200px" cellspacing="2">
<col width="40px" />
<col width="40px" />
<col width="30px" />
<col width="30px" />
<col width="30px" />
<col width="30px" />
<tr>
<td>'.$field[$loop][0].'</td>
<td>'.$field[$loop][1].'</td>
<td>'.$field[$loop][2].'</td>
<td>'.$field[$loop][3].'</td>
<td>'.$field[$loop][4].'</td>
<td>'.$field[$loop][5].'</td>
</tr>
</table>';
$fp++;
}
fclose($fp);
?>


That will display the contents of whatever is in the file into what should be 6 columns

I forgot to add that the fopen() function here:
fopen('example.txt','r')
contains the name of a file that I made. Simply change that to suit your needs or whatever.
Edited by Verróld on 9/15/2012 9:59 PM PDT
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)
Submit Cancel

Reported!

[Close]