Delete HTML table rows without any database support

Tutorials Shared by the Internet Community

Advertisements


Synopsis

Problem I worked on a PHP project where I needed to write and delete HTML table rows without any database support.

Statistics

  • Total Hits - 27019

  • Total Votes - 120 votes

  • Vote Up - 53 votes

  • Vote Down - 67 votes

  • Domain - bewebmaster.com

  • Category - PHP/File Handling

  • Submitted By - Devesh Khanna

  • Submitted on - 2008-03-16 05:48:39

Description

Problem
I worked on a PHP project where I needed to write and delete HTML table rows without any database support.

Solution
Write HTML table to a file and surround each row with HTML comments containing unique id. Using preg_replace function, find the row surrounded with unique comment and modify it.

How to...
First I had to figure out the file structure. In my case I needed three files: 1. file that contains the table; 2.file to display table; 3.file that executs requests. ...


Site  |   Broken  |   Tweet  |   Facebook  |     |   Save  |   Liked  |   Down

Advertisements