I agree your question is not clear. What kind of code should be pasted in your textarea? Javascript? html iframe?
Show some samples.
Main Topics
Browse All TopicsI want to have a textbox where user can type embed code or widget code such as that from youtube or mypspace widget or slideshare and any other widget
What security check is needed to accept or display this? How should I go about accepting widgets?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
The main goal is to accept a widget to show on users profile page - much like myspace.
Example: Goto any youtube video and look at the embed textbox below video:
http://www.youtube.com/wat
Many other widgets are listed at:
http://codex.wordpress.org
Some are iframe based, some are javascript based etc
I want the user to be able to enter the code for a widget and then display it on their profile - much like myspace, facebook, etc allow .
The question is what kind of checks (if any) do I need to do so security is not compromised ?
For html widgets you can try to parse the html markup to ensure only a subset of allowed tag exists (like comments and <iframe>). You may use http://www.php.net/strip_t
For the JavaScript part you are out of luck. Evaluating statically a piece of code to see if it is good or bad is undecidible (see the Turing's Halting Problem). So the best you can do is build a list of regular expressions containing all the allowed javascript widgets, appropriately parametrizing it.
Paste a JavaScript widget example if you want me to show how to build the relative regexp out of it.
Business Accounts
Answer for Membership
by: holy007Posted on 2007-09-19 at 04:31:08ID: 19919669
What is your main goal of the textbox what do you want to do with the inserted text?
Your not very clear about that in your question about what the goal is of the whole picture.