SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2007
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Inserting Tags Into Textbox

    Hi

    Basically I have build a little CMS for an assignment, and basically I would like to have a few buttons which when clicked insert text e.g. <p></p> etc into the textbox, however I really don't know what to use, PHP?

    Help appreciated.

  2. #2
    SitePoint Enthusiast akstar's Avatar
    Join Date
    Feb 2009
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi bopo,

    I am not sure how to build that from scratch. You will need some experts here on that.

    But as a newbie, I would rather just use - http://www.fckeditor.net/demo and implement that onto your site.

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2007
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the suggestion, as mention this is an assignment, but the features I'm implementing are way above the mark criteria, so I'm sure it will be a better solution than a manually coded one.

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,194
    Mentioned
    17 Post(s)
    Tagged
    5 Thread(s)
    The only practical way would be to modify the input on the client side using javascript. This isn't a problem to solved on the server side, but client side.

    This is one that was used at the previous place I worked for. I'm not sure of many others if your open to a packaged solution.

    http://tinymce.moxiecode.com/

  5. #5
    SitePoint Enthusiast
    Join Date
    May 2007
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the suggestion oddz, anyway I'm giving FCKeditor a try, although this is a little topic, it is a PHP question.

    In the documentation it states:

    The editor instance just created will behave like a normal <INPUT> field in a form. It will use the name you've used when creating it (in the above sample, "FCKeditor1"). So, if you have magic quotes enabled, retrieve its value by doing something like this:

    $sValue = stripslashes( $_POST['FCKeditor1'] ) ;

    I'm quite sure everything is configured correctly, however I have no idea if magical quotes are enable (presumed their not) so I'm wondering how I would get around this problem?

    It's declared in PHP as such:

    Code PHP:
    				<?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() ;
    ?>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •