victormenezes Posted October 15, 2013 Share Posted October 15, 2013 what is wrong with this code? on my server is giving error:Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\postador\cont\f_int.php on line 131 my code is: <?php if (!isset($_POST['cat_forum'])){ require_once("include/forum_id.php"); } else { if (file_exists("./xml/usuarios/id_{$id}.xml")){ // Carregando configurações XML $config = simplexml_load_file("./xml/usuarios/id_{$id}.xml"); }?> <form id="g_filme" action="index.php?act=filme_ret" method="post" onsubmit="return AutoValidar.valida(this);"> <dl class="c-flutuante"><dt>Dados do Filme</dt> <dd id="dados-left"> <input name="forum_id" type="hidden" id="forum_id" value="<?php echo "{$_POST['forum_id']}";?>" /> <label for="nome">Nome:</label> <input name="nome" type="text" id="nome" class="requerido" /> <label for="original">Nome Original:</label> <input name="original" type="text" id="original" class="requerido" /> <label for="ano">Ano Lançamento:</label> <input name="ano" type="text" id="ano" class="requerido" /> <label for="duracao">Tempo Duração:</label> <input name="duracao" type="text" id="duracao" class="requerido" /> <label for="idioma_audio">Idioma do Áudio</label> <select name="idioma_audio" class="requerido" id="idioma_audio"> <option value="Selecione">Selecione</option> <option value="Inglês">Inglês</option> <option value="Português">Português</option> <option value="Espanhol">Espanhol</option> <option value="Japonês">Japonês</option> <option value="Francês">Francês</option> <option value="Dual Áudio">Dual Áudio</option> <option value="Outro">Outro</option> </select> <label for="tamanho">Tamanho</label> <input name="tamanho" type="text" class="requerido" id="tamanho" /> <label for="poster">Pôster</label> <input name="poster" type="text" class="requerido" id="poster" value="http://" /> <label for="screen1">1ª Screenshot:</label> <input name="screen1" type="text" class="requerido" id="screen1" value="http://" /> <?php if ($config->quatroscreens == 1){?> <label for="screen3">3ª Screenshot</label> <input name="screen3" type="text" id="screen3" value="http://" /> <?}?> </dd> <dd id="dados-right"> <label for="video_codec">Video Codec:</label> <input name="video_codec" type="text" class="requerido" id="video_codec" value="" /> <label for="audio_codec">Áudio Codec:</label> <input name="audio_codec" type="text" class="requerido" id="audio_codec" /> <label for="resolucao">Resolução:</label> <input name="resolucao" type="text" class="requerido" id="resolucao" /> <label for="qualidade">Qualidade:</label> <select name="qualidade" id="qualidade" class="requerido"> <option value="Selecione">Selecione</option> <option value="DVDRip">DVDRip</option> <option value="DVDScreen">DVDScreen</option> <option value="DVD-R">DVD-R</option> <option value="RatDVD">RatDVD</option> <option value="TeleCine">TeleCine</option> <option value="TeleSync">TeleSync</option> <option value="CAM">CAM</option> <option value="TVRip">TVRip</option> <option value="VHSRip">VHSRip</option> <option value="RMVB">RMVB</option> <option value="Outro">Outro</option> </select> <label for="formato_tela">Formato de Tela:</label> <select name="formato_tela" id="formato_tela" class="requerido"> <option value="Selecione">Selecione</option> <option value="Tela Cheia 4x3">Tela Cheia 4x3</option> <option value="Widescreen 16x9">Widescreen 16x9</option> <option value="Outro Formato">Outro Formato</option> </select> <label for="legenda">Legenda</label> <select name="legenda" id="legenda"> <option value="Selecione">Selecione</option> <option value="Anexada">Anexada</option> <option value="Embutida">Embutida</option> <option value="No Arquivo">No Arquivo</option> </select> <label for="compartilhamento">Compartilhamento:</label> <select name="compartilhamento" id="compartilhamento" class="requerido"> <option value="Selecione">Selecione</option> <option value="Http">Http</option> <option value="Tor">Torrent</option> <option value="Pando">Pando</option> <option value="Ed2k">Ed2k</option> <option value="P2M">P2M</option> <option value="BobDown">BobDown</option> <option value="Durie">Durie</option> <option value="Vários">Vários</option> <option value="Outros">Outros</option> </select> <?php if ($config->youtube == 1){?> <label for="media">Vídeo URL:</label> <input name="media" type="text" id="media" value="http://" /> <?}?> <label for="screen2">2ª Screenshot:</label> <input name="screen2" type="text" class="requerido" id="screen2" value="http://" /><br /> <?php if ($config->quatroscreens == 1){?> <label for="screen4">4ª Screenshot</label> <input name="screen4" type="text" id="screen4" value="http://" /> <?}?> </dd> </dl> <!-- Tabela de dois blocos --> <dl class="cont-duas-left"><dt>Sinopse</dt> <dd><textarea name="descricao" rows="" cols="" class="requerido" id="descricao"></textarea></dd> </dl> <dl class="cont-duas-right"><dt>Elenco</dt> <dd><textarea name="elenco" rows="" cols="" class="requerido" id="elenco"></textarea></dd> </dl> <?php if ($config->curiosidades == 1){?><dl class="cont-duas-left"><dt>Curiosidades</dt> <dd><textarea name="curiosidades" rows="" cols="" id="curiosidades"></textarea></dd> </dl><?}?> <?php if ($config->premiacoes == 1){?><dl class="cont-duas-right"><dt>Premiações</dt> <dd><textarea name="premiacoes" rows="" cols="" id="premiacoes"></textarea></dd> </dl><?}?> <?php if ($config->outrasinfo == 1){?><dl class="cont-duas-left"><dt>Outras Informações</dt> <dd><textarea name="outras_info" rows="" cols="" id="outras_info"></textarea></dd> </dl><?}?> <dl class="cont-duas-right"><dt>Download</dt> <dd><textarea name="download" rows="" cols="" id="download"></textarea></dd> </dl> <dl class="enviar-d"><dd> <input type="submit" name="prev" value="Visualizar" /> <input type="submit" name="gerar" value="Gerar" /> <input type="submit" name="postar" value="POSTAR" /> <input type="reset" value="Limpar" onclick="AutoValidar.limpa(this);" /> </dd></dl> </form> <?}?> help-me!!! Quote Link to comment https://forums.phpfreaks.com/topic/283000-what-is-wrong-with-this-code/ Share on other sites More sharing options...
slyte33 Posted October 15, 2013 Share Posted October 15, 2013 (edited) Try changing your last line to <?php } ?> just incase your server doesn't support short tags Edited October 15, 2013 by slyte33 Quote Link to comment https://forums.phpfreaks.com/topic/283000-what-is-wrong-with-this-code/#findComment-1454051 Share on other sites More sharing options...
victormenezes Posted October 15, 2013 Author Share Posted October 15, 2013 the link did not work looks http://forumcore.com.br/postador/index.php?act=filme tidy as these short tags in this code? Quote Link to comment https://forums.phpfreaks.com/topic/283000-what-is-wrong-with-this-code/#findComment-1454055 Share on other sites More sharing options...
victormenezes Posted October 15, 2013 Author Share Posted October 15, 2013 help Quote Link to comment https://forums.phpfreaks.com/topic/283000-what-is-wrong-with-this-code/#findComment-1454058 Share on other sites More sharing options...
.josh Posted October 15, 2013 Share Posted October 15, 2013 <? ?> isn't short tag. <?= ?> is short tag. But if you changed them to <?php ?> and you still get that error, check for missing closing bracket in this file: require_once("include/forum_id.php"); Quote Link to comment https://forums.phpfreaks.com/topic/283000-what-is-wrong-with-this-code/#findComment-1454062 Share on other sites More sharing options...
victormenezes Posted October 15, 2013 Author Share Posted October 15, 2013 Here is the code forum_id <form id="categoria" action="index.php?act=<?php echo "{$_GET['act']}";?>" method="post" onsubmit="return AutoValidar.valida(this);"> <dl class="c-flutuante"><dt>Selecione o Fórum que Será Criado o Tópico</dt> <dd id="dados-left"> <? $foruns = simplexml_load_file("./xml/foruns.xml"); if ($_GET['act'] == 'filme'){ $parent_id = $foruns->filmes; } if ($_GET['act'] == 'desenho'){ $parent_id = $foruns->desenhos; } if ($_GET['act'] == 'seriado'){ $parent_id = $foruns->seriados; } if ($_GET['act'] == 'jogopc'){ $parent_id = $foruns->jogospc; } if ($_GET['act'] == 'jogocs'){ $parent_id = $foruns->jogoscs; } if ($_GET['act'] == 'programa'){ $parent_id = $foruns->programas; } if ($_GET['act'] == 'musica'){ $parent_id = $foruns->musicas; } if ($_GET['act'] == 'show'){ $parent_id = $foruns->shows; } if ($_GET['act'] == 'ebook'){ $parent_id = $foruns->ebooks; } ?> <label for="forum_id">Categoria:</label> <select name="forum_id" class="requerido" id="forum_id"> <option value="Selecione">Selecione</option> <?php if($parent_id != ''){ $consulta = $SQL->Query("SELECT id,name,parent_id,sub_can_post FROM ".$prefix."forums WHERE parent_id = ".$parent_id." ORDER BY position ASC"); while($resultado = fetch_array($consulta)) { $consulta2 = $SQL->Query("SELECT id,name,parent_id FROM ".$prefix."forums WHERE parent_id = ".$resultado['id']." ORDER BY position ASC"); if($resultado['sub_can_post'] == 0){ echo "<option value=\"{$resultado['id']}\" disabled=\"disabled\">".$resultado['name']."</option>\n"; while($resultado2 = fetch_array($consulta2)){ echo "<option value=\"{$resultado2['id']}\">---- ".$resultado2['name']."</option>\n"; } } else { echo "<option value=\"{$resultado['id']}\">".$resultado['name']."</option>\n"; while($resultado2 = fetch_array($consulta2)){ echo "<option value=\"{$resultado2['id']}\">---- ".$resultado2['name']."</option>\n"; } } } } else { if ($_GET['act'] == 'portal'){ foreach($foruns->portais->forum AS $cat){ $usuario_array = explode(',', $cat->usuariosid); if (in_array($id, $usuario_array)){ echo "<option value=\"{$cat->id}\">".$cat->nome."</option>\n"; } } } } ?> </select> <?if($_GET['act'] == 'portal'){?> <label for="topic_titulo">Título:</label> <input name="topic_titulo" type="text" id="topic_titulo" class="requerido" /> <?}?> </dd> </dl> <dl class="enviar-d"><dd> <input type="submit" name="cat_forum" value="Continuar..." /> </dd> </dl> </form> Quote Link to comment https://forums.phpfreaks.com/topic/283000-what-is-wrong-with-this-code/#findComment-1454066 Share on other sites More sharing options...
victormenezes Posted October 15, 2013 Author Share Posted October 15, 2013 help Quote Link to comment https://forums.phpfreaks.com/topic/283000-what-is-wrong-with-this-code/#findComment-1454072 Share on other sites More sharing options...
cyberRobot Posted October 16, 2013 Share Posted October 16, 2013 There needs to be a space after all open PHP tags. So code like the following: <?}?> ...needs to be changed to something like <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/283000-what-is-wrong-with-this-code/#findComment-1454110 Share on other sites More sharing options...
victormenezes Posted October 16, 2013 Author Share Posted October 16, 2013 (edited) worked but the error persists in forum_id See! http://forumcore.com.br/postador/index.php?act=filme the error is this: filmes; } if ($_GET['act'] == 'desenho'){ $parent_id = $foruns->desenhos; } if ($_GET['act'] == 'seriado'){ $parent_id = $foruns->seriados; } if ($_GET['act'] == 'jogopc'){ $parent_id = $foruns->jogospc; } if ($_GET['act'] == 'jogocs'){ $parent_id = $foruns->jogoscs; } if ($_GET['act'] == 'programa'){ $parent_id = $foruns->programas; } if ($_GET['act'] == 'musica'){ $parent_id = $foruns->musicas; } if ($_GET['act'] == 'show'){ $parent_id = $foruns->shows; } if ($_GET['act'] == 'ebook'){ $parent_id = $foruns->ebooks; } ?> this is the code: <form id="categoria" action="index.php?act=<?php echo "{$_GET['act']}";?>" method="post" onsubmit="return AutoValidar.valida(this);"> <dl class="c-flutuante"><dt>Selecione o Fórum que Será Criado o Tópico</dt> <dd id="dados-left"> <? $foruns = simplexml_load_file("./xml/foruns.xml"); if ($_GET['act'] == 'filme'){ $parent_id = $foruns->filmes; } if ($_GET['act'] == 'desenho'){ $parent_id = $foruns->desenhos; } if ($_GET['act'] == 'seriado'){ $parent_id = $foruns->seriados; } if ($_GET['act'] == 'jogopc'){ $parent_id = $foruns->jogospc; } if ($_GET['act'] == 'jogocs'){ $parent_id = $foruns->jogoscs; } if ($_GET['act'] == 'programa'){ $parent_id = $foruns->programas; } if ($_GET['act'] == 'musica'){ $parent_id = $foruns->musicas; } if ($_GET['act'] == 'show'){ $parent_id = $foruns->shows; } if ($_GET['act'] == 'ebook'){ $parent_id = $foruns->ebooks; } ?> <label for="forum_id">Categoria:</label> <select name="forum_id" class="requerido" id="forum_id"> <option value="Selecione">Selecione</option> <?php if($parent_id != ''){ $consulta = $SQL->Query("SELECT id,name,parent_id,sub_can_post FROM ".$prefix."forums WHERE parent_id = ".$parent_id." ORDER BY position ASC"); while($resultado = fetch_array($consulta)) { $consulta2 = $SQL->Query("SELECT id,name,parent_id FROM ".$prefix."forums WHERE parent_id = ".$resultado['id']." ORDER BY position ASC"); if($resultado['sub_can_post'] == 0){ echo "<option value=\"{$resultado['id']}\" disabled=\"disabled\">".$resultado['name']."</option>\n"; while($resultado2 = fetch_array($consulta2)){ echo "<option value=\"{$resultado2['id']}\">---- ".$resultado2['name']."</option>\n"; } } else { echo "<option value=\"{$resultado['id']}\">".$resultado['name']."</option>\n"; while($resultado2 = fetch_array($consulta2)){ echo "<option value=\"{$resultado2['id']}\">---- ".$resultado2['name']."</option>\n"; } } } } else { if ($_GET['act'] == 'portal'){ foreach($foruns->portais->forum AS $cat){ $usuario_array = explode(',', $cat->usuariosid); if (in_array($id, $usuario_array)){ echo "<option value=\"{$cat->id}\">".$cat->nome."</option>\n"; } } } } ?> </select> <?if($_GET['act'] == 'portal'){?> <label for="topic_titulo">Título:</label> <input name="topic_titulo" type="text" id="topic_titulo" class="requerido" /> <?}?> </dd> </dl> <dl class="enviar-d"><dd> <input type="submit" name="cat_forum" value="Continuar..." /> </dd> </dl> </form> Can you help me? I've changed <?}?> by<?php } ?> Edited October 16, 2013 by victormenezes Quote Link to comment https://forums.phpfreaks.com/topic/283000-what-is-wrong-with-this-code/#findComment-1454128 Share on other sites More sharing options...
victormenezes Posted October 16, 2013 Author Share Posted October 16, 2013 I decided to put <?php early thanks guys thanks a lot! Quote Link to comment https://forums.phpfreaks.com/topic/283000-what-is-wrong-with-this-code/#findComment-1454129 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.