10-17-2008, 01:26 AM
|
#12 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
You don't have an else for if the link is invalid. That would be the reason for your blank page. Try this code:
PHP Code:
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 { if (preg_match('~^http://(?:[a-z]{2,3}\.)?youtube\.com/watch\?v=.+$~i', $url)) { $url="INSERT into upload (link) values('$url')"; mysql_query($url) or die(mysql_error()); print "Link added!"; } else { print "Link is invalid"; } } } else { print "<form action='YouTube.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>"; }
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|