Hi, this is a question about implementing jeditable...

Briefly, this is what I'm aiming for...
  1. Open a text file (chapter02.txt - part of the script to Back to the Future)
  2. Each line of script is delimited by a <p>.Explode the file into an array
  3. Print each item
  4. Make each item editable using jeditable
  5. Send any changes to a database


Now, I can print the array out.
However, I can't get them to be editable. Can anyone help with that? An old example would be brilliant. Also, not so urgently, why is the line breaking?

This is the code. You can also see it at: http://holtworth.net/mplayers/script_test.php
It's chapter two I'm looking at!
PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Edit the Script</title>
<link href="m4.css" rel="stylesheet" type="text/css" />


<script type="text/javascript">    
    function changeChapter(chapter)    {
        var type=chapter.value;
        
        if (type==1)    {
            //alert(type);
            document.getElementById('chapter01').style.display='block';
            document.getElementById('chapter02').style.display='none';
        } else if (type==2){
            //alert(type);
            document.getElementById('chapter01').style.display='none';
            document.getElementById('chapter02').style.display='block';
        }
    }
</script>


<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="Scripts/jeditable.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
     $(".mouseover").editable("http://localhost/milton/save.php", {
     indicator : "<img src='img/indicator.gif'>",
      tooltip   : "Move mouseover to edit...",
      event     : "mouseover",
      style  : "inherit"
    });
});
</script>
</head>

<body>
<img src="images/thecurrentscript.png" alt="The script we are working on..." />
<div style="top:200px">
<h1>Script Operations</h1>
Would you like to see the script? You can download it in full here (PDF: <img src="images/get_adobe_reader.png" width="100" />)
<p>
<img src="images/editthescript.png" width="275"/>
<h2>Making changes</h2>
So you think you can do a better job of the script?
Logged in users with permission can make suggestions online. Just move your mouse over the part you wish to edit, and it changes. This may not work on browsers which don't support Javascript - such as mobile phones.
<p>
Changes will be reviewed by the director before being incorporated!
<div id="textedit" style="width:500px; vertical-align:top">
    <form id="section_chooser" name="section_chooser" action="#" method="post" >
        Show only... <br />
        Chapter One <input type="radio" name="chapter" value="1" onclick="changeChapter(this)"/> 
        <br />
        Chapter Two <input type="radio" name="chapter" value="2" onclick="changeChapter(this)"/>
    </form>
    
    <p>
    <div id="chapter01" >
    <h2>Chapter One</h2>
    <?php
    $scriptText 
"Chapter01.txt";
    
$fh fopen($scriptText'r') or die("Can't open file");
    
$text=fread($fhfilesize($scriptText));
    
$lines explode('<p>',$text);
    
//$lines = explode('<p>',$scriptText);
    
echo "Chapter 1 has ".count($lines)." lines.'<p>";
    
// loop through and print all the words
    
for ($i 0$i count($lines); $i++)
    {
        echo 
'Line ' $i ' - ' $lines[$i] . '<br />';
    }
    
?>
    </div>
    <div id="chapter02">
    <h2>Chapter Two</h2>
    <?php
    $scriptText 
"Chapter02.txt";
    
$fh fopen($scriptText'r') or die("Can't open file");
    
$text=fread($fhfilesize($scriptText));
    
$lines explode('<p>',$text);
    
//$lines = explode('<p>',$scriptText);
    
echo "Chapter 2 has ".count($lines)." lines.<p>";
    
// loop through and print all the words
    
for ($i 0$i count($lines); $i++)
    {
        
$lineNumber $i+1;
        
$output'<div class="edit area" id="div_'.$i.'"> Line '.$lineNumber' - '.$lines[$i].'</div>';
        echo 
$output;
        
    }
    
?>
    </div>

</div>
</body>
</html>