X
ximebcn
Beta
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
Oh! me as roto el corazon con esto: Te doy la ultima mano, perdón, ya seria mucho trabajo hacertelo..:sorrow::sorrow: La verdad que no se como podria agradecerte tanto esfuerzo y entiendo que no dispongas de tiempo para hacerle el trabajo a otro pero por favor, aunque no me escribas mas código no me dejes solo ahora. no se a que te refieres que la edición me la dejas ami.
Tal cual esta ahora mismo con lo que me as pasado, desde la zona administracion, puedo editar perfectamente el contenido asi que supongo que a eso no te refieres, podrias decirme que le falta por hacer? no que me escribas el codigo de lo que falta si no que me especifiques un poco mas para poder buscar en google y no dejarlo a medias pues practicamente el trabajo es tuyo y yo no tengo conocimientos para acabarlo.
$nombre_servidor = array('1.png', '2.png', '3.png');
$tipo_audio = array('Spain.png','Portugal.png','Argentina.png'); // aqui el idioma del audio
$tipo_calidad = array('calidad1','calidad2','calidad3'); // la calidad del video
$enlace_roto = array('ok', 'caido'); // esto es para informar si el enlace esta ok o caido, pueden poner lo que quieran
//en todas pueden poner todas las opciones que quieran.
$add_to_ID = $_POST['seccion'];
if ( ! is_numeric( $add_to_ID ) )
die("Wrong ID!");
$add_to_ID = abs(intval($add_to_ID));
if ( ! $add_to_ID )
die("Wrong ID!");
global $enlace_roto;
if (in_array($_POST['roto'],$enlace_roto)){
$existing_list = get_post_meta($post->ID,"peliculas_data",true);
if (isset($existing_list[$add_to_ID])){ //Verificar que el $add_to_ID exista
$existing_list[$add_to_ID]['roto'] = $_POST['roto'];
update_post_meta($post->ID,'peliculas_data',$existing_list);
}
}else{
die("roto no definido");
}
}
if ( !empty( $_POST['servidor']) and !empty( $_POST['enlace'])) {
$current_user = wp_get_current_user();
if ( is_user_logged_in() ) {
$add_to_ID = get_post_meta($post->ID,"_linksAutoincrement",true);
if ( empty( $add_to_ID ) )
$add_to_ID = 0;
$add_to_ID = $add_to_ID + 1;
$existing_list = get_post_meta($post->ID,"peliculas_data",true);
if (empty($existing_list))
$existing_list = array();
$existing_list[$add_to_ID]['servidor'] = $_POST['servidor'];
$existing_list[$add_to_ID]['audio'] = $_POST['audio'];
$existing_list[$add_to_ID]['calidad'] = $_POST['calidad'];
$existing_list[$add_to_ID]['roto'] = $_POST['estado'];
$existing_list[$add_to_ID]['enlace'] = $_POST['enlace'];
$existing_list[$add_to_ID]['user'] = $current_user->user_login;
if (validarLink($existing_list[$add_to_ID])==false){
die("Un campo no esta entre los permitidos");
}
if (filter_var($_POST['enlace'], FILTER_VALIDATE_URL) !== false){
update_post_meta($post->ID,'peliculas_data',$existing_list);
update_post_meta($post->ID,'_linksAutoincrement', $add_to_ID);
}else{
die("enlace no valido!");
}
}else{
die("No estas logueado!");
}
}
function Print_peliculas_fileds($cnt, $p = null){
global $nombre_servidor;
global $tipo_audio;
global $tipo_calidad;
global $enlace_roto;
if ($p === null) {
$enlace = $user = $servidor = $audio = $calidad = $roto = '';
} else {
$servidor = $p['servidor'];
$nombre_servidors = $p['nombre_servidors'];
$audio = $p['audio'];
$calidad = $p['calidad'];
$enlace = $p['enlace'];
$user = $p['user'];
$roto = $p['roto'];
}
$retu = '<p style="margin-bottom: 22px;">';
$retu .= '<label>Servidor</label> ';
$retu .= '<select name="peliculas_data[' . $cnt . '][servidor]" id="servidor"> ';
foreach ($nombre_servidor as $nombre_servidores) {
if ($nombre_servidores == $servidor) {
$retu .= '<option value="' . $servidor . '" selected="slelected" >' . $servidor . '</option>';
} else {
$retu .= '<option value="' . $nombre_servidores . '">' . $nombre_servidores . '</option>';
}
}
$retu .= '</select>';
$retu .= '<label>Audio :</label> ';
$retu .= '<select name="peliculas_data[' . $cnt . '][audio]" id="audio"> ';
foreach ($tipo_audio as $tipo_audios) {
if ($tipo_audios == $audio) {
$retu .= '<option value="' . $audio . '" selected="slelected" >' . $audio . '</option>';
} else {
$retu .= '<option value="' . $tipo_audios . '">' . $tipo_audios . '</option>';
}
}
$retu .= '</select>';
$retu .= ' <label>Calidad :</label>';
$retu .= '<select name="peliculas_data[' . $cnt . '][calidad]" id="audio"> ';
foreach ($tipo_calidad as $tipo_calidades) {
if ($tipo_calidades == $calidad) {
$retu .= '<option value="' . $calidad . '" selected="slelected" >' . $calidad . '</option>';
} else {
$retu .= '<option value="' . $tipo_calidades . '">' . $tipo_calidades . '</option>';
}
}
$retu .= '</select>';
$retu .= ' <label>Enlace Roto :</label>';
$retu .= '<select name="peliculas_data[' . $cnt . '][roto]" id="audio"> ';
foreach ($enlace_roto as $enlace_rotos) {
if ($enlace_rotos == $roto) {
$retu .= '<option value="' . $roto . '" selected="slelected" >' . $roto . '</option>';
} else {
$retu .= '<option value="' . $enlace_rotos . '">' . $enlace_rotos . '</option>';
}
}
$retu .= '</select>';
$retu .= '</br>';
$retu .= ' <label>Enlace :</label>';
$retu .= '</br>';
$retu .= ' <input type="text" style="width: 80%;" name="peliculas_data[' . $cnt . '][enlace]" value="' . htmlentities($enlace, ENT_QUOTES) . '"/>';
$retu .= '</br>';
$retu .= ' <label>Usuario :</label>';
$retu .= '</br>';
$retu .= ' <input type="text" style="width: 80%;" name="peliculas_data[' . $cnt . '][user]" value="' . htmlentities($user, ENT_QUOTES) . '"/>';
$retu .= ' <input type="hidden" name="peliculas_data[' . $cnt . '][new]" value="0"/>';
$retu .= ' <input type="hidden" name="peliculas_data[' . $cnt . '][removed]" class="removeinput" value="0"/>';
$retu .= ' <input type="hidden" name="peliculas_data[' . $cnt . '][idlink]" value="' . $cnt . '"/>';
$retu .= '</br>';
$retu .= '</br>';
$retu .= ' <span style="border-radius: 3px; cursor: pointer; background: #f7f7f7; box-shadow: 0 1px 0 #ccc;border: solid 1px #ccc; padding: 5px;"class="remove">Eliminar</span>';
$retu .= '</p>';
return $retu;
}
//add custom field - peliculas
add_action("add_meta_boxes", "object_init");
function object_init(){
add_meta_box("peliculas_meta_id", "Peliculas:", "peliculas_meta", "pelicula", "normal", "low");
}
function peliculas_meta(){
global $nombre_servidor;
global $tipo_audio;
global $tipo_calidad;
global $enlace_roto;
global $post;
$data = get_post_meta($post->ID, "peliculas_data", true);
echo '<div id="peliculas_items">';
if (!empty($data)) {
foreach((array)$data as $c => $p ){
if (isset($p['calidad']) || isset($p['audio']) || isset($p['servidor']) || isset($p['enlace']) || isset($p['user']) || isset($p['roto'])){
echo Print_peliculas_fileds($c, $p);
}
}
}
echo '</div>';
?>
<span id="here"></span>
<span class="add"><?php
echo __('Nueva Pelicula');
$add_to_ID = get_post_meta($post->ID,"_linksAutoincrement",true);
if ( empty( $add_to_ID ) )
$add_to_ID = 0;
$add_to_ID = $add_to_ID + 1;
?></span>
<script>
var $ =jQuery.noConflict();
$(document).ready(function() {
var count = <?php echo $add_to_ID;?>;
$(".add").click(function() {
count = count + 1;
$('#peliculas_items').append('<p style="margin-bottom: 22px;"><label>Servidor</label><select name="peliculas_data[' + count + '][servidor] id="servidor"><?php
foreach ($nombre_servidor as $nombre_servidores) {
echo '<option value="' . $nombre_servidores . '">' . $nombre_servidores . '</option>';
}
?></select><label>Audio</label><select name="peliculas_data[' + count + '][audio] id="audio"><?php
foreach ($tipo_audio as $tipo_audios) {
echo '<option value="' . $tipo_audios . '">' . $tipo_audios . '</option>';
}
?></select><label>Calidad</label><select name="peliculas_data[' + count + '][calidad] id="calidad"><?php
foreach ($tipo_calidad as $tipo_calidades) {
echo '<option value="' . $tipo_calidades . '">' . $tipo_calidades . '</option>';
}
?></select><label>Enlace roto:</label><select name="peliculas_data[' + count + '][roto] id="roto"><?php
foreach ($enlace_roto as $enlace_rotos) {
echo '<option value="' . $enlace_rotos . '">' . $enlace_rotos . '</option>';
}
?></select></br><label>enlace :</label><br><input type="text" style="width: 80%;" name="peliculas_data[' + count + '][enlace]" value=""/><br> <label>usuario:</label><br><input type="text" style="width: 80%;" name="peliculas_data[' + count + '][user]" value=""/><br> <input type="hidden" name="peliculas_data[' + count + '][new]" value="1"/> <input type="hidden" name="peliculas_data[' + count + '][removed]" class="removeinput" value="0"/> <input type="hidden" name="peliculas_data[' + count + '][idlink]" value="' + count + '"/> <span class="remove">Remove</span></p>');
return false;
});
$(".remove").live('click', function() {
$(this).parent().find(".removeinput").val("1").parent().hide();
});
});
</script>
<style>#peliculas_items {list-style: none;}</style>
<?php
}
//Save product peliculas
add_action('save_post', 'guardar_peliculas');
function guardar_peliculas($post_id){
global $post;
// to prevent metadata or custom fields from disappearing...
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
return $post_id;
// OK, we're authenticated: we need to find and save the data
if (isset($_POST['peliculas_data'])) {
$data = $_POST['peliculas_data'];
$existing_list = get_post_meta($post->ID,"peliculas_data",true);
if (empty($existing_list))
$existing_list = array();
$add_to_ID = get_post_meta($post->ID,"_linksAutoincrement",true);
if ( empty( $add_to_ID ) )
$add_to_ID = 0;
foreach((array)$data as $p ){ //proceso cada link de la peticion editando el array de links de la base de datos por si alguien agrego un link mientras editaba
if ( ! is_numeric( $p["idlink"] ) )
die("Wrong ID!");
$p["idlink"] = abs(intval($p["idlink"]));
if ( ! $p["idlink"])
die("Wrong ID!");
if ($p["new"]=="1"){ //link nuevo
if ($p["removed"]=="0"){ //si la agrego y elimino en la misma edicion no se hace nada
$add_to_ID = $add_to_ID + 1;
if (isset($existing_list[$add_to_ID]))
die("Ya existe el ID: ".$add_to_ID);
unset($p["removed"]);
unset($p["new"]);
unset($p["idlink"]);
if (validarLink($p)==false)
die("Un campo no esta entre los permitidos");
if (filter_var($p['enlace'], FILTER_VALIDATE_URL) !== false){
$existing_list[$add_to_ID] = $p;
}else{
die("enlace no valido: " . htmlspecialchars($p['enlace']));
}
}
}else if ($p["removed"]=="1"){ //link removido
if (isset($existing_list[$p["idlink"]]))
unset($existing_list[$p["idlink"]]); //elimino el link (no re-indexa)
}else if (isset($existing_list[$p["idlink"]])){
unset($p["removed"]);
unset($p["new"]);
$id = $p["idlink"];
unset($p["idlink"]);
if (validarLink($p)==false)
die("Un campo no esta entre los permitidos");
if (filter_var($p['enlace'], FILTER_VALIDATE_URL) !== false){
$existing_list[$id] = $p;
}else{
die("enlace no valido: " . htmlspecialchars($p['enlace']));
}
}
}
update_post_meta($post_id, 'peliculas_data', $existing_list);
update_post_meta($post->ID, '_linksAutoincrement', $add_to_ID);
}
}
function validarLink($p){
global $nombre_servidor;
global $tipo_audio;
global $tipo_calidad;
global $enlace_roto;
if (in_array($p['servidor'],$nombre_servidor)){
if (in_array($p['audio'],$tipo_audio)){
if (in_array($p['calidad'],$tipo_calidad)){
if (in_array($p['roto'],$enlace_roto)){
return true;
}
}
}
}
return false;
}
require_once('wp-config.php');
include('wp-load.php');
$args = array( 'posts_per_page' => -1, 'paged' => 1 );
$wp_query = new WP_Query($args);
while ( have_posts() ) : the_post();
delete_post_meta($post->ID, 'peliculas_data');
delete_post_meta($post->ID, 'linksAutoincrement');
endwhile;
echo "OK";
wetsa perfecto a ver que tal
- - - Actualizado - - -
vale pues ya lo tengo funcionando ahora no me deja meter cualquier cosa en el campo de enlace que es lo que se pretendia asi que genial, tambien se ve el codigo mucho mejor, mas limpio. El problema de los errores que me manda sql inyection test me siguen apareciendo los mismo, como entonces evito el ataque sql?
servidor
Submitted Form State:
unnamed field:
audio: Spain.png
unnamed field:
calidad: calidad1
unnamed field:
estado: ok
unnamed field:
updateuser: Aportar
enlace:
Results:
Server Status Code: 404 Not Found
Tested value: 1 AND 1=1
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: 1 AND USER_NAME() = 'dbo'
Server Status Code: 404 Not Found
Tested value: 1 EXEC XP_
Server Status Code: 404 Not Found
Tested value: 1' AND 1=(SELECT COUNT(*) FROM tablenames); --
Server Status Code: 404 Not Found
Tested value: '; DESC users; --
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: 1 OR 1=1
Server Status Code: 404 Not Found
Tested value: 1' OR '1'='1
This field passed 7731 tests. To see all the passed results, go to Tools->SQL Inject Me->Options and click 'Show passed results in final report' and rerun this test.
unnamed field
Submitted Form State:
servidor: 1.png
audio: Spain.png
unnamed field:
calidad: calidad1
unnamed field:
estado: ok
unnamed field:
updateuser: Aportar
enlace:
Results:
Server Status Code: 404 Not Found
Tested value: 1 AND USER_NAME() = 'dbo'
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: '; DESC users; --
Server Status Code: 404 Not Found
Tested value: 1 AND 1=1
Server Status Code: 404 Not Found
Tested value: 1 OR 1=1
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: 1' AND 1=(SELECT COUNT(*) FROM tablenames); --
Server Status Code: 404 Not Found
Tested value: 1 EXEC XP_
Server Status Code: 404 Not Found
Tested value: 1' OR '1'='1
This field passed 7731 tests. To see all the passed results, go to Tools->SQL Inject Me->Options and click 'Show passed results in final report' and rerun this test.
audio
Submitted Form State:
servidor: 1.png
unnamed field:
unnamed field:
calidad: calidad1
unnamed field:
estado: ok
unnamed field:
updateuser: Aportar
enlace:
Results:
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: 1 AND USER_NAME() = 'dbo'
Server Status Code: 404 Not Found
Tested value: 1' AND 1=(SELECT COUNT(*) FROM tablenames); --
Server Status Code: 404 Not Found
Tested value: 1 EXEC XP_
Server Status Code: 404 Not Found
Tested value: 1 AND 1=1
Server Status Code: 404 Not Found
Tested value: '; DESC users; --
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: 1' OR '1'='1
Server Status Code: 404 Not Found
Tested value: 1 OR 1=1
This field passed 7731 tests. To see all the passed results, go to Tools->SQL Inject Me->Options and click 'Show passed results in final report' and rerun this test.
unnamed field
Submitted Form State:
servidor: 1.png
unnamed field:
audio: Spain.png
calidad: calidad1
unnamed field:
estado: ok
unnamed field:
updateuser: Aportar
enlace:
Results:
Server Status Code: 404 Not Found
Tested value: 1 AND USER_NAME() = 'dbo'
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: '; DESC users; --
Server Status Code: 404 Not Found
Tested value: 1' AND 1=(SELECT COUNT(*) FROM tablenames); --
Server Status Code: 404 Not Found
Tested value: 1 AND 1=1
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: 1 EXEC XP_
Server Status Code: 404 Not Found
Tested value: 1' OR '1'='1
Server Status Code: 404 Not Found
Tested value: 1 OR 1=1
This field passed 7731 tests. To see all the passed results, go to Tools->SQL Inject Me->Options and click 'Show passed results in final report' and rerun this test.
calidad
Submitted Form State:
servidor: 1.png
unnamed field:
audio: Spain.png
unnamed field:
unnamed field:
estado: ok
unnamed field:
updateuser: Aportar
enlace:
Results:
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: '; DESC users; --
Server Status Code: 404 Not Found
Tested value: 1 AND USER_NAME() = 'dbo'
Server Status Code: 404 Not Found
Tested value: 1' AND 1=(SELECT COUNT(*) FROM tablenames); --
Server Status Code: 404 Not Found
Tested value: 1 EXEC XP_
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: 1' OR '1'='1
Server Status Code: 404 Not Found
Tested value: 1 AND 1=1
Server Status Code: 404 Not Found
Tested value: 1 OR 1=1
This field passed 7731 tests. To see all the passed results, go to Tools->SQL Inject Me->Options and click 'Show passed results in final report' and rerun this test.
unnamed field
Submitted Form State:
servidor: 1.png
unnamed field:
audio: Spain.png
unnamed field:
calidad: calidad1
estado: ok
unnamed field:
updateuser: Aportar
enlace:
Results:
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: 1 AND USER_NAME() = 'dbo'
Server Status Code: 404 Not Found
Tested value: '; DESC users; --
Server Status Code: 404 Not Found
Tested value: 1' AND 1=(SELECT COUNT(*) FROM tablenames); --
Server Status Code: 404 Not Found
Tested value: 1 AND 1=1
Server Status Code: 404 Not Found
Tested value: 1 EXEC XP_
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: 1' OR '1'='1
Server Status Code: 404 Not Found
Tested value: 1 OR 1=1
This field passed 7731 tests. To see all the passed results, go to Tools->SQL Inject Me->Options and click 'Show passed results in final report' and rerun this test.
estado
Submitted Form State:
servidor: 1.png
unnamed field:
audio: Spain.png
unnamed field:
calidad: calidad1
unnamed field:
unnamed field:
updateuser: Aportar
enlace:
Results:
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: 1 AND USER_NAME() = 'dbo'
Server Status Code: 404 Not Found
Tested value: '; DESC users; --
Server Status Code: 404 Not Found
Tested value: 1' AND 1=(SELECT COUNT(*) FROM tablenames); --
Server Status Code: 404 Not Found
Tested value: 1 EXEC XP_
Server Status Code: 404 Not Found
Tested value: 1 AND 1=1
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: 1' OR '1'='1
Server Status Code: 404 Not Found
Tested value: 1 OR 1=1
This field passed 7731 tests. To see all the passed results, go to Tools->SQL Inject Me->Options and click 'Show passed results in final report' and rerun this test.
unnamed field
Submitted Form State:
servidor: 1.png
unnamed field:
audio: Spain.png
unnamed field:
calidad: calidad1
unnamed field:
estado: ok
updateuser: Aportar
enlace:
Results:
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: '; DESC users; --
Server Status Code: 404 Not Found
Tested value: 1 AND USER_NAME() = 'dbo'
Server Status Code: 404 Not Found
Tested value: 1' AND 1=(SELECT COUNT(*) FROM tablenames); --
Server Status Code: 404 Not Found
Tested value: 1 AND 1=1
Server Status Code: 404 Not Found
Tested value: 1 EXEC XP_
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: 1' OR '1'='1
Server Status Code: 404 Not Found
Tested value: 1 OR 1=1
This field passed 7731 tests. To see all the passed results, go to Tools->SQL Inject Me->Options and click 'Show passed results in final report' and rerun this test.
updateuser
Submitted Form State:
servidor: 1.png
unnamed field:
audio: Spain.png
unnamed field:
calidad: calidad1
unnamed field:
estado: ok
unnamed field:
enlace:
Results:
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: '; DESC users; --
Server Status Code: 404 Not Found
Tested value: 1 AND USER_NAME() = 'dbo'
Server Status Code: 404 Not Found
Tested value: 1' AND 1=(SELECT COUNT(*) FROM tablenames); --
Server Status Code: 404 Not Found
Tested value: 1 AND 1=1
Server Status Code: 404 Not Found
Tested value: 1 EXEC XP_
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: 1' OR '1'='1
Server Status Code: 404 Not Found
Tested value: 1 OR 1=1
This field passed 7731 tests. To see all the passed results, go to Tools->SQL Inject Me->Options and click 'Show passed results in final report' and rerun this test.
enlace
Submitted Form State:
servidor: 1.png
unnamed field:
audio: Spain.png
unnamed field:
calidad: calidad1
unnamed field:
estado: ok
unnamed field:
updateuser: Aportar
Results:
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: '; DESC users; --
Server Status Code: 404 Not Found
Tested value: 1 AND USER_NAME() = 'dbo'
Server Status Code: 404 Not Found
Tested value: 1' AND 1=(SELECT COUNT(*) FROM tablenames); --
Server Status Code: 404 Not Found
Tested value: 1 AND 1=1
Server Status Code: 404 Not Found
Tested value: 1 EXEC XP_
Server Status Code: 404 Not Found
Tested value: 1'1
Server Status Code: 404 Not Found
Tested value: 1 OR 1=1
Server Status Code: 404 Not Found
Tested value: 1' OR '1'='1
This field passed 7731 tests. To see all the passed results, go to Tools->SQL Inject Me->Options and click 'Show passed results in final report' and rerun this test.
<?php
$data = get_post_meta($post->ID,"peliculas_data",true);
global $enlace_roto;
?>
<div class="links_servs">
<table>
<tbody>
<tr>
<th>SERVIDOR</th>
<th>AUDIO</th>
<th>CALIDAD</th>
<th>VER ONLINE</th>
<th>¿ENLACE ROTO?</th>
<th>USUARIO</th>
</tr>
<?php
if (count($data) > 0){
foreach((array)$data as $cnt => $p ){
if (isset($p['calidad']) || isset($p['audio'])|| isset($p['servidor'])|| isset($p['enlace'])|| isset($p['roto'])|| isset($p['user'])){
?>
<tr>
<td class="server" > <img src="wp-content/themes/Mogambo/images/foto-<?php echo $p['servidor']; ?>"></img> </td>
<td class="idioma"><img src="wp-content/themes/Mogambo/images/flag/<?php echo $p['audio']; ?>"></img></td>
<td class="calidad"><?php echo $p['calidad']; ?></td>
<td><a href="<?php echo htmlentities($p['enlace'], ENT_QUOTES);?>" class="url_download" target="_blank">Reproducir</a></td>
<td>
<form method="post" id="adduser" action="<?php the_permalink(); ?>">
<p class="form-submit">
<input name="updateuser" type="submit" id="updateuser" class="submit button" value="Actualizar" />
<input name="seccion" type="hidden" id="action" value="<?php echo $cnt; ?>" />
</p>
<td class="user"><?php echo htmlspecialchars($p['user']); ?></td>
</form>
</td>
</tr>
<?php
}
}
}
?>
if ( !empty($_POST['seccion']) ) {
$add_to_ID = $_POST['seccion'];
if ( ! is_numeric( $add_to_ID ) )
die("Wrong ID!");
$add_to_ID = abs(intval($add_to_ID));
if ( ! $add_to_ID )
die("Wrong ID!");
$existing_list = get_post_meta($post->ID,"peliculas_data",true);
if (isset($existing_list[$add_to_ID])){ //Verificar que el $add_to_ID exista
$current_user = wp_get_current_user();
$denunciante = "Anonimo";
if ( is_user_logged_in() )
$denunciante = $current_user->user_login;
$p = $existing_list[$add_to_ID];
$html = 'Enlace roto: '.htmlspecialchars($p['enlace']).'<br>\n';
$html .= 'Denunaciado por: '.$denunciante.'<br>\n';
$html .= 'Denunaciado con IP: '.$_SERVER['HTTP_CLIENT_IP'].'<br>\n';
$html .= 'Link del post: '.get_permalink($post->ID).'<br>\n';
$headers = array('Content-Type: text/html; charset=UTF-8');
wp_mail( 'tumail@gmail.com', 'Link roto', $html, $headers);
die("Se a registrado que el link para revision.");
}else{
die("El enlace ya no existe!");
}
}
$website = test_input($_POST["website"]);
if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$website)) {
$websiteErr = "Invalid URL";
}
<?php
//El fichero que quieres comprobar
$url='http://www.fotoefectos.com/mrbean.jpg';
$contents = file_get_contents("$url");
if (strlen($contents))
{
echo "si"; // Si que existe
}
else
{
echo "no"; // No existe!!
}
?>
if (filter_var($_POST['enlace'], FILTER_VALIDATE_URL) !== false){
if (validateUrl($_POST['enlace']){
function validateUrl($toadd){
$regexUrls = Array('uptobox'=>Array('@^https?://(www\\.)?uptobox.com/[/\\w]*@i','@^https?://(www\\.)?uptostream.com/[/\\w]*@i'), 'mediafire'=>Array('@^https?://(www\\.)?mediafire.com/[\\W\\w]*@i') );
if (filter_var($toadd, FILTER_VALIDATE_URL) !== false){
if (isset($regexUrls[$_POST['servidor']])){
foreach ($regexUrls[$_POST['servidor']] as $pattern){
if (preg_match($pattern, $toadd)===1){
return true;
}
}
}
}
return false;
}
if (validateUrl($_POST['enlace'],){
if (validateUrl($_POST['enlace'], FILTER_VALIDATE_URL) !== false){
http://videomega.tv/?ref=uC0asCY6h1
'videomega'=>Array('@^http?://(www\\.)?videomega.tv/[\\W\\w]*@i')
?ref=uC0asCY6h1
http://videomega.tv/
if (validateUrl($_POST['enlace']){
if (validateUrl($_POST['enlace'])){
$regexUrls = Array('uptobox'=>Array('@^https?://(www\\.)?uptobox.com/[/\\w]*@i','@^https?://(www\\.)?uptostream.com/[/\\w]*@i'), 'mediafire'=>Array('@^https?://(www\\.)?mediafire.com/[\\W\\w]*@i'),'videomega'=>Array('@^http?://(www\\.)?videomega.tv/[\\W\\w]*@i') );
http://videomega.tv/?ref=uC0asCY6h1
http://streamcloud.eu/g994pe17mfrn/The.Hateful.Eight.2015.DVDScr.XVID.AC3.HQ.Hive-CM8.mp4.html
<?php
$_POST['servidor'] = $_GET['servidor'];
if (validateUrl($_GET['url'])){
die('Link correcto!');
}else{
die('Link incorrecto )=');
}
function validateUrl($toadd){
$regexUrls = Array('uptobox'=>Array('@^https?://(www\\.)?uptobox\\.com/[/\\w]*@i','@^https?://(www\\.)?uptostream\\.com/[/\\w]*@i'), 'mediafire'=>Array('@^https?://(www\\.)?mediafire\\.com/[\\W\\w]*@i'),'videomega'=>Array('@^http?://(www\\.)?videomega\\.tv/[\\W\\w]*@i'),'streamcloud'=>Array('@^http?://(www\\.)?streamcloud\\.eu/[\\W\\w]*@i') );
if (filter_var($toadd, FILTER_VALIDATE_URL) !== false){
if (isset($regexUrls[$_POST['servidor']])){
foreach ($regexUrls[$_POST['servidor']] as $pattern){
if (preg_match($pattern, $toadd)===1){
return true;
}
}
}
}else{
die("url no valida");
}
return false;
}
?>
Utilizamos cookies y tecnologías similares para los siguientes fines:
¿Aceptas las cookies y estas tecnologías?
Utilizamos cookies y tecnologías similares para los siguientes fines:
¿Aceptas las cookies y estas tecnologías?