Jump to content

<!-- EDITABLE --> problem


cactus

Recommended Posts

Hi,

I am trying to create a system where the user can just edit the page online. I have tried to do this using the <!-- EDITABLE --> tag.

 

My system logs in fine and displays the pages that can be edited, however when I click on the page to edit it it doesn't provide the editable region in a text area to be able to change it which it should do.

 

This is the section of code that should make the user able to change the text:

 

if ($_SESSION['username']=='login') {

  if (isset($_REQUEST['file'])) {

      $fc = file_get_contents($_REQUEST['file']);

      $text = explode("<!-- EDITABLE -->",$fc);

      echo "<form method='post' action=''><textarea name='content'>$text[1]</textarea>";

      echo "<p><input type='hidden' name='file' value='".$_REQUEST['file']."' /><input name='submitUpdate' type='submit' value='Update Page'></form>";

  }

  else {

      echo "<p align='center'>

      <a href='index.html'>Home Page</a><br/>

      <a href='contact_us.html'>Contact Us</a><br/>

      <br/>

      <em>Click on the links above to edit the files.</em><br/>

      <a href='logout'>logout</a></p>";

  }

}

 

The section of code that can be edited in each file is coded like this:

 

<div class='main'>

            <!-- EDITABLE -->

            Contents written here can be edited

            <!-- EDITABLE -->

        </div>

 

Anybody got any ideas as its giving me no error messages and I can't see whats wrong with the code.

 

Thanks in advance :)

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.