dankine Posted October 3, 2007 Share Posted October 3, 2007 Well phrased topic I know. Basically I have a page to enter data into a mysql db via a form. After the data has been input, this form disappears and instead (on the same page) the data is shown in the same format, just not editable anymore. What I need to do is have a link that will be able to switch between the two states, being 'edit' and 'view'. Can anyone help point me in the right direction? It would be very much appreciated. Link to comment https://forums.phpfreaks.com/topic/71678-using-a-link-to-change-page-content/ Share on other sites More sharing options...
trq Posted October 3, 2007 Share Posted October 3, 2007 <?php if (isset($_GET['action'])) { $action = 'view'; // default. } else { $action = $_GET['action']; } if ($action == 'view')) { // display data echo "<a href='?action=edit'>edit</a>"; } else { // display form echo "<a href='?action=view'>view</a>"; } ?> Link to comment https://forums.phpfreaks.com/topic/71678-using-a-link-to-change-page-content/#findComment-360849 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.