Jump to content

what is wrong with this code? 3


victormenezes

Recommended Posts

I'm with errors in the lines:

Notice: Undefined variable: media in C:\xampp\htdocs\postador\cont\f_ret.php on line 12

Notice: Undefined variable: media in C:\xampp\htdocs\postador\cont\f_ret.php on line 12

Notice: Undefined variable: curiosidades in C:\xampp\htdocs\postador\cont\f_ret.php on line 27

Notice: Undefined variable: premiacoes in C:\xampp\htdocs\postador\cont\f_ret.php on line 35

Notice: Undefined variable: outras_info in C:\xampp\htdocs\postador\cont\f_ret.php on line 38

Notice: Undefined variable: curiosidades in C:\xampp\htdocs\postador\cont\f_ret.php on line 50

Notice: Undefined variable: premiacoes in C:\xampp\htdocs\postador\cont\f_ret.php on line 50

Notice: 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 by victormenezes
Link to comment
Share on other sites

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"] : "");
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.