Click to See Complete Forum and Search --> : little php help would be appreciated


Net_Spy
05-16-2007, 01:19 PM
Greetings to all

im try to do is that to read a text file and display in same page when i fill the input feilds and press save button it should append the data at the end.

senerio is ive a text file which having MAC address and IP and user nameof my clients now all i want to give a web access to my client since im noon PHP so i dont from here to get start.

the page will contains the information fileds like

Macaddress:
Ipaddress:
user name:

save button.

mean while it must display that file data on same page on upper portion for input fields and below is the display data looks like

00:af:33:e4:45 192.168.0.1 test
00:af:36:f4:20 192.168.0.2 test2
......

so on,it must display the data in tabular form like a grid.Im sure you guys got my point.Looking forward for your kind response.

Regards
Net_Spy

Gorran
05-16-2007, 02:22 PM
You're going to probably want to use the 'fopen' function to open the file for reading and appending.

http://us2.php.net/manual/en/function.fopen.php

The 'explode' function should be able to split the different fields

http://us2.php.net/manual/en/function.explode.php

As far as a tabular format, using html to create tables should suffice for that. You can create html in php by using the 'echo' function, this will allow you to interpolate php variables.

i.e echo "<a href=$url>Link</a>";
Where $url would be a php variable containing the URL.