我有一個上傳嵌入代碼的文本區域。當我發佈嵌入代碼時,它不會發布完整的代碼。 這是我的嵌入代碼
<iframe frameborder="0" width="480" height="308" src="http://www.dailymotion.com/embed/video/xt7dgo?autoplay=0&logo=0&hideInfos=1&start=0&syndication=108944&foreground=%23F7FFFD&highlight=%23FFC300&background=%23171D1B"></iframe>
這是我的php代碼來得到這個。
public function embeded(){
$this->form_validation->set_rules('video_heading', 'Video heading', 'required|trim|xss_clean');
$this->form_validation->set_rules('embeded', 'Embeded code', 'required|trim|xss_clean');
$this->load->model('videos');
$error['error']="";
if ($this->form_validation->run() == FALSE)
{
$error['error']= validation_errors();
$this->load->view('sidebar');
$this->load->view('addvideo', $error);
$this->load->view('footer');
}else{
//<iframe width="420" height="315" src="http://www.youtube.com/embed/Niiyh3sxwYk" frameborder="0" allowfullscreen></iframe>
$plink=$this->videos->processlink($this->input->post('embeded'));
$info = array('heading'=>$this->input->post('video_heading'),
'status'=>$this->input->post('status'),'video'=>$plink,
'comment'=>$this->input->post('comment'),'category'=>$this->input->post('category'));
$this->load->model('videos');
$obj= (object)$info;
echo "opsted_link".str_replace("syndication","syndicate", $_POST['embeded']);
if(isset($_POST['embeded']))
{
echo $_POST['embeded'];exit;
}
//$this->videos->addembededvideo($obj);
}
}
當我使用它時,我得到了部分像這樣的i幀代碼。
<iframe frameborder="0" width="480" height="308" src="http://www.dailymotion.com/embed/video/xt7dgo?autoplay=0&logo=0&hideInfos=1&start=0&syndicati></iframe>
我將src中的參數syndication = 108944更改爲syndicator = 108944。
現在我得到完整的網址!
是「聯合」是任何保留字? 爲什麼會發生這種情況?
感謝它是這行$ this-> form_validation-> set_rules('embeded','嵌入代碼','required | trim | xss_clean');我刪除了xss_clean它現在工作正常 – Arun