We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,140 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

PHP text editor embeded in HTML

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>
2
Contributors
1
Reply
26 Minutes
Discussion Span
1 Year Ago
Last Updated
2
Views
samidha
Newbie Poster
12 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

pritaeas
Posting Prodigy
Moderator
9,287 posts since Jul 2006
Reputation Points: 1,173
Solved Threads: 1,458
Skill Endorsements: 86

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0552 seconds using 2.68MB