[eluser]webnology[/eluser]
Hi all,
when uploading concert reviews, we also provide the users to upload the embed code you find at YouTube: Normally the code should look like this:
Code:
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/GVw6i_gdUZ0&hl=nl&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/GVw6i_gdUZ0&hl=nl&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>
But when I upload this to the db, it inserts it as:
Code:
&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/KLsWDQ0w23E&hl=nl&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>&lt;embed src="http://www.youtube.com/v/KLsWDQ0w23E&hl=nl&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed>&lt;/object&gt;
So all < and > are not added as they should. I've been trying modifications, but none work. Does anyone knwo why?
My code is as follows (I took out the rest of the code):
Code:
$this->form_validation->set_rules('url_youtube', 'url_youtube', 'htmlspecialchars|xss_clean|trim');
$formdata = array('url_youtube' => $this->input->post('url_youtube'));
$this->db->insert('atg_reviews', $formdata);
The character set of the upload page is UTF-8.
Kind regards,
Michel
[/code]