darkfreaks Posted July 31, 2011 Share Posted July 31, 2011 there errors have gone because we have corrected all syntax errors and made sure every post variable is not empty correct Quote Link to comment https://forums.phpfreaks.com/topic/243037-error/page/2/#findComment-1249904 Share on other sites More sharing options...
ecabrera Posted July 31, 2011 Author Share Posted July 31, 2011 yes Quote Link to comment https://forums.phpfreaks.com/topic/243037-error/page/2/#findComment-1249908 Share on other sites More sharing options...
darkfreaks Posted July 31, 2011 Share Posted July 31, 2011 can you tell us how it was working when you had all the IF ELSE statements i might be able to fix it up if i under stand the logic Quote Link to comment https://forums.phpfreaks.com/topic/243037-error/page/2/#findComment-1249911 Share on other sites More sharing options...
ecabrera Posted July 31, 2011 Author Share Posted July 31, 2011 ok when i had all the if else statements everything in the videos page was fine and it was working there was no errors and when u click to view a video every thing work fine to except the comment box the comment box was the only thing that was not showing up you could not comment r summit anything Quote Link to comment https://forums.phpfreaks.com/topic/243037-error/page/2/#findComment-1249913 Share on other sites More sharing options...
darkfreaks Posted July 31, 2011 Share Posted July 31, 2011 also make sure you have brackets around your other IF statements your if's are very unorganized and i can't tell what goes ot what Quote Link to comment https://forums.phpfreaks.com/topic/243037-error/page/2/#findComment-1249920 Share on other sites More sharing options...
ecabrera Posted July 31, 2011 Author Share Posted July 31, 2011 ok thanks i have a last question how do i get the code so i could let my users embed codes from other site like youtube hulu etc. take a look at http://www.brainvid.com/ all of there vids r embed they let users embed there vids this is good for me becuase i dont want to take up space on my server i have this code but i dont know wat to fix <?php ?><head> <title>Adding Videos</title> <link href="style/main.css" rel="stylesheet" type="text/css" /> <link rel="icon" href="favicon.ico" type="image/x-icon" /> </head> <?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='20' style='width: 450px;'><br /> Not the entire URL just the video ID! Just the part in RED!!!<br /> http://www.youtube.com/watch?v=<font color='red'>SoKQz065aQU</font></td> </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> <div id='right'></div> <h2><br /> </h2></td> <?php include_once "footer_template.php"; ? Quote Link to comment https://forums.phpfreaks.com/topic/243037-error/page/2/#findComment-1249925 Share on other sites More sharing options...
darkfreaks Posted July 31, 2011 Share Posted July 31, 2011 look into Video Lightbox it allows you to embed code from youtube Quote Link to comment https://forums.phpfreaks.com/topic/243037-error/page/2/#findComment-1249926 Share on other sites More sharing options...
ecabrera Posted July 31, 2011 Author Share Posted July 31, 2011 ok Quote Link to comment https://forums.phpfreaks.com/topic/243037-error/page/2/#findComment-1249927 Share on other sites More sharing options...
ecabrera Posted August 1, 2011 Author Share Posted August 1, 2011 hey darkfreaks u know the whole video script i gave to see what was wrong well i tryed it again and gave me this Notice: Undefined variable: getid in /home/ecabrera/public_html/videos.php on line 51 $query = mysql_query("SELECT * FROM videos WHERE id='$getid'"); Notice: Undefined variable: getid in /home/ecabrera/public_html/videos.php on line 1075 This video has no comments. $query = mysql_query("SELECT * FROM video_comments WHERE video_id='$getid' ORDER BY id DESC LIMIT $start, $perpage"); Notice: Undefined variable: msg in /home/ecabrera/public_html/videos.php on line 1424 echo "<b>$msg</b><br />"; Notice: Undefined variable: getid in /home/ecabrera/public_html/videos.php on line 1539 </form>"; Quote Link to comment https://forums.phpfreaks.com/topic/243037-error/page/2/#findComment-1250094 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.