Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2009-12-14 17:45:16

geraint
New member
Registered: 2009-12-14
Posts: 2

loading html into the textarea

I am trying to use xinha to edit html from a mysql field.

I am putting the contents of the mysql field containing the html into a php variable and I need to get it to show in the editor so that it can be updated. Obviously placing this inside the textarea tag via php is not working.

Please can somebody tell me where I can get an idiots guide to help me

here is what I am doing so far

---------------------------------



$query="select * from articles where article_id='$article_id'";
                         $result=mysql_query($query)or die('could not select article');
                        
                         $article_heading=mysql_result($result,0,"article_heading");
                         $article_text=mysql_result($result,0,"article_text");
                        
                        

mysql_close;

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Metamorphosis Design Free Css Templates</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="../styles.css" rel="stylesheet" type="text/css" />





<script type="text/javascript">
    _editor_url  = "http://www.my_site.com/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
    _editor_lang = "en";      // And the language we need to use in the editor.
    _editor_skin = "silva";   // If you want use a skin, add the name (of the folder) here
  </script>
  <script type="text/javascript" src="http://www.my_site.com/xinha/XinhaCore.js"></script>



<script type="text/javascript" src="http://www.my_site.com/xinha/my_config.js"></script>







</head>
<body>

    <div class="bo_article">
     <form action="edit.php" method="POST" id="bo_form" name="form1">
    Heading<br>
       
        <input type="text" class="bo_input" name="Heading" value="<? echo$article_heading;?>"/>
   
       
        <br />
<br />

        Article Content<br />

        <textarea id="bo_textarea"></textarea><br />
<br />

   
    <input type="submit" value="Save Article"></button>
    </form>
   
    </div>

------------------------------------------------

Thanks

Offline

#2 2009-12-14 18:48:03

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: loading html into the textarea

At what point are you utilising $article_text

None that I can see!


James Sleeman

Offline

#3 2009-12-14 20:35:07

geraint
New member
Registered: 2009-12-14
Posts: 2

Re: loading html into the textarea

I had tried echoing it in the textarea tag, which is where it should be.

Since found the problem with syntax. Everything working lovely now.

Thanks for you attention, sorry for being dim.

G

Offline

Board footer

Powered by FluxBB