victormenezes Posted October 16, 2013 Share Posted October 16, 2013 (edited) I'm with errors in the lines: Notice: Undefined variable: media in C:\xampp\htdocs\postador\cont\f_ret.php on line 12Notice: Undefined variable: media in C:\xampp\htdocs\postador\cont\f_ret.php on line 12Notice: Undefined variable: curiosidades in C:\xampp\htdocs\postador\cont\f_ret.php on line 27Notice: Undefined variable: premiacoes in C:\xampp\htdocs\postador\cont\f_ret.php on line 35Notice: Undefined variable: outras_info in C:\xampp\htdocs\postador\cont\f_ret.php on line 38Notice: Undefined variable: curiosidades in C:\xampp\htdocs\postador\cont\f_ret.php on line 50Notice: Undefined variable: premiacoes in C:\xampp\htdocs\postador\cont\f_ret.php on line 50Notice: Undefined variable: outras_info in C:\xampp\htdocs\postador\cont\f_ret.php on line 50 help! f_ret.php: <?php // LENDO VARIAVEIS POST E APLICADO REQUISITOS NECESSARIOS foreach ($_POST as $campo => $valor) { $$campo = addslashes(stripcslashes($valor)); } if (file_exists("./xml/usuarios/id_{$id}.xml")){ // Carregando configurações XML $config = simplexml_load_file("./xml/usuarios/id_{$id}.xml"); } // Retorando o Valor se Preenchido da Variavel. if(($media != 'http://') && ($media != '')){ $media = "[dt][bck=g-video]Video[/bck][/dt][dd][center][media]{$media}[/media][/center][/dd]"; } else { $media = ""; } if (($screen3 != 'http://') && ($screen3 != '')){ $screen3 = " [shot]{$screen3}[/shot] "; } else { $screen3 = ""; } if(($screen4 != 'http://') && ($screen4 != '')){ $screen4 = " [shot]{$screen4}[/shot] "; } else { $screen4 = ""; } if($curiosidades!=''){ $curiosidades = "[dt][bck=g-curiosidades]Curiosidades[/bck][/dt][dd]{$curiosidades}[/dd]"; } if($legenda!='Selecione'){ $legenda = "[*][b]Legenda:[/b] {$legenda}"; } else { $legenda = ""; } if($premiacoes!=''){ $premiacoes = "[dt][bck=g-premiacoes]Premiações[/bck][/dt][dd]{$premiacoes}[/dd]"; } if($outras_info !=''){ $outras_info = "[dt][bck=g-outrasinfo]Outras Informações[/bck][/dt][dd]{$outras_info}[/dd]"; } if($download !=''){ $download = "[dt][bck=g-download]Download[/bck][/dt][dd][center]{$download}[/center][/dd]"; } if ($config->imglanc != ''){ $imagem_lancamento = "[dd][center][img={$config->imglanc}][/center][/dd]"; } $titulo_s = ("[{$compartilhamento}] {$nome}"); $descricao_s = ("({$qualidade})-({$tamanho})"); $codigo = ("[dl]{$imagem_lancamento}[dd][center][b][size=4]{$nome} ({$original})[/size][/b][/center][/dd][dt2][bck=g-poster]PÔSTER[/bck][/dt2][dt2][bck=g-sinopse]SINOPSE[/bck][/dt2][dd2][poster]{$poster}[/poster][/dd2][dd2]{$descricao}[/dd2][dt][bck=g-screens]SCREENSHOTS[/bck][/dt][dd][center][shot]{$screen1}[/shot] [shot]{$screen2}[/shot]{$screen3}{$screen4}[/center][/dd][dt2][bck=g-elenco]ELENCO[/bck][/dt2][dt2][bck=g-dados]DADOS DO FILME[/bck][/dt2][dd2]{$elenco}[/dd2][dd2][list][*][b]Ano Lançamento:[/b] {$ano}[*][b]Tempo Duração:[/b] {$duracao}[*][b]Idioma do Áudio:[/b] {$idioma_audio}[*][b]Tamanho:[/b] {$tamanho}{$legenda}[*][b]Qualidade:[/b] {$qualidade}[*][b]Video Codec:[/b] {$video_codec}[*][b]Audio Codec:[/b] {$audio_codec}[*][b]Resolução:[/b] {$resolucao}[*][b]Formato de Tela:[/b] {$formato_tela}[/list][/dd2]{$media}{$curiosidades}{$premiacoes}{$outras_info}{$download}[dt][bck=g-importante]IMPORTANTE[/bck][/dt][dd][center][color=#006400][b]Não seja mais um vampiro. Colabore, Agradeça e Incentive o Uploader. FAÇA SUA PARTE![/b][/color][/center][/dd][/dl]"); // Visulizar if(isset($_POST['prev'])){ echo bbcode(nl2br("$codigo")); } //Postar novo tópico if(isset($_POST['postar'])){ require_once("include/classe.post.php"); } //Gerar Código if(isset($_POST['gerar'])){ echo ("<textarea name=\"codigo\" rows=\"\" cols=\"\" id=\"codigo\">{$codigo}</textarea>"); } ?> <dl class="enviar-d"><dd><input type="button" value="Voltar" onclick="history.go(-1)" /></dd></dl> Edited October 16, 2013 by victormenezes Quote Link to comment Share on other sites More sharing options...
requinix Posted October 16, 2013 Share Posted October 16, 2013 foreach ($_POST as $campo => $valor) { $$campo = addslashes(stripcslashes($valor)); }No. That is bad. Stop it. For all the variables (like media) you want to use coming from $_POST, // variable = (isset($_POST["form field"]) ? $_POST["form field"] : "default value") $media = (isset($_POST["media"]) ? $_POST["media"] : ""); Quote Link to comment Share on other sites More sharing options...
victormenezes Posted October 17, 2013 Author Share Posted October 17, 2013 You can fix this code please? Quote Link to comment Share on other sites More sharing options...
requinix Posted October 17, 2013 Share Posted October 17, 2013 I'm not going to fix it for you. That line of code I posted. Use that to get values for the variables you want instead of that foreach loop. Quote Link to comment Share on other sites More sharing options...
victormenezes Posted October 17, 2013 Author Share Posted October 17, 2013 the problem is that I do not know mess with these php scripts are someone else I just want to fix it xampp does not read the tags Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.