creating a page for posting articles

2 replies [Last post]
apeksha
Offline
Last seen: 7 years 1 week ago
Joined: 2009-09-18
bOt Points: 126

i wanna create an article page...............

the users shuld hav options like what we have in word...........make text bold,italic....n few more...........

 

just like what this forum page has...........not all but few.............. 

plz help

shashwat
Offline
Last seen: 1 year 24 weeks ago
Joined: 2009-02-18
bOt Points: 1160
Hello apeksha0701, I guess

Hello apeksha0701,

I guess what you to create is an article submission page/form where users can type and submit their own articles. 

First of all what you need to do is download CKEditor (www.ckeditor.com)It is a text editor to be used inside web pages. It's not a replacement for desktop text editors like Word or OpenOffice, but a component to be used as part of web applications and web sites. Once you download extract it inside your root folder. Include this line in the header part of your article submission page.

<script type="text/javascript" src="ckeditor.js"></script>

In the body where you want user to type in their article use the following code -

<textarea class="ckeditor" cols="80" id="editor1" name="editor1" rows="10"></textarea>

So the complete code will be - 

 

 

<html>

<head>

<title>

Article Submission Form

</title>

<script type="text/javascript" src="ckeditor.js"></script>

</head>

<body>

<form action="sample_posteddata.php" method="post">

<p>

<label for="title">

Title:

</label>

<br/>

<input type="text" name="title" id="title" />

</p>

<p>

<label for="editor1">

Body:

</label>

<br/>

<textarea class="ckeditor" cols="80" id="editor1" name="editor1" rows="10">Type in your article here!</textarea>

</p>

<p>

<input type="submit" value="Submit"/>

</p>

</form>

</body>

</html>

 

 

Change the path of ckeditor.js in the header part of the page according to where you have downloaded CKEditor.

Sample Output of the above code -



Also once you download CKEditor check out _sample directory inside it. They have given different examples regarding how you can integrate CKEditor inside your page. Hope this helps. 

Founder and Admin

apeksha
Offline
Last seen: 7 years 1 week ago
Joined: 2009-09-18
bOt Points: 126
thnks.......its exactly what

thnks.......its exactly what i wanted.........