how filter source html?

DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: how filter source html?

  1. #1
    Join Date
    Mar 2008

    how filter source html?

    i building a site of ads that can accept html source for users can show their ads with images with the custum sizes and with custum fonts and tables
    flash content etc
    but i want block some code like php code

    < php>
    include "ext";

    and javascript too and other code that can result in a segurity issue.
    there is any function in php or other way to detect that code before save to the db?
    thanks a lot for your help

  2. #2
    Join Date
    Oct 2005
    -you can parse if " <?php " exists in the string or "<script" or "<?" ..etc
    -you can get the value from the database as "string" and put them directly into a "string-variable" so that it won't be executed in the server side but only shown in the user side .. for the java-script , stripslashes and remove quotes (or replace by &quot; ) before displaying the string .. this won't make the script able to run but considered as a normal string ..
    Programmer&Cracker CS

  3. #3
    Join Date
    Mar 2008
    thanks for your help i will try that

Similar Threads

  1. Connecting GUI & Application
    By null_guy in forum Java
    Replies: 27
    Last Post: 07-16-2008, 06:33 AM
  2. open source free html editors
    By karunakarroyal in forum AJAX
    Replies: 1
    Last Post: 03-17-2008, 07:50 AM
  3. runtime.exec()
    By Seb in forum Java
    Replies: 7
    Last Post: 10-18-2005, 05:14 PM
  4. Replies: 0
    Last Post: 09-16-2000, 02:41 PM
  5. Scrambing html source code
    By Eng Heong in forum Web
    Replies: 13
    Last Post: 06-28-2000, 02:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center