Few questions for a beginner
I just ordered the book on php/mysql made by phpfreaks. Anyway: I have a few things I want to ask not so I can reference when I actually get started in a couple days.
Here's the scenario: I want a visitor on my site to be able to upload a .txt file that is in a certain format. You know, where they click the browse button and find it. I'm not entirely sure how to do that, but I think I'll learn. The file will be in a format like this:
//NAME: Soldierks
// en-Kors
3 Soltari Guerrillas
// Land
13 Plains
1 Black Lotus
9 Mountain
// Other
SB: 3 Wing Shards
And I want to format it and store it in a database as well as have it ready to format into a small table on a page. I'm not even sure where to begin. No clue. I have a feeling this is a complicated script and maybe I won't have it done by febuary 20th. Anyhoo, I want the individual things to be stored as different variables I guess. You can see each line is clearly defineable by a common starting. How would I go about getting PHP to "narrow" it down to just the data that needs to be stored? for example, on lines starting with "// " how would I get jsut the text after that until the end of the line to be stored as one string?
Second question: how to store these separate things into a database?
Third: how to get it back from the database (output onto a page permanently) as:
<center><table border=2 cols=2 width=60% bordercolor=black cellpadding=0 cellspacing=0>
<tr bgcolor=AAF2AA><td colspan=2><b>Name: Soldierks</b></td></tr>
<tr bgcolor=AAF2AA><td colspan=2>en-Kors</td></tr>
<tr bgcolor=D3F9D3><td width=10%>3</td><td>Soltari Guerillas</td></tr>
<tr bgcolor=AAF2AA><td colspan=2>Deck Section Header</td></tr>
<tr bgcolor=D3F9D3><td width=10%>13</td><td>Plains</td></tr>
<tr bgcolor=D3F9D3><td width=10%>1</td><td>Black Lotus</td></tr>
<tr bgcolor=D3F9D3><td width=10%>9</td><td>Mountain</td></tr>
</table></center>
___________________
I did the atkins diet for only two weeks, and I lost 14 days!
"Decker, your sig still.." rocks
Love, Phil
