Back to DFS's Workshop Page
Back to Agenda Page
Back to the Project Page
Editing Data in a File
For this problem, you are to cannibalize any available code and write a trio of scripts which will do the following.
The First PHP Script: editaplayer1.php
- Ask the user to select the player data that is to be edited. Use radio buttons in a table which displays the data for all of the players in order to pass the position to a second script.
- Using the "Edit It!" button, send the number of the selection to a PHP script called editaplayer2.php.
The Second PHP Script: editaplayer2.php
- Display all of the desired player's data in a form, allowing the user to retype any or all of the data.
- Use the "hidden" value for the type attribute of an input tag in the form to pass the position of the record in the file.
- Using the "Store Changes" button, send the number of the selection and the player's updated data to a PHP script called editaplayer3.php.
The PHP Script: editaplayer3.php
- Read the data in from the file.
- Replace the record that has been edited.
- Write the data to the file.
- Read the data back in from the file and display it in a table.
Check out this solution.
© 2006 DFStermole
Created 20 Nov 06
Last Modified 26 Nov 06