Page 1 of 1
How to add an iframe or Youtube embed code ?
Posted: 2013-02-05 22:12
by bambinou
Hello,
I have noticed that the html editor won't let us add a simple Youtube embed or iframe code, any idea how to go around this problem please? I do not want to upload videos to the server, it takes too long and also can breach the copyright of the video maker if not used in Youtube itself.
Regards,
Ben
Re: How to add an iframe or Youtube embed code ?
Posted: 2013-02-07 11:01
by a.gneady
Hi Ben, if the field where you want to embed youtube video would always be used for this purpose in all records, you could follow the procedure in this article:
http://bigprof.com/appgini/tips-and-tut ... ypal-links ... the article describes integrating Paypal links as iframes, but it would work for youtube as well by changing the iframe code to that for youtube.
Re: How to add an iframe or Youtube embed code ?
Posted: 2013-02-07 23:50
by bambinou
Thanks for the reply.
One little thing I do not understand in the tutorial, is seems that we have to hardcode the file but will our records not be erased each time we add a new row in the table?
Thank you,
Ben
Re: How to add an iframe or Youtube embed code ?
Posted: 2013-02-08 20:25
by a.gneady
Umm .. you'll have to hard-code the file indeed .. but that won't get overwritten on adding new records: records are stored in the database, and this file is a template file on the server storage ... Unless I misunderstood your question.
Re: How to add an iframe or Youtube embed code ?
Posted: 2013-02-09 17:07
by bambinou
Thank you for the reply Ahmad,
Ben
Re: How to add an iframe or Youtube embed code ?
Posted: 2013-03-07 17:58
by bdurfee
Another option works if you are just using your AG code for managing database content, but actually displaying the database content on your web site. (In other words, AG is not your whole web site.)
Add the YouTube code as normal in the AG form as normal. It will convert certain characters into codes. In the output on your web page, convert the codes back into characters.
Code: Select all
$pattern = array();
$pattern[0] = '/</';
$pattern[1] = '/>/';
$replacement = array();
$replacement[0] = '<';
$replacement[1] = '>';
$video = preg_replace($pattern, $replacement, $youtube_fieldcontents);
My concerns are:
1. What kind of security issues could this cause?
2. Are there ways to address those security issues?