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. Quote Link to comment 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>"; } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.