Jump to content

[SOLVED] Post edit system, how to remove contents of page and display only edit stuff?


Technex

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.