3
I’m putting the contents of an iframe in an input, only it does not appear complete, just this in the input text:
<iframe width=
And it appears on the bottom line:
" type="text"/>
Look at the code where I update the field "name" and "iframe", when it appears what is registered in iframe is giving problem, iframe does not appear all in the input:
<?php include("header.php"); ?>
<div id="box">
<div id="header">
<div id="header_logo">
<a href="painel.php"><img src="../images/DCDesenvolvimento.png" alt="" border="0"/></a>
</div>
</div>
<div id="content">
<div id="menu">
<?php include("menu.php");?>
</div>
<div id="conteudo">
<span class="caminho">Home » Editar Vídeos</span>
<h1>Cadastrar Post</h1>
<?php
if(isset($_POST['cadastrar_post']) && ($_POST['cadastrar_post'] == "cad"))
{
$id_a_editar = strip_tags(trim($_POST['id_do_post']));
$nome = strip_tags(trim($_POST['nome']));
$iframe = $_POST['iframe'];
$editar_posts = mysqli_query($conexao,"UPDATE baterista
SET nome = '$nome', video = '$iframe'
WHERE id = '$id_a_editar'")or die(mysqli_error($conexao));
if($editar_posts>=1)
{
echo "<div class=\"ok\">Seu tópico foi atualizado com sucesso!</div>";
}
else
{
echo "<div class=\"no\">Seu tópico não foi atualizado</div>";
}
}
$editar_post_id = $_POST['id_do_post'];
$dados = mysqli_query($conexao, "SELECT id, nome, video
FROM baterista WHERE id = '$editar_post_id'")or die(mysqli_error($conexao));
if(mysqli_num_rows($dados) == 0)
{
echo "Não encontramos notícias nesse momento";
}
else
{
while($res_videos = mysqli_fetch_array($dados))
{
$id_do_post = strip_tags(trim($res_videos[0]));
$nome = strip_tags(trim($res_videos[1]));
$iframe = $res_videos[2];
?>
<form name="cadastrar_posts" method="post" action="" onsubmit="return valida()" enctype="multipart/form-data">
<fieldset>
<span>Nome</span>
<input name="nome" value="<?=$nome?>" id="nome" type="text"/>
<span id="avisonome"></span>
<span>Iframe</span>
<input name="iframe" value="<?php echo $iframe;?>" type="text"/>
<input type="hidden" name="cadastrar_post" value="cad"/>
<input type="submit" value="Editar" class="cadastro_btn" name="editar"/>
</fieldset>
</form>
<?php
}
}
?>
</div>
</div>
<div id="clear"></div>
</div>
<?php include("footer.php");