Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 04-03-2009, 12:41 AM Rich Text Editor
konetch's Avatar
Ultra Talker

Posts: 258
Trades: 0
I need a rich text editor for my website. I have a very basic form right now, but isn't very useful.

I was wondering if anybody could suggest a form for me that would use a rich text editor. I'm not very experienced with PHP and tried using the fckeditor. I couldn't figure it out. This is the code I want to use

Code:
<?php include_once("fckeditor/fckeditor.php") ; ?> 
<html> 
<head>   
<title>FCKeditor - Sample</title> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
</head> 
<body>   
<form action="" method="post" target="_blank"> 
<?php $oFCKeditor = new FCKeditor('FCKeditor1') ; $oFCKeditor->BasePath = '/fckeditor/' ; $oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ; $oFCKeditor->Create() ; ?>     
<br>     
<input type="submit" value="Submit">   
</form> 
</body> 
</html>
As I said before I know very little PHP, so please excuse the stupid questions I may have.

Thanks

-Alex Konetchy

Last edited by konetch; 04-03-2009 at 12:43 AM..
konetch is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-03-2009, 02:59 PM Re: Rich Text Editor
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Quote:
Originally Posted by avijit View Post
Why you are using text pad , I don't think in now days you dont need to use fck editor,For better coding standard you can use eclipse.I think that can solve your problem.You may try dream weaver also but that is not very good.
I don't think he was referring to the program he is using to write the code, but rather an in browser text editor.

@konetch
I'm not exactly sure what you are asking. What exactly couldn't you figure out?

Are you getting an error?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 04-03-2009, 03:17 PM Re: Rich Text Editor
konetch's Avatar
Ultra Talker

Posts: 258
Trades: 0
Currently I have a basic form on my site. You can see it at http://www.konetchreport.com/submit.php . I want to change this form to something like this...
http://www.konetchreport.com/fckedit...p/sample01.php

On my current basic form I'm using a code like this
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"    "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Contact Form</title>
<meta http-equiv="Content-Type"    content="text/html; charset=iso-8859-1">
</head>
<body>
<?php   if ($_SERVER['REQUEST_METHOD'] != 'POST'){      $me = $_SERVER['PHP_SELF'];?>   
<form name="form1" method="post"         action="<?php echo $me;?>">      
<table border="0" cellspacing="0" cellpadding="2">         
<tr>            
Name:<br>      
<input type="text" name="Name">        
<br><br>  
Subject<br>        
<input type="text" name="Subject">        
<br><br>           
Message:<br>          
<textarea name="MsgBody"></textarea>       
<br><br><br>           
<br>           
<td><input type="submit" name="Submit"  value="Send">
</form>
<?php   
} else {      
error_reporting(0);      
$recipient = 'me@myaddress.com';      
$subject = stripslashes($_POST['Subject']);      
$from = stripslashes($_POST['Name']);      
$msg = "Message from: $from\n\n".stripslashes($_POST['MsgBody']);      
             if (mail($recipient, $subject, $msg))         
             echo nl2br("<b>Message Sent:</b>         
To: $recipient         
Subject: $subject         
Message:         $msg");      
              else         
              echo "Message failed to send";}?>
</body>
</html>
How would I change this code to include the fckeditor.I hope this clarifys it. Thanks

-Alex Konetchy

Last edited by konetch; 04-03-2009 at 03:21 PM..
konetch is offline
Reply With Quote
View Public Profile
 
Old 04-04-2009, 01:55 AM Re: Rich Text Editor
Novice Talker

Posts: 5
Name: Jenny Smith
Location: UK
Trades: 0
I think you should try dreamweaver, it is good due to many of it's unique features like Dreamweaver's WYSIWYG mode can hide the HTML code details of pages from the user, making it possible for non-coders to create web pages and sites.Dreamweaver allows users to preview websites in locally-installed web browsers. It also has site management tools, such as FTP/SFTP and WebDAV file transfer and synchronization features, the ability to find and replace lines of text or code by search terms and regular expressions across the entire site, and a templating feature that allows single-source update of shared code and layout across entire sites without server-side includes or scripting.
__________________

Please login or register to view this content. Registration is FREE
Jennysmithuk is offline
Reply With Quote
View Public Profile Visit Jennysmithuk's homepage!
 
Old 04-04-2009, 03:04 AM Re: Rich Text Editor
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Quote:
Originally Posted by Jennysmithuk View Post
I think you should try dreamweaver, it is good due to many of it's unique features like Dreamweaver's WYSIWYG mode can hide the HTML code details of pages from the user, making it possible for non-coders to create web pages and sites.Dreamweaver allows users to preview websites in locally-installed web browsers. It also has site management tools, such as FTP/SFTP and WebDAV file transfer and synchronization features, the ability to find and replace lines of text or code by search terms and regular expressions across the entire site, and a templating feature that allows single-source update of shared code and layout across entire sites without server-side includes or scripting.
For the second time, he is not referring to a text editor or IDE.

@konetch
Looking at the documentation (http://docs.fckeditor.net/FCKeditor_...ntegration/PHP) it appears that all you should need to do is replace your textarea code with the fckeditor code:
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"    "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Contact Form</title>
<meta http-equiv="Content-Type"    content="text/html; charset=iso-8859-1">
</head>
<body>
<?php   if ($_SERVER['REQUEST_METHOD'] != 'POST'){      $me $_SERVER['PHP_SELF'];?>   
<form name="form1" method="post"         action="<?php echo $me;?>">      
<table border="0" cellspacing="0" cellpadding="2">         
<tr>            
Name:<br>      
<input type="text" name="Name">        
<br><br>  
Subject<br>        
<input type="text" name="Subject">        
<br><br>           
Message:<br>          
<?php
require_once("fckeditor/fckeditor.php") ;
$oFCKeditor = new FCKeditor('MsgBody') ;
$oFCKeditor->BasePath '/fckeditor/' ;
$oFCKeditor->Value '' ;
$oFCKeditor->Create() ;
?> 
<br><br><br>           
<br>           
<td><input type="submit" name="Submit"  value="Send">
</form>
<?php   
} else {      
error_reporting(0);      
$recipient 'me@myaddress.com';      
$subject stripslashes($_POST['Subject']);      
$from stripslashes($_POST['Name']);      
$msg "Message from: $from\n\n".stripslashes($_POST['MsgBody']);      
             if (
mail($recipient$subject$msg))         
             echo 
nl2br("<b>Message Sent:</b>         
To: 
$recipient         
Subject: 
$subject         
Message:         
$msg");      
              else         
              echo 
"Message failed to send";}?>
</body>
</html>
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 04-04-2009, 10:27 AM Re: Rich Text Editor
konetch's Avatar
Ultra Talker

Posts: 258
Trades: 0
Alright thanks, the form works now.

-Alex Konetchy
konetch is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Rich Text Editor
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24579 seconds with 12 queries