10-16-2008, 08:41 PM
|
#4 (permalink)
|
|
Super Moderator
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
|
CODE EDIT:
PHP Code:
<?php
error_reporting(E_ALL ^ E_NOTICE);
include "config.php";
if(isset($_POST['submit']))
{
$url=$_POST['url'];
if(strlen($url)<1)
{
print "You did not enter a URL.";
}
else
{
$check = (preg_match('~^http://[a-z]{2,3}\.youtube\.com/\?v=[\w-]+(?:&feature=related)?$~i','',$url));
if($check = TRUE)
{
$url="INSERT into upload (link) values('$url')";
mysql_query($url) or die(mysql_error());
print "Link added!";
}
}
}
else
{
print "<form action='index.php' method='post'>";
print "URL(include http://):<br>";
print "<input type='text' name='url' size='20'><br>";
print "<input type='submit' name='submit' value='submit'></form>";
}
?>
|
|
|
|