<?php
/*
 **************************************************************************************************
 *    Copyright (c) 2010-2012 Just Another Video script
 *
 * 	  This file is part of Just Another Video Script.
 *    Version 1.4.3
 *    info@justanothervideoscript.com
 **************************************************************************************************
 *    Come to website for support or buying additional plugins/modules.
 *    http://justanothervideoscript.com/
 **************************************************************************************************
 *    By using this software you agree that you have read and acknowledged our End-User License
 *    Agreement available at http://justanothervideoscript.com/license and can be bound by it.
 **********************************************************************************
 */
include_once("../includes/settings.inc");
include_once("../includes/mysql.inc");
include_once("../includes/functions.inc");
include_once("../includes/imagefunctions.inc");
$db = new mysql($db_host, $db_user, $db_password, $db_database) ;
$sitefolder = getsetting("sitefolder", $db) ;
$sitepath = "http://".$_SERVER['SERVER_NAME'].$sitefolder ;
$rootpath =  $_SERVER['DOCUMENT_ROOT'].$sitefolder ;


$valid = 'true' ;
if (isset($_POST['emtitle'])) {
		$emtitle = quote_smart($_POST['emtitle']) ;

	//make emtitle like it would be in DB without crap
		$emtitle = preg_replace('/\s\s+/', ' ', removespechar($emtitle));
		$db->query("SELECT * from `media` WHERE title = '".$emtitle."'") ;

		if ($db->numRows() > 0) {
			$valid = 'false';
		}
	echo $valid ;
}
if (isset($_POST['title'])) {
		$title = quote_smart($_POST['title']) ;

	//make title like it would be in DB without crap
		$title = preg_replace('/\s\s+/', ' ', removespechar($title));

		$db->query("SELECT * from `media` WHERE title = '".$title."'") ;
		if ($db->numRows() > 0) {
			$valid = 'false';
		}


	echo $valid ;
}


?>
