Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have a php file that dispays the file mems.txt it looks something like this

HTML
<tr>
<th>IGN</th>
<th>Rank</th>
<th>Platform</th>
</tr>

<tr>
<td>user1</td>
<td>General</td>
<td>Both</td>
</tr>

<tr>
<td>user2</td>
<td>Private</td>
<td>Both</td>
</tr>

how could use php to find the specific username than go to the line after that and put the html code <td>NEWRANK</td> This means I could change the rank of ANY person not just user2. Is this possible/how do I do it?
Posted
Comments
enhzflep 22-Jul-13 7:23am    
1. Read a line, then output it.
2. Next, check to see if it contains the search text.
   - If so, output your content to be added.
3. Return to step 1.
G4mm4R4y 23-Jul-13 23:22pm    
Im new to php, what exactly do I do to do that
enhzflep 23-Jul-13 23:49pm    
Simples. You get on the googles and either find+download the help manual for PHP or search for specific answers using google.
I told you what you need to do, now you're going to go out and find out how to do it.
Cmon man seriously - how hard is it to search for:

"read input line php"
"compare string php"

and perhaps a little bit of

"output string php"


You see Jaydman2012 - we were all newbies at everything at some point. Some people go out and find the answers, other people commonly say "I'm new, plz give me the answer" - It don't work like that around here. You do the work and ask specific questions, while someone here usually answers them.

In addition to the php manual, I suggest you read some questions in QA, looking specifically for
(a) questions with no or very few replies(negatively voted questions are even better
and
(b) questions with many answers, particularly ones that have been solved.

You'll notice quite some difference often in the style of the question asker. Be one of the second group, you can do it!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900