( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
include("../includes/limittext.php");
include('../Connections/videoondemand.php');
require("../DbSql2.inc.php");
require("../NewsSql2.inc.php");
$db = new NewsSQL();
include("../protect.php");
$valid_extensions = array('ttf' , 'otf' ); // valid extensions
$path = '../assets/newfont/'; // upload directory
if(!empty($_POST['name']) || !empty($_POST['email']) || $_FILES['image'])
{
$img = $_FILES['image']['name'];
$tmp = $_FILES['image']['tmp_name'];
// get uploaded file's extension
$ext = strtolower(pathinfo($img, PATHINFO_EXTENSION));
// can upload same image using rand function
$final_image = md5(date('D, d M Y H:i:s')).$img;
$final_image = strtolower($final_image);
// check's valid format
if(in_array($ext, $valid_extensions))
{
$path = $path.strtolower($final_image);
if(move_uploaded_file($tmp,$path))
{
$realtheme = $_POST['realtheme'];
$themeid = $_POST['themeid'];
$catalogid = $_POST['catalogid'];
$mytheme = $_POST['mytheme'];
$title = $_POST['title'];
$hashtag = $_POST['hashtag'];
$type = $_POST['type'];
$hashtag = str_replace('#','',$hashtag);
$title = str_replace('#','',$title);
$addfile = $db->addMyFont($catalogid,$final_image,$themeid,$type, $title );
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "$server/createMyFontGraphics.php?font=$final_image&saveImage=yes");
curl_exec($ch);
exit();
//include database configuration file
//insert form data in the database
/*$insert = $videoondemand2->query("INSERT mydata (name,email,file_name) VALUES ('".$name."','".$email."','".$path."')");*/
//echo $insert?'ok':'err';
}
}
else
{
echo 'invalid';
}
}
?>