Jump to content

cannot get video to display when echoed


frijole

Recommended Posts

I am trying to save the embed HTML for a youtube video into my DB so I can call it up later. I have a set-up where I enter the HTML into a textarea and then it shows me the echoed html, which should be the video but it is not displaying. I have tried all kinds of encoding decoding stuff with no change? can anyone lead me in the right direction? I have checked everywhere that I know.

 

If anyone knows a better way to do this I would love to hear it. Thanks.

 

<?php
if(!$_POST){?>

<html>

<table>

<tr>
<td> <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>"> Embed HTML:</td> 
    <td> <textarea rows="5" cols="50" wrap="virtual" name="embedHTML"> Enter Embed HTML Here </textarea></td>
</tr>

<tr>
<td>Description: </td>
<td><textarea rows="5" cols="50" wrap="physical" name="description"> Describe The Video Here </textarea></td>
</tr>

<tr>
<td><input type="submit" value="Add Video!"></form></td>
</tr>

</table>

</html>

<?php
} else {

if (isset($_POST['embedHTML'])||isset($_POST['description']))
{
require_once("dbConnect.php");

$embedHTML = $_POST['embedHTML'];
$videoDesc = $_POST['description'];

echo "<html>";
echo "<blockquote>";
echo $embedHTML;
echo "</blockquote>";
echo "<br />";
echo "<blockquote>";
echo $videoDesc;
echo "</blockquote>";
echo "</html>";
}

}

?>

Link to comment
https://forums.phpfreaks.com/topic/95540-cannot-get-video-to-display-when-echoed/
Share on other sites

sorry, didnt read it right.  THIS IS TESTED AND WORKS



<html>

<table>

<tr>
<td> <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>"> Embed HTML:</td>
    <td> <textarea rows="5" cols="50" wrap="virtual" name="embedHTML"> Enter Embed HTML Here </textarea></td>
</tr>

<tr>
<td>Description: </td>
<td><textarea rows="5" cols="50" wrap="physical" name="description"> Describe The Video Here </textarea></td>
</tr>

<tr>
<td><input type="submit" value="Add Video!"></form></td>
</tr>

</table>

</html>

<?php


if (isset($_POST['embedHTML'])||isset($_POST['description']))
{
require_once("dbConnect.php");

$embedHTML = $_POST['embedHTML'];
$videoDesc = $_POST['description'];

echo "<html>";
echo "<blockquote>";
echo $embedHTML;
echo "</blockquote>";
echo "<br />";
echo "<blockquote>";
echo $videoDesc;
echo "</blockquote>";
echo "</html>";
}



?>

 

i used this for the embedded code:

<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/2GA3a15xF0c"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/2GA3a15xF0c" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>

I am not sure what version I am using. I am writing in Dreamweaver in windows. I tried your code and still have the same problem.....

 

here is the link if you want to see what I see. http://www.thinksnack.com/addVideo.php

 

MySQL Version - 5.0.45-community-log  <-----from my web host

you are escaping all quotes :

<object width=\"425\" height=\"355\"><param name=\"movie\" value=\"http://www.youtube.com/v/2GA3a15xF0c\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.youtube.com/v/2GA3a15xF0c\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"355\"></embed></object>

 

create a file called phpinfo.php and put this in it:

 

<?
phpinfp();
?>

send me a link. i believe u have magic quotes on

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.