ecabrera Posted July 29, 2011 Share Posted July 29, 2011 Hey I have a website and i want to let users embed url.videos instead of up loading them how do I how do I let them embed videos from YouTube r hulu r and video sharing website Quote Link to comment https://forums.phpfreaks.com/topic/243144-embed/ Share on other sites More sharing options...
Ninjakreborn Posted July 29, 2011 Share Posted July 29, 2011 On Youtube you click "Embed this video". Then copy/paste the code into your site. It's probably pretty similar for the other video sites as well. Quote Link to comment https://forums.phpfreaks.com/topic/243144-embed/#findComment-1248867 Share on other sites More sharing options...
ecabrera Posted July 29, 2011 Author Share Posted July 29, 2011 ok but can someone help me like how is the script suppose to look like becuase i want members to go to the add video section and instead of uploading a video the embed videos from youtube and other video sharing website is there a way to do that Quote Link to comment https://forums.phpfreaks.com/topic/243144-embed/#findComment-1248876 Share on other sites More sharing options...
xc0n Posted July 29, 2011 Share Posted July 29, 2011 you will need a basic mysql database to hold the embed data the users add, then you will neeed a php page eg: add_videos.php for users to add the embed tag, and then another php page eg: list_videos.php to display the embed code. Quote Link to comment https://forums.phpfreaks.com/topic/243144-embed/#findComment-1248877 Share on other sites More sharing options...
ecabrera Posted July 29, 2011 Author Share Posted July 29, 2011 yea i already have a everything except im creating the add video script but i dont know how to make user embed script ill should u the script i need help on that plz <?php $title = " - Add Video"; ?> <div id='left'> <?php $categories = " <option value='Pets & Animals'>Pets & Animals</option> <option value='Gaming'>Gaming</option> <option value='How to & Style'>How to & Style</option> <option value='Autos & Vehicles'>Autos & Vehicles</option> <option value='Nonprofits & Activism'>Nonprofits & Activism</option> <option value='People & Blogs'>People & Blogs</option> <option value='Education'>Education</option> <option value='Science'>Science</option> <option value='Technology'>Technology</option> <option value='Comedy'>Comedy</option> <option value='Music'>Music</option> <option value='Sports'>Sports</option> <option value='Entertainment'>Entertainment</option> <option value='Film & Animation'>Film & Animation</option> <option value='News & Politics'>News & Politics</option> "; $form = "<form action='addvideo.php' method='post'> <table> <tr> <td>Title:</td> <td><input type='text' name='title' style='width: 450px;'></td> </tr> <tr> <td>Description:</td> <td><textarea name='description' style='width: 450px; height: 100px;'></textarea></td> </tr> <tr> <td>Keywords:</td> <td><input type='text' name='keywords' style='width: 450px;'></td> </tr> <tr> <td>Category:</td> <td><select name='category' style='width: 455px;'> <option value=''>Select One</option> $categories </select></td> </tr> <tr> <td>Video ID:</td> <td><input type='text' name='videoid' maxlength='100' style='width: 450px;'><br /> </tr> <tr> <td></td> <td><input type='submit' name='addbtn' value='Add Video'></td> </tr> </table> </form>"; if ($_POST['addbtn']){ $title = $_POST['title']; $description = $_POST['description']; $keywords = $_POST['keywords']; $category = $_POST['category']; $videoid = $_POST['videoid']; if ($title){ if ($description){ if ($keywords){ if ($category){ if ($videoid){ if (strstr($categories, "<option value='$category'>$category</option>")){ require("scripts/checkuserlog.php"); $query = mysql_query("SELECT * FROM videos WHERE videoid='$videoid'"); $numrows = mysql_num_rows($query); if ($numrows == 0){ $date = date("F d, Y"); // October 09, 2010 mysql_query("INSERT INTO videos VALUES ('', 'user_id', 'user_name', '$title', '$description', '$keywords', '$category', '$videoid', '0', '0', '$date')"); $query = mysql_query("SELECT * FROM videos WHERE user_id='id' AND title='$title' AND videoid='$videoid'"); $numrows = mysql_num_rows($query); if ($numrows == 1){ $row = mysql_fetch_assoc($query); $id = $row['id']; echo "Your video has been added. <a href='videos.php?id=$id'>Click here to view it.</a>"; } else echo "<font color='red'>Your video was not added to the database for some reason.</font>"; } else echo "You can not add a video that is already in the database. $form"; mysql_close(); } else echo "You did not submit a valid category. $form"; } else echo "You did not submit a video ID. $form"; } else echo "You did not select a category. $form"; } else echo "You did not submit any keywords. $form"; } else echo "You did not submit a description. $form"; } else echo "You did not submit a title. $form"; } else echo "$form"; ?> </div> Quote Link to comment https://forums.phpfreaks.com/topic/243144-embed/#findComment-1248882 Share on other sites More sharing options...
ecabrera Posted July 29, 2011 Author Share Posted July 29, 2011 help anyone plzzzzzzz Quote Link to comment https://forums.phpfreaks.com/topic/243144-embed/#findComment-1248892 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.