Design question
| From: | Jim Ide | Date: | Fri, 15 Sep 2000 18:29:42 +0000 |
| Subject: | Design question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-16966@lists.php.net to get a copy of this message | ||
I have written a generic table browser script in PHP
called browse.php. It displays the first 10 records
of a database table in an HTML table. It also displays
these HTML links:
print '<a href="' . $PHP_SELF . '?action=first">Display the first 10
records</a>';
print '<a href="' . $PHP_SELF . '?action=prev">Display the previous
10
records</a>';
print '<a href="' . $PHP_SELF . '?action=next">Display the next 10
records</a>';
print '<a href="' . $PHP_SELF . '?action=last">Display the last 10
records</a>';
Browse.php examines the value of the $action variable
and displays the appropriate database table records.
Another possibility is to create symbolic links to browse.php
called browseFirst.php, browsePrev.php, browseNext.php,
and browseLast.php. Using this method, the HTML links
would look something like this:
print '<a href="browseFirst.php">Display the first 10 records</a>';
print '<a href="browsePrev.php">Display the previous 10
records</a>';
print '<a href="browseNext.php">Display the next 10 records</a>';
print '<a href="browseLast.php">Display the last 10 records</a>';
Browse.php can then examine the value of $PHP_SELF
and display the appropriate database table records.
Can anyone please comment on the advantages and/or
disadvantages of each method, especially security-related
issues?
Thanks - Jim