Technex Posted July 30, 2007 Share Posted July 30, 2007 Hey guys another big question(in my eyes) for you guys to answer if possible. I'm trying to work on my edit system on my site, after realising that a separate edit box wouldn't be possible under each message if the user had pressed edit on that post I decided on doing what all modern forums do, use a separate page to edit the corresponding post. So far I am using <a href='?action=edit&id=$row[id]'>Edit</a> under each post which works fine. I've got it displaying a edit box at the bottom of the main news page(index) but it's a little far away right down the bottom of the page. How can I do it like this forum and many others do? Thanks! Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted July 30, 2007 Share Posted July 30, 2007 Either create another page, for example edit.php, to handle the editing of posts, rather than using an action defined in your URL for the same page. Or, change what is output to the browser dependant on the action. For example: <?php if($_GET['action'] !='edit'){ //show normal page content...in your case, the news }else{ //show the form to edit the post } ?> That way, if the action is to edit, all that would be shown would be the edit form, so it would be at the top of your page. Quote Link to comment Share on other sites More sharing options...
Technex Posted July 31, 2007 Author Share Posted July 31, 2007 Whoops sorry for the late reply, I forgot about just adding case (if's) at the top of the page to stop rest of php loading. Thanks loads anyway! Working fine. Solved 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.