DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2008
    Posts
    164

    how filter source html?

    hi,
    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
    Location
    Maady
    Posts
    1,819
    -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
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  3. #3
    Join Date
    Mar 2008
    Posts
    164
    hi,
    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

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
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links