-
Posts
1,686 -
Joined
-
Last visited
Never
Everything posted by Lamez
-
well see I would, I was really asking for a function, like you could have said "take a look at substr()". I am trying to become a better PHP programmer. Thanks anyways
-
here is a simple while loop, took a noob like me, less than a minuet to write. <?php $start_num = 0; $max_num = 10; while($start_num < $max_num){ $start_num++; echo $start_num."<br>"; } ?>
-
ok I am working on my External Link Checker (http://links.krazypicks.com), by the way, I did get the youtube videos to play . Anyways, in the database I have the urls like this www.site.com, so I wanna check the base URL that is typed in, but some times peeps will type in site.com, instead of adding the www. so is there a function I could use to add the www after http://, if the string does not already contain the www.? -Thanks Guys, I hoped I made myself clear.
-
I fixed it, I used stripslashes();
-
Thanks, I am new to PHP can you provide me the answer on how to fix that, or point me in the right direction?
-
My external link checker to suppose to recognize mp3 files, and youtube videos. I have got to play both Well can you guys double check for me? ELC: http://links.krazypicks.com YouTube: Mp3: http://www.1scottentertainment.com/music/one.mp3 Please also put in some other mp3s and youtube videos!!! -Thanks Guys!
-
lol thanks, that is what I was lookin' for, but I used object tags instead! http://links.krazypicks.com/index.php?url=http%3A%2F%2Fwww.1scottentertainment.com%2Fmusic%2Fone.mp3&fcc61d2d0b4dc53ad77f2652efef28a2=Go!
-
you could use a while loop.
-
life is so much easier with databases!
-
Is there some sorta way to get a single php music player? or a flash player with php backend? I cannot find anything.
-
fixed <?php $link = parse_url($url); $youtube = $link['host'].$link['path']; $watch = "www.youtube.com/watch"; $watch_2 = "youtube.com/watch"; $watch_3 = "http://www.youtube.com/watch"; $watch_4 = "http://youtube.com/watch"; $qu = $link['query']; $string = $qu; $qu = str_replace("v=", "", $string ); if ($youtube == $watch || $youtube == $watch_2 || $youtube == $watch_3 || $youtube == $watch_4) { print'<object width="425" height="349"><param name="movie" value="http://www.youtube.com/v/'.$qu.'&hl=en&fs=1&color1=0x006699&color2=0x54abd6&border=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/'.$qu.'&hl=en&fs=1&color1=0x006699&color2=0x54abd6&border=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="349"></embed></object>'; } ?>
-
ok, I have figured out the problem, the query string it coming out like this: v=HciEQwPu3xY it needs to be this v/HciEQwPu3xY so how can I take off the v= ? -Thanks Guys!
-
here it is, but a bit cleaner. No luck either. <?php ob_start(); $connection = mysql_connect("server", "****", "****"); mysql_select_db("****", $connection); $results = mysql_query("SELECT * FROM `site`")or die(mysql_error()); $row = mysql_fetch_array($results)or die(mysql_error()); $title = $row['name']; $back_address = 'http://www.krazypicks.com'; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="shortcut icon" href="http://www.krazypicks.com/main/style/img/favicon.ico" /> <title>External Link Checker</title> </head> <body bgcolor="#336699"> <table width="100%" border="0"> <tr> <td width="28%"> </td> <td width="46%" align="center" valign="middle"><font face="Tahoma" color="#FFFFFF" size="30pt"><?php echo $title; ?></font></td> <td width="26%"> </td> </tr> <tr> <td> </td> <td rowspan="9" align="center" valign="middle" bgcolor="#FFFFFF"> <font face="Arial, Helvetica, sans-serif"> <?php $links = "<a href=\"http://www.krazypicks.com\">".$title."</a> or <a href=\"?\">Enter URL</a>"; $switch = md5("fladkfkladhfhjkasdfhjkasdhfjkhasjkgfjkasdhfljaskldj///****////***/4564645647978979749899894949494a8df49ad//***/*/*/**/*/*/*/*/*/*/*/*/*//*////****fklajsdkl;fhasdgfjkasdjkfasdflk;jkldsfjklasdhfjkgasjkdfhjkas-----------------fffffd"); $url = $_GET['url']; $url = htmlspecialchars($url); if($url == ($switch)){ echo $links; }else{ if(empty($url)){ //header("Location: ".$back_address); print' Enter URL<br> <form id="form1" name="form1" method="get" action="?"> <label> <input name="url" type="text" id="url" size="50" maxlength="100" /> </label> <input type="submit" name="'.md5("go_s").'" id="'.md5("go_s").'" value="Go!" /> </form><br> <a href="http://www.krazypicks.com">'.$title.'</a> :: <a href="http://www.servage.net/?coupon=cust33591">Hosted by Servage</a>'; }else{ $url = $_GET['url']; $form = $url; if($form != '' && strpos(strtolower($form), 'http://') !== 0){ $form = 'http://'.$form; $url = $form; } $churl = @fopen($url,'r'); if (!$churl && !empty($url)){ echo "<br><center>The URL does not exist, or the server is down.<br>".$links."</center>"; }else{ if (!isset($url)){ header("Location: ?");//do I really need this? }else{ $link = parse_url($url); $youtube = $link['host'].$link['path']; $watch = "www.youtube.com/watch"; $watch_2 = "youtube.com/watch"; $watch_3 = "http://www.youtube.com/watch"; $watch_4 = "http://youtube.com/watch"; if ($youtube == $watch || $youtube == $watch_2 || $youtube == $watch_3 || $youtube == $watch_4) { print'<object width="425" height="344"><param name="movie" value="'.$link['host'].'/v/'.$link['query'].'=en&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="'.$link['host'].'/v/'.$link['query'].'=en&fs=1 type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object>'; } echo "<BR> <BR>"; echo "<center>You are about to leave ".$title." to an external link. <br>Do you want to continue?"; echo "<br>External Link: ".$url."</center>"; ?> <br> <center> <form id="form1" name="form1" method="post" action=""> Yes <label> <input type="radio" name="con_tin" id="radio" value="yes" /> </label> No <label> <input type="radio" name="con_tin" id="radio2" value="no" /> </label> <label> <input type="submit" name="button" id="button" value="Continue" /> </label> </form> </center> <?php } } } if (isset($_POST['con_tin'])){ if ($_POST['con_tin'] == ("yes")){ header("Location: ".$url); }else{ //header("Location: ".$back_address); header("Location: ?url=".$switch); } } }//end first else, about swtich. ?> </font> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table> </body> </html>
-
lol I thought that was coming up. I will clean it up, and if I am stilling having a problem I will post back.
-
well the link checker is suppose to check the link for "youtube.com/watch" or something around that, and if the URL does equal that, then show the embedded video on the page. Well no videos shows up. Here is the entire code: <?php ob_start(); $back_address = 'http://www.krazypicks.com'; if(isset($_SESSION['over_title'])){ $title = $_SESSION['over_title']; }else{ $title = "KrazyPicks"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="shortcut icon" href="http://www.krazypicks.com/main/style/img/favicon.ico" /> <title>External Link Checker</title> </head> <body bgcolor="#336699"> <table width="100%" border="0"> <tr> <td width="28%"> </td> <td width="46%" align="center" valign="middle"><font face="Tahoma" color="#FFFFFF" size="30pt"><?php echo $title; ?></font></td> <td width="26%"> </td> </tr> <tr> <td> </td> <td rowspan="9" align="center" valign="middle" bgcolor="#FFFFFF"> <font face="Arial, Helvetica, sans-serif"> <?php $links = "<a href=\"http://www.krazypicks.com\">".$title."</a> or <a href=\"?\">Enter URL</a>"; $switch = md5("fladkfkladhfhjkasdfhjkasdhfjkhasjkgfjkasdhfljaskldj///****////***/4564645647978979749899894949494a8df49ad//***/*/*/**/*/*/*/*/*/*/*/*/*//*////****fklajsdkl;fhasdgfjkasdjkfasdflk;jkldsfjklasdhfjkgasjkdfhjkas-----------------fffffd"); if($_GET['url'] == ($switch)){ echo $links; }else{ $url = htmlspecialchars($_GET["url"]); if(empty($url)){ //header("Location: ".$back_address); print' Enter URL<br> <form id="form1" name="form1" method="get" action="?"> <label> <input name="url" type="text" id="url" size="50" maxlength="100" /> </label> <input type="submit" name="'.md5("go_s").'" id="'.md5("go_s").'" value="Go!" /> </form><br> <a href="http://www.krazypicks.com">'.$title.'</a> :: <a href="http://www.servage.net/?coupon=cust33591">Hosted by Servage</a>'; }else{ $url = $_GET['url']; $form = $url; if ($form != '' && strpos(strtolower($form), 'http://') !== 0) $form = 'http://'.$form; $url = $form; } $churl = @fopen($url,'r'); if (!$churl && !empty($url)) { echo "<br><center>The URL does not exist, or the server is down.<br>".$links."</center>"; }else{ if (!isset($_GET["url"])){ //header("Location: http://www.krazypicks.com"); }else{ $link = parse_url($url); $youtube = $link['host'].$link['path']; $watch = "www.youtube.com/watch"; $watch_2 = "youtube.com/watch"; $watch_3 = "http://www.youtube.com/watch"; $watch_4 = "http://youtube.com/watch"; if ($youtube == $watch || $youtube == $watch_2 || $youtube == $watch_3 || $youtube == $watch_4) { print'<object width="425" height="344"><param name="movie" value="'.$link['host'].'/v/'.$link['query'].'=en&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="'.$link['host'].'/v/'.$link['query'].'=en&fs=1 type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object>'; } echo "<BR> <BR>"; echo "<center>You are about to leave ".$title." to an external link. <br>Do you want to continue?"; echo "<br>External Link: ".$url."</center>"; ?> <br> <center> <form id="form1" name="form1" method="post" action=""> Yes <label> <input type="radio" name="con_tin" id="radio" value="yes" /> </label> No <label> <input type="radio" name="con_tin" id="radio2" value="no" /> </label> <label> <input type="submit" name="button" id="button" value="Continue" /> </label> </form> </center> <?php } } if (isset($_POST['con_tin'])){ if ($_POST['con_tin'] == ("yes")){ header("Location: ".$url); }else{ //header("Location: ".$back_address); header("Location: ?url=".$switch); } } } ?> </font> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table> </body> </html>
-
ok, I am working on my link checker, and I want it to see if the URL is a link to a youtube video, and if so then I want it to embed it. here is what I have so far, do you guys see any mistakes? <?php $link = parse_url($url); $youtube = $link['host'].$link['path']; $watch = "www.youtube.com/watch"; $watch_2 = "youtube.com/watch"; $watch_3 = "http://www.youtube.com/watch"; $watch_4 = "http://youtube.com/watch"; if($youtube == $watch || $watch_2 || $watch_3 || $watch_4){ print'<object width="425" height="344"><param name="movie" value="'.$link['host'].'/v/'.$link['query'].'=en&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="'.$link['host'].'/v/'.$link['query'].'=en&fs=1 type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object>'; } ?>
-
ok so I have this bit: <?php $link = print_r(parse_url($url)); ?> but it is echoing out, and I know it is in an array, but how to I take it out? here is an example of the out put: how can I just echo out the host?
-
however, I did use "the google", but that does not help at all. is there a function.
-
How do I break down a string? I have a External Link Checker(http://links.krazypicks.com), which will check to see if the URL is in the blacklist that is in the database, but if it is not then it will show a continue warning. Well I want to know how to break down the URL. say they type this in: I want to break it down to www.youtube.com, to check, then display the real URL. Does this make sense? You can just give me a function. -Thanks
-
thank you so much! It makes so much sense now.
-
ok I posted here yesterday (http://www.phpfreaks.com/forums/index.php/topic,219037.0.html). Well I took one of the poster advice, and decided that was a better, and cleaner way to organize the DB. However, I tried it, and I am having problems pulling it out of the database. here is my error: Here is line 10: <?php while ($q = mysql_fetch_array($q)){ ?> here is the whole code: <?php $path = ""; $title = "All Football Teams in DB"; $rank = "yes"; include ($path."main/include/cons/head.php"); $q = mysql_query("SELECT * FROM `foot_teams`"); while ($q = mysql_fetch_array($q)){ $num += 1; $team = $q['confer'].', '.$q['team']; echo $num.'. '.$team; } include ($path."main/include/cons/foot.php"); ?> Now it has been a while since I have done anything with PHP or MySQL, so please do not "flame" me, or call me a noob, which I am. Thanks Guys!
-
Thank you for that bit of code, and there is not a right way, just a more efficient way. Just because you prefer it that way, does not mean it is the so called, right way.
-
oh gosh, brain fart. I knew that
-
Ok, so I have a DB filled with tables named after the football conference's, and I want to take all 12 conference's I have, and take the teams in the table and make one giant list, alphabetized. Well, the code I posted below does not work, I get something like this: "Resource id #26Resource id #27Resource id #28Resource id #29Resource id #30Resource id #31Resource id #32Resource id #33Resource id #34Resource id #35Resource id #36" and here is my code, <?php $path = ""; $title = "Test"; $rank = "yes"; //$login = "yes"; $admin = "yes"; include ($path."main/include/cons/head.php"); $a = mysql_query("SELECT * FROM `Atlantic Coast Conference`"); $b = mysql_query("SELECT * FROM `Big 12`"); $c = mysql_query("SELECT * FROM `Big East`"); $d = mysql_query("SELECT * FROM `Big 10`"); $e = mysql_query("SELECT * FROM `Conference USA`"); $f = mysql_query("SELECT * FROM `Independents`"); $g = mysql_query("SELECT * FROM `Mid-American`"); $h = mysql_query("SELECT * FROM `Mountain West`"); $i = mysql_query("SELECT * FROM `Pac 10`"); $j = mysql_query("SELECT * FROM `SEC`"); $k = mysql_query("SELECT * FROM `Sun Belt`"); $l = mysql_query("SELECT * FROM `WAC`"); $all = $a.$b.$c.$d.$e.$f.$g.$h.$i.$j.$k.$l; echo $all; include ($path."main/include/cons/foot.php"); ?> Thanks guys!
-
Is there a way to convert my xls spreadsheet into my DB? Should I put its contents into a text file, and have certain delimas? like Atlantic Coast Conference -Team A -Team B :::---- Big 12 -Team A -Team B ... and so on. If so, how would I write a piece of code that would take the words like "Big 12" into a new table, then the words with - like "-Team A" into a row? Thanks for the help, and suggestions!