1,105,263 Community Members

PHP text editor embeded in HTML

Member Avatar
samidha
Newbie Poster
12 posts since Jan 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I am a new user in PHP and currently developing a blogging web-site using PHP. I have designed a simple design of Create Blog page using HTML syntaxs, created database fields in MySQL as 1) Blog-Id 2) User-Id 3) Blog-title 4) Blog-text. Now if I am supposed to give interface like bold, italic, then how could I give it using PHP as scripting language?? I am unawre of Jscript.

cblog.php code is as follow:

<?
session_start();
if ($_POST) {
  file_put_contents("file.txt",$_POST['text']);
  header ("Location: ".$_SERVER['PHP_SELF']);
  exit;
}
$text = htmlspecialchars(file_get_contents("file.txt"));
?>
<title>Cblogs</title>
<fieldset>
<legend>Create New Blog</legend>
<form action="" method="post" enctype="multipart/form-data">
<table width="400" border="0" bordercolordark="#000000">
    <tr>
        <td width="129"><b><i>TITLE:</i></b></td>
      <td width="259"><input type="text" name="title" size="40"/></td>
    </tr>
</table>
<table width="44%" border="0">
    <tr>
        <td height="123" width="75%">
            <fieldset>
            <legend>Text</legend>
                <textarea name="text" rows="20" cols="80"><?=$text?></textarea>
            </fieldset>
      </td>
    </tr>
</table>
<table border="0">
    <tr>
        <td> </td><td width="20%"><input type="submit" name='submit' value="SUBMIT"/></td>
      <td width="25%"><input type="reset" name="reset" value="RESET"/></td>
    </tr>
</table>
</form>
</fieldset>
Member Avatar
pritaeas
mod_pritaeas
11,285 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,829 [?]
Skill Endorsements: 154 [?]
Moderator
Featured
Sponsor
 
0
 

Have a look at TinyMCE or CKEditor. They're both Javascript editors.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article