Jump to content

Collegeboox

Members
  • Posts

    65
  • Joined

  • Last visited

    Never

Everything posted by Collegeboox

  1. www.farleycrossflags.com Let me know what you guys like and what should be changed...
  2. I would love something that I did not need a database for.
  3. I would love to add a comment section to my music blogging site. Does anyone have some simple code that they would not mind sending me? or at least helping me with this situation?
  4. So this is saying if the string $link contains soundcloud then it does not equal false? So I could do... if(strpos($link, 'soundcloud') !== FALSE) echo "" else echo"" Correct or no??
  5. I have posted 2 other times asking for help and I am not getting any help from anyone they just keep telling me why didnt I do it this way why didnt I do it that way...So I thought it would just be easier to just ask if someone could tell me the code.
  6. Can someone write me some simple code to check to see if the url has the word "soundcloud" in them. This is what I want to do.... This is my code now... echo " <h3> $title - $author</h3> </br> <iframe width='640' height='360' src='$link' frameborder='0' allowfullscreen></iframe> </br> </br> $message </br> <font color='#8b8d9b' size='1'>Posted By: $username $date</font> </br></br></br></br></br> "; However I want to pull the link value out of the database and see if it contains the word "soundcloud" and if it does do this...(note the height is changed) echo " <h3> $title - $author</h3> </br> <iframe width='640' height='100' src='$link' frameborder='0' allowfullscreen></iframe> </br> </br> $message </br> <font color='#8b8d9b' size='1'>Posted By: $username $date</font> </br></br></br></br></br> "; Any help would be greatly appreciated.
  7. The users are not using it is is a group of 4 admins one including me. Also I do not know how to do that otherwise that is what I would have done.
  8. My site is a music blogging site where the admins blog music that they have found and I want to make sure that they type in "<iframe width="640" height="360" src="http://www.youtube.com/embed/BPVlNTQRoZk?feature=player_embedded" frameborder="0" allowfullscreen></iframe>" in the textbox rather than this " Ideas?
  9. I am trying to write an if statement that checks to make sure the information put in the text box is an imbedded file. Does anyone know how to do that?
  10. well i guess just taking the strp out made it work I want to thank everyone that helped me....THANK YOU
  11. To be honest at this point I am not worried about people injecting stuff into the website because the page that this is on is password protected. Can you give me the code that you would use. I am not familiar with casting.
  12. haha I am assuming messing it up, but I mean it used to work. I posted a couple things then all of a sudden I get the error. So what should I change it to?
  13. This is what is being inputted in link line... <object style="height: 390px; width: 640px"><param name="movie" value="http://www.youtube.com/watch?v=NhO-tTsxVso?version=3&feature=player_embedded"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="http://www.youtube.com/watch?v=NhO-tTsxVso?version=3&feature=player_embedded" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="360"></object>
  14. I am getting this error when i put that code in... Notice: Undefined index: embedded in /home/content/71/8511971/html/posted.php on line 20... I kind of understand what it is saying but I do not know how to fix it, any ideas?
  15. I understand and I will put that in my code now, however did you see anything that could be causing my problem.
  16. Below are two pages...Post.php. and Posted.php the posted page checks and makes sure everything is filled out and makes sure that the link has not been already added. The problem I am having is that it is not pulling over the link information. Every time you hit submit it drops down and goes to saying that you forgot to fill something in and I have it showing everything right now so when that happens I can see what is not going through and the $link never comes through. Any ideas? if anyone needs a better explanation please post and I will try to explain better....basically I am trying to post and everything posts but the link. POST.PHP <h1>Post</h1> <div class="descr"></div><form method="post" action="posted.php"> <table align="center"> <tr> <td> Youtube Embed Link </td> <td> <input name="link" type="text" id="link"/> </td> </tr> <tr> <td> Title Of Song </td> <td> <input name="title" type="text" id="title" /> </td> </tr> <tr> <td> Author </td> <td> <input name="author" type="text" id="author" /> </td> </tr> <tr> <td> Text: </td> <td> <input name="information" type="text" id="information" /> <br /> </td> </tr> <tr> <td colspan="2" align="center"> <br> <input name="submit" type="submit" value="Post" /> </td> </tr> </table> </form> POSTED.PHP <?php //msut be logged in page session_start(); if ($_SESSION['username']) { echo""; } else die("You must log in first!"); //form information $submit = $_POST['submit']; $row4 = $_SESSION['username']; // form data $link = strip_tags($_POST['link']); $information = strip_tags($_POST['information']); $title = strip_tags($_POST['title']); $author = strip_tags($_POST['author']); $date = date('Y-m-d'); //Connect To Database $hostname=''; $username2=''; $password2=''; $dbname=''; mysql_connect($hostname,$username2, $password2) OR DIE ('Unable to connect to database! Please try again later.'); mysql_select_db($dbname); $querycheck = "SELECT * FROM videos WHERE username='$row4'"; $result = mysql_query($querycheck); while($rowz = mysql_fetch_array($result)) $linkcheck = $rowz['link']; if ($submit) { if ($link&&$information&&$title&&$author) { if ($link == $linkcheck) { die ("This link has already been posted."); } else { //Connect To Database $hostname=''; $username2=''; $password2=''; $dbname=''; mysql_connect($hostname,$username2, $password2) OR DIE ('Unable to connect to database! Please try again later.'); mysql_select_db($dbname); $queryreg = mysql_query("INSERT INTO videos Values ('','$row4','$link','$title','$author','$information','$date')"); } } else { die ("You forgot to put something in the link/title/author/text box. $information $title $link $author"); } } ?>
  17. I am trying to have a search bar and this is the search results page. However when they search they have the option to type in anything and it will search the entire directory for what ever they type in so if they type in "Dog" I want dog to be searched for in the database under title and author this is the code I have now...can anyone help me?? // Build SQL Query $query = "select * from videos where title like \"%$trimmed%\" order by id DESC"; // EDIT HERE and specify your table and field names for the SQL query
  18. How do I run a cron job? and what is the code for a cron job?
  19. Example DELETE FROM table_name WHERE date_created < DATE_SUB(curdate(), INTERVAL 30 DAY) So you are saying to place this code on the homepage that is going to be pulling the information from the database everyday?
  20. Does anyone have a code that will automatically delete stuff out of the database after 30 days of being in there...?
  21. I am pulling an youtube embedded code from a database however when I have the homepage pull it from the database it will not show anything after the video.... EXAMPLE...(this is what it should look like) 1.) Title By: Author Youtube Video Message Posted By: (however this is what it looks like) 1.) Title By: Author Youtube Video *The "message" and "Posted By:" just do not show up* The code is below can someone help me with this problem., it would be greatly appreciated. <?php //open database $connect = mysql_connect("Database","name","password") or die("Not connected"); mysql_select_db("database") or die("could not log in"); $query = "SELECT * FROM boox ORDER BY date DESC"; $result = mysql_query($query); // Get the page number, if none is set - it is 0 if( isset($_GET['page']) ) { $page =$_GET['page']; } else { $page = 0; } $resultsPerPage = 15; $num = mysql_num_rows($result); // amount of rows $loops = $page*$resultsPerPage; // starting loops at.. while ($loops < $num && $loops < ($page+1)*$resultsPerPage ) { $link = mysql_result($result,$loops,"link"); // get result from the 'link' field in the table $username = mysql_result($result,$loops,"username"); // get result from the 'username' field in the table $messsage = mysql_result($result,$loops,"message"); $author = mysql_result($result,$loops,"author"); $title = mysql_result($result,$loops,"title"); $date = mysql_result($result,$loops,"date"); if ($pagelimit == 0) { $pagelimit == 1; } if ($pagelimit <= 15) // echo stuff here $loopz = $loops + 1; echo " &nbsp </br><align='left'><table width='297' height='900' border='1' align='center' bgcolor='#111'> <tr> <td>$loopz.) $title By: $author </br> $link </br> $message </br> Posted By: $username $date </td> </tr> </table></br><br>"; $count++ ; $pagelimit++; $loops++; } if ( $page!=0 ) // Show 'Previous' link { $page--; $prevpage = ($page + 1); echo "<br><br><br><a href='index.php?page=$page'>Previous $prevpage </a>"; $page++; } if ($loops > 5&&($page+1)*$resultPerPage < $num ) // Show 'next' link { $page++; $nextpage = ($page + 1); echo "<a href='index.php?page=$page'> Next $nextpage</a>"; } ?>
  22. I am having trouble pulling a youtube embedded code from my database. Everything else comes out fine however it just doesnt pull anything out where the embedded code is supposed to be. Any ideas I put the code below. All help would be greatly appreciated, also if anyone is feeling generous and would like to help me some more please message me I have a couple other small questions. <?php //open database $connect = mysql_connect("Database","name","password") or die("Not connected"); mysql_select_db("database") or die("could not log in"); $query = "SELECT * FROM boox ORDER BY date DESC"; $result = mysql_query($query); // Get the page number, if none is set - it is 0 if( isset($_GET['page']) ) { $page =$_GET['page']; } else { $page = 0; } $resultsPerPage = 15; $num = mysql_num_rows($result); // amount of rows $loops = $page*$resultsPerPage; // starting loops at.. while ($loops < $num && $loops < ($page+1)*$resultsPerPage ) { $link = mysql_result($result,$loops,"link"); // get result from the 'Title' field in the table $username = mysql_result($result,$loops,"username"); // get result from the 'Content' field in the table $messsage = mysql_result($result,$loops,"message"); $date = mysql_result($result,$loops,"date"); if ($pagelimit == 0) { $pagelimit == 1; } if ($pagelimit <= 15) // echo stuff here $loopz = $loops + 1; echo " &nbsp </br><align='left'><table width='297' height='900' border='1' align='center' bgcolor='#111'> <tr> <td>$loopz. </br> $message </br> Posted By: $username $date </td> </tr> </table></br><br>"; $count++ ; $pagelimit++; $loops++; } if ( $page!=0 ) // Show 'Previous' link { $page--; $prevpage = ($page + 1); echo "<br><br><br><a href='index.php?page=$page'>Previous $prevpage </a>"; $page++; } if ($loops > 5&&($page+1)*$resultPerPage < $num ) // Show 'next' link { $page++; $nextpage = ($page + 1); echo "<a href='index.php?page=$page'> Next $nextpage</a>"; } ?>
  23. information not posting into the database the code below is the check code/insert code. Please if anyone knows why let me know. [color=red]<?php //msut be logged in page session_start(); if ($_SESSION['username']) { echo""; } else die("You must log in first!"); //form information $submit = $_POST['submit']; $row4 = $_SESSION['username']; // form data $link = strip_tags($_POST['link']); $message = strip_tags($_POST['message']); $title = strip_tags($_POST['title']); $author = strip_tags($_POST['author']); $date = date('Y-m-d'); $connect = mysql_connect("db","username","password") or die("Not connected"); mysql_select_db("username") or die("could not log in"); $querycheck = "SELECT * FROM boox WHERE username='$row4'"; $result = mysql_query($querycheck); while($rowz = mysql_fetch_array($result)) $linkcheck = $rowz['link']; if ($submit) { if($link&$title&$author) { // check username and subject lentgh if ($linkcheck == $link) { die ("This link has already been posted."); } else { //open database $connect = mysql_connect("db","username","password") or die("Not connected"); mysql_select_db("username") or die("could not log in"); $queryreg = mysql_query("INSERT INTO boox Values ('','$row4','$link','$title','$author','$message','$date')"); echo "You have just officialy posted on the Catalina Beat Mixers. "; } } } else { die ("You forgot to put something in the link/title/author box."); } ?>[/color] [code]
  24. I am creating a music blogging site however the main page will only show one video the code is below anyone have any ideas? " <?php //open database $connect = mysql_connect("******","username","password") or die("Not connected"); mysql_select_db("collegebooxboox") or die("could not log in"); $query = "SELECT * FROM boox ORDER BY date DESC"; $result = mysql_query($query); // Get the page number, if none is set - it is 0 if( isset($_GET['page']) ) { $page =$_GET['page']; } else { $page = 0; } $resultsPerPage = 15; $num = mysql_num_rows($result); // amount of rows $loops = $page*$resultsPerPage; // starting loops at.. while ($loops < $num && $loops < ($page+1)*$resultsPerPage ) { $link = mysql_result($result,$loops,"link"); // get result from the 'Title' field in the table $username = mysql_result($result,$loops,"username"); // get result from the 'Content' field in the table $messsage = mysql_result($result,$loops,"message"); $date = mysql_result($result,$loops,"date"); if ($pagelimit == 0) { $pagelimit == 1; } if ($pagelimit <= 15) // echo stuff here $loopz = $loops + 1; echo " &nbsp </br><align='left'><table width='297' height='900' border='1' align='center' bgcolor='#111'> <tr> <td>$loopz. $link </br> $message </br> Posted By: $username $date </td> </tr> </table></br><br>"; $count++ ; $pagelimit++; $loops++; } if ( $page!=0 ) // Show 'Previous' link { $page--; $prevpage = ($page + 1); echo "<br><br><br><a href='index.php?page=$page'>Previous $prevpage </a>"; $page++; } if ($loops > 5&&($page+1)*$resultPerPage < $num ) // Show 'next' link { $page++; $nextpage = ($page + 1); echo "<a href='index.php?page=$page'> Next $nextpage</a>"; } ?> "
×
×
  • 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.