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
https://forums.phpfreaks.com/topic/230688-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.