pourriez-vous m'aider ?
Ce code est super long à charger :
<?php
$response_format="txt";
if($ba == '' && $type == '1'){ $link ="http://www.allocine.fr/_video/iblogvision.aspx?cmedia=$url";}
else{
if ($type == '1') {
// Lecteur Allocine
$link="http://www.allocine.fr/_video/iblogvision.aspx?cmedia=$url";
}
// Lecteur Youwatch
elseif ($type == '2') {
$link="http://youwatch.org/$url";
}
//lecteur vk
elseif ($type == '9') {
$link="$link";
}
//lecteur purvideo
elseif ($type == '4') {
$link= "http://www.purevid.com/v/";
}
//lecteur firedrive
elseif ($type == '5') {
$link="http://www.firedrive.com/file/$url";
}
//lecteur uploadhero
elseif ($type == '6') {
$link="http://uploadhero.co/dl/$url";
}
// lecteur Videomega
elseif ($type == '7') {
$link="http://videomega.tv/?ref=$url";
}
// lecteur Exashare
else{
$link="http://exashare.com/$url";
}
}
$url = 'http://api.urlchecker.net/';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "response_format=$response_format&link=$link");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_NOBODY, 0);
$response = curl_exec($ch);
echo $response;
if (stripos($response, 'working') !== FALSE) {
// Set Mysql Connection info
$host ="localhost";
$username="utilisateur";
$password="pass";
$db_name="bdd";
$table_name="files";
require('setting.php');
$fileid = $_GET['filmid'] ;
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// update data in mysql database
$sql = sprintf (" UPDATE $table_name SET status='1' WHERE fileid='$fileid'",
mysql_real_escape_string($fileid));
$result=mysql_query($sql);
if($result) {
echo "<div align='right'>Lien Valide !</div>";
}
else { echo "ERROR";
mysql_close();
}
}
else if (stripos($response, 'dead') !== FALSE) {
// Set Mysql Connection info
$host ="localhost";
$username="utilisateur";
$password="pass";
$db_name="bdd";
$table_name="files";
require('setting.php');
$fileid = $_GET['filmid'] ;
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// update data in mysql database
$sql = sprintf (" UPDATE $table_name SET status='0' WHERE fileid='$fileid'",
mysql_real_escape_string($fileid));
$result=mysql_query($sql);
// if successfull
if($result) {
echo "<div align='right'>Lien mort, vidéo déplacer!</div>";
}
else { echo "ERROR";
mysql_close();
}
}
else if (stripos($response, 'Error') !== FALSE) {
// Set Mysql Connection info
$host ="localhost";
$username="utilisateur";
$password="pass";
$db_name="bdd";
$table_name="files";
require('setting.php');
$fileid = $_GET['filmid'] ;
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// update data in mysql database
$sql = sprintf (" UPDATE $table_name SET status='1' WHERE fileid='$fileid'",
mysql_real_escape_string($fileid));
$result=mysql_query($sql);
// if successfull
if($result) {
echo "<div align='right'>Non pris en charge!</div>";
}
else { echo "ERROR";
mysql_close();
}
}
?>
Comment l'améliorer svp ?