Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Tainã Lisboa

[Erro] Função não chama a DataBase

Recommended Posts

estou com outro problema aqui gostaria de sabe se podem me ajuda neste mesmo tópico .

 

 

index.php

 

http://pastebin.com/JBxJ5kqX

 

 

sql.php

 

 

<? //Configurações do mysql
$db['host']="127.0.0.1";//localhost ou 127.0.0.1 para mysql no mesmo host
$db['porta']="";//se estiver no local host, deixe vasio
$db['usuario']="root";
$db['senha']="";
$db['database']="wyd";
?>

o Mesmo ele não puxa nada do banco de dados e um pouco do código fica a mostra no site.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Certo, veja só.

Tendo o PHP como padrão e banco de dados mysql você deve fazer da seguinte forma.

<?php

$host="127.0.0.1";//localhost ou 127.0.0.1 para mysql no mesmo host
$porta="";//se estiver no local host, deixe vasio
$usuario="root";
$senha="";
$database="wyd";
$conectar = mysql_connect($host, $usuario, $senha) or die mysql_error();
mysql_select_db($database, $conectar);
?>
Pronto agora está conectado. Para fazer a query você deve escreve-la

Compartilhar este post


Link para o post
Compartilhar em outros sites

 

Certo, veja só.

Tendo o PHP como padrão e banco de dados mysql você deve fazer da seguinte forma.

<?php

$host="127.0.0.1";//localhost ou 127.0.0.1 para mysql no mesmo host
$porta="";//se estiver no local host, deixe vasio
$usuario="root";
$senha="";
$database="wyd";
$conectar = mysql_connect($host, $usuario, $senha) or die mysql_error();
mysql_select_db($database, $conectar);
?>
Pronto agora está conectado. Para fazer a query você deve escreve-la

Isto corrigi já porem no index.php maior parte do código fica a vista do usuário, acredito que não tenha nada haver de eu estar utilizando a porta 8080.

 

 

index.php

 

 

<? include"config.php"; clearstatcache(); ?>
<?php error_reporting (E_ALL ^ E_NOTICE); ?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Cache-Control" content="No-Cache">
<meta http-equiv="Pragma" content="No-Cache">
<meta http-equiv="Expires" content="0">
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"/>
<title><? echo mysql_result(mysql_query("SELECT `valor` FROM `configs` WHERE `config`=`title`"),); ?></title>
<style type="text/css">
<!--
body {
background-repeat: repeat-y;
background-size: 100%;
}
img {
border:0;
}
-->
</style>
</head>
<body background="imagens/background.jpg" bgcolor="#233E53" onLoad="<?php if(!empty($alert)){echo "alert('".$alert."');";} ?>">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" align="center"><a href="index.php"><img border="0" src="imagens/logo.png" /></a></td>
</tr>
<map name="Map" id="Map">
<area shape="rect" coords="399,17,595,88" href="<?php echo mysql_result(mysql_query("SELECT `valor` FROM `configs` WHERE `config`=`client`"),0); ?>" target="_new" alt="Client FULL" />
<area shape="rect" coords="843,65,953,101" href="?page=donatar">
<area shape="rect" coords="608,71,684,97" href="http://hell-destiny.com/forum/" target="_blank">
</map>
<tr>
<td colspan="3" height="52" align="center">
<a href="index.php"><img src="imagens/home.png"/></a>
<a href="?download"><img src="imagens/downloads.png"/></a>
<a href="http://hell-destiny.com/forum/"><img src="imagens/forum.png"/></a>
<a href="<?php if(!$logado){echo "javascript:alert('Faca o Login primeiro.');login.login.focus();";}else{echo "?page=donatar";} ?>"><img src="imagens/donate.png"/></a>
</td>
</tr>
<tr valign="top">
<td width="257">
<?php
session_start();
$logado = $_SESSION['logado'];
if($logado>=1){
$nivel=1;
$query=mysql_query("SELECT * FROM `permissoes` WHERE `nivel`='".$nivel."` ORDER BY `file` DESC")or die(mysql_error());
echo '<div align="center" style="background-image:url(imagens/painelcima.png); background-repeat:no-repeat""><br></div>
<div align="left" style="background-image:url(imagens/meio1.png); background-repeat:repeat-y">';
while($tipo=mysql_fetch_array($query)){
echo '   * <a href="?page='.$tipo['page'].'">'.$tipo['nome'].'</a><br>';}
echo '</div><div align="center" style="background-image:url(imagens/painelbaixo.png); background-repeat:no-repeat"><br></div>';}
if($logado>=2){
$nivel=2;
$query=mysql_query("SELECT * FROM `permissoes` WHERE `nivel`=`".$nivel."`")or die(mysql_error());
echo '<div align="center" style="background-image:url(imagens/painelmod.png); background-repeat:no-repeat""><br></div>
<div align="left" style="background-image:url(imagens/meio1.png); background-repeat:repeat-y">';
while($tipo=mysql_fetch_array($query)){
echo '   * <a href="?page='.$tipo['page'].'">'.$tipo['nome'].'</a><br>';}
echo '</div><div align="center" style="background-image:url(imagens/painelbaixo.png); background-repeat:no-repeat"><br></div>';}
if($logado>=3){
$nivel=3;
$query=mysql_query("SELECT * FROM `permissoes` WHERE `nivelv=`".$nivel."`")or die(mysql_error());
echo '<div align="center" style="background-image:url(imagens/painelgm.png); background-repeat:no-repeat""><br></div>
<div align="left" style="background-image:url(imagens/meio1.png); background-repeat:repeat-y">';
while($tipo=mysql_fetch_array($query)){
echo '   * <a href="?page='.$tipo['page'].'">'.$tipo['nome'].'</a><br>';}
echo '</div><div align="center" style="background-image:url(imagens/painelbaixo.png); background-repeat:no-repeat"><br></div>';}
if($logado>=4){
$nivel=4;
$query=mysql_query("SELECT * FROM `permissoes` WHERE `nivel`=`".$nivel."`")or die(mysql_error());
echo '<div align="center" style="background-image:url(imagens/paineladm.png); background-repeat:no-repeat""><br></div>
<div align="left" style="background-image:url(imagens/meio1.png); background-repeat:repeat-y">';
while($tipo=mysql_fetch_array($query)){
echo '   * <a href="?page='.$tipo['page'].'">'.$tipo['nome'].'</a><br>';}
echo '</div><div align="center" style="background-image:url(imagens/painelbaixo.png); background-repeat:no-repeat"><br></div>';}
if(!$logado){
echo '<div align="left" style="background-image:url(imagens/login.png); background-repeat:no-repeat; height:150;">
<form name="login" id="login" method="post">
<input style="position:relative; top:30; left:15; height:25; width:150;" type="text" id="login" name="login"><br>
<input style="position:relative; top:35; left:15; height:25; width:150;" type="password" id="senha" name="senha"><br>
<input style="position:relative; top:38; left:15; width:77; height:49; background:url(imagens/botaook.png); border:none;" type="submit" value=" ">
<br>
</form>
</div>
<a href="?page=register"><img border=\"0\" src="imagens/registro.png" /></a>
<br />
<img src="imagens/lembrarsenha.png" />
<br />
';}
?>
<img src="imagens/forumcontat.png" usemap="#Map3"/>
<br />
<div align="center" style="background-image:url(imagens/playerscima.png); background-repeat:no-repeat"><br /><br /></div>
<div align="center" style="background-image:url(imagens/meio1.png); background-repeat:repeat-y">
<table width="180" style="font-size:11px;">
<?php
$query=mysql_query('SELECT * FROM playerson ORDER BY `canal` ')or die(mysql_error());
while($r=mysql_fetch_array($query)){
if($players=@file($r['link'])){
$on=explode(" ", $players[0]);
$on=$on[0];
if($on=="-1"){$on="0";}
}
else{$on="0";}
if($on=="0"){$cor="#333";}
elseif($on<30){$cor="#3C3";}
elseif($on<50){$cor="#060";}
elseif($on<80){$cor="#C60";}
elseif($on<100){$cor="#F30";}
elseif($on<120){$cor="#C00";}
elseif($on>=120){$cor="#900";}
echo "
<br>".$r['nome']."
".$r['canal']."
".$on."/750
";
}
?>
</table>
</div>
<div align="center" style="background-image:url(imagens/painelbaixo.png); background-repeat:no-repeat"><br /><br /></div>
<!-- <img src="imagens/parceiros.png" />-->
</td>
<td width="522">
<?php
$query=mysql_query("SELECT * FROM 'permissoes'")or die(mysql_error());
$include=false;
while($q=mysql_fetch_array($query)){
if($q['page']==@$_GET['page'] && !empty($q['file']) && $logado>=$q['nivel']){
include($q['file']);$include=true;break;}
}
if(@is_numeric($_GET['news'])){
include("ler.php");
include("news.php");}
elseif(@is_numeric($_GET['edit'])){
include("edit.php");}
elseif(@is_numeric($_GET['responder'])){
include("responder.php");}
elseif(@is_numeric($_GET['resposta'])){
include("resposta.php");}
elseif(!empty($_GET['donate']) == "true"){
include("donate.php");}
elseif(!empty($_GET['gcash']) == "1")
{include("r_gerar.php");}
elseif(!empty($_GET['atv']) == "cash")
{include("r_ativar.php");}
elseif(!empty($_GET['spy']))
{include("spy.php");}
elseif(@$_GET['rank']=="all")
{include("rank.php");}
elseif(@$_GET['item']=="1")
{include("rank.php");}
elseif(@$_GET['senha']=="msenha"){
include("msenha.php");}
elseif(@$_GET['page']=="register"){
include("register.php");}
elseif(!$include){
include("news.php");}
?>
</td>
<td>
<a href="javascript:void(window.open('http://www.hell-destiny.com/suporte/chat.php','','width=590,height=610,left=0,top=0,resizable=yes,menubar=no,location=no,status=yes,scrollbars=yes'))"><img src="http://www.hell-destiny.com/suporte/image.php?id=02&type=inlay" width="228" height="71" border="0" alt="LiveZilla Live Help"></a><div id="livezilla_tracking" style="display:none"></div><script type="text/javascript">
var script = document.createElement("script");script.type="text/javascript";var src = "http://www.hell-destiny.com/suporte/server.php?request=track&output=jcrpt&nse="+Math.random();setTimeout("script.src=src;document.getElementById('livezilla_tracking').appendChild(script)",1);</script><noscript><img src="http://www.hell-destiny.com/suporte/server.php?request=track&output=nojcrpt" width="0" height="0" style="visibility:hidden;" alt=""></noscript>
<br>
<img src="imagens/manutencao.png" />
<br />
<div align="center" style="background-image:url(imagens/rankcima.png); background-repeat:no-repeat"><br> </div>
<div align="center" style="background-image:url(imagens/rankmeio.png); background-repeat:repeat-y">
<table width="220" cellpadding="0" cellspacing="0" border="0" style="font-family:Tahoma, Geneva, sans-serif">
<?php
$query=mysql_query("SELECT * FROM `rank` WHERE `data`=`".@date("dmy")."` ORDER BY `reset` DESC, `nome` DESC, `level` ASC")or die(mysql_error());
for($i=1;$i<=10;$i++){
$r=mysql_fetch_array($query);
if($r['nome']){
if($i==1){$cor="#CC0000";}
elseif($i==2){$cor="#CC3333";}
elseif($i==3){$cor="#CC6666";}
else{$cor="#000000";}
echo "<tr>
<td width=\"10\"> </td>
<td width=\"45\">".$i."</td>
<td width=\"125\" style=\"color:$cor\">
</td>
<td width=\"50\">".$r['level']."</td>
</tr>";
}
}
?></table>
</div>
<img src="imagens/rankbaixo.png" border="0" usemap="#Map4">
<br />
<img src="imagens/cidades.png" />
</td>
</tr>
</table>
<map name="Map2" id="Map2">
<area shape="rect" coords="64,116,114,127" href="?page=register" />
<area shape="rect" coords="139,37,186,97" href="javascript:void(0);" onClick="login.submit();" alt="Entrar" />
</map>
<map name="Map3">
<area shape="rect" coords="1,7,197,61" href="#Coloque Seu Forum Aqui" target="_blank" />
<area shape="rect" coords="2,73,224,154" href="?page=contato">
</map>
<map name="Map4">
<area shape="rect" coords="174,-4,216,13" href="?rank=all">
</map>
</div>
</body>
</html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Se quiser que o usuário não visualize erro em sua página, vá no php.ini (se for linux está em /etc/php5/apache2/php.ini) procure a opção display_errors = On e passe para Off, reinicie o apache.

Se quiser desativar o erro somente nesta página vc tbm pode usar no começo do seu código

init_set('display_errors', -1);

Compartilhar este post


Link para o post
Compartilhar em outros sites

Vamos la o erro é o da imagem e o meu código é esse.

 

http://uploaddeimagens.com.br/imagens/erro_2-png--4

 

 

 

 
<? include"config.php"; clearstatcache(); ?>
<?php error_reporting (E_ALL ^ E_NOTICE); ?>
<html>
<head>
<meta
http
-equiv="Content-Type" content="text/html; charset=utf-8">
<meta
http
-equiv="Cache-Control" content="No-Cache">
<meta
http
-equiv="Pragma" content="No-Cache">
<meta
http
-equiv="Expires" content="0">
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"/>
<title><? echo mysql_result(mysql_query("SELECT `valor` FROM `configs` WHERE `config`=`title`"),); ?></title>
<style type="text/css">
<!--
body {
background-repeat: repeat-y;
background-size: 100%;
}
img {
border:0;
}
-->
</style>
</head>
<body background="imagens/background.jpg" bgcolor="#233E53" onLoad="<?php if(!empty($alert)){echo "alert('".$alert."');";} ?>">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" align="center"><a href="index.php"><img border="0" src="imagens/logo.png" /></a></td>
</tr>
<map name="Map" id="Map">
<area shape="rect" coords="399,17,595,88" href="<?php echo mysql_result(mysql_query("SELECT `valor` FROM `configs` WHERE `config`=`client`"),0); ?>" target="_new" alt="Client FULL" />
<area shape="rect" coords="843,65,953,101" href="?page=donatar">
<area shape="rect" coords="608,71,684,97" href="
" target="_blank">
</map>
<tr>
<td colspan="3" height="52" align="center">
<a href="index.php"><img src="imagens/home.png"/></a>
<a href="?download"><img src="imagens/downloads.png"/></a>
<a href="
"><img src="imagens/forum.png"/></a>
<a href="<?php if(!$logado){echo "javascript:alert('Faca o Login primeiro.');login.login.focus();";}else{echo "?page=donatar";} ?>"><img src="imagens/donate.png"/></a>
</td>
</tr>
<tr valign="top">
<td width="257">
<?php
session_start();
$logado = $_SESSION['logado'];
if($logado>=1){
$nivel=1;
$query=mysql_query("SELECT * FROM `permissoes` WHERE `nivel`='".$nivel."` ORDER BY `file` DESC")or die(mysql_error());
echo '<div align="center" style="background-image:url(imagens/painelcima.png); background-repeat:no-repeat""><br></div>
<div align="left" style="background-image:url(imagens/meio1.png); background-repeat:repeat-y">';
while($tipo=mysql_fetch_array($query)){
echo '   * <a href="?page='.$tipo['page'].'">'.$tipo['nome'].'</a><br>';}
echo '</div><div align="center" style="background-image:url(imagens/painelbaixo.png); background-repeat:no-repeat"><br></div>';}
if($logado>=2){
$nivel=2;
$query=mysql_query("SELECT * FROM `permissoes` WHERE `nivel`=`".$nivel."`")or die(mysql_error());
echo '<div align="center" style="background-image:url(imagens/painelmod.png); background-repeat:no-repeat""><br></div>
<div align="left" style="background-image:url(imagens/meio1.png); background-repeat:repeat-y">';
while($tipo=mysql_fetch_array($query)){
echo '   * <a href="?page='.$tipo['page'].'">'.$tipo['nome'].'</a><br>';}
echo '</div><div align="center" style="background-image:url(imagens/painelbaixo.png); background-repeat:no-repeat"><br></div>';}
if($logado>=3){
$nivel=3;
$query=mysql_query("SELECT * FROM `permissoes` WHERE `nivelv=`".$nivel."`")or die(mysql_error());
echo '<div align="center" style="background-image:url(imagens/painelgm.png); background-repeat:no-repeat""><br></div>
<div align="left" style="background-image:url(imagens/meio1.png); background-repeat:repeat-y">';
while($tipo=mysql_fetch_array($query)){
echo '   * <a href="?page='.$tipo['page'].'">'.$tipo['nome'].'</a><br>';}
echo '</div><div align="center" style="background-image:url(imagens/painelbaixo.png); background-repeat:no-repeat"><br></div>';}
if($logado>=4){
$nivel=4;
$query=mysql_query("SELECT * FROM `permissoes` WHERE `nivel`=`".$nivel."`")or die(mysql_error());
echo '<div align="center" style="background-image:url(imagens/paineladm.png); background-repeat:no-repeat""><br></div>
<div align="left" style="background-image:url(imagens/meio1.png); background-repeat:repeat-y">';
while($tipo=mysql_fetch_array($query)){
echo '   * <a href="?page='.$tipo['page'].'">'.$tipo['nome'].'</a><br>';}
echo '</div><div align="center" style="background-image:url(imagens/painelbaixo.png); background-repeat:no-repeat"><br></div>';}
if(!$logado){
echo '<div align="left" style="background-image:url(imagens/login.png); background-repeat:no-repeat; height:150;">
<form name="login" id="login" method="post">
<input style="position:relative; top:30; left:15; height:25; width:150;" type="text" id="login" name="login"><br>
<input style="position:relative; top:35; left:15; height:25; width:150;" type="password" id="senha" name="senha"><br>
<input style="position:relative; top:38; left:15; width:77; height:49; background:url(imagens/botaook.png); border:none;" type="submit" value=" ">
<br>
</form>
</div>
<a href="?page=register"><img border=\"0\" src="imagens/registro.png" /></a>
<br />
<img src="imagens/lembrarsenha.png" />
<br />
';}
?>
<img src="imagens/forumcontat.png" usemap="#Map3"/>
<br />
<div align="center" style="background-image:url(imagens/playerscima.png); background-repeat:no-repeat"><br /><br /></div>
<div align="center" style="background-image:url(imagens/meio1.png); background-repeat:repeat-y">
<table width="180" style="font-size:11px;">
<?
$query=mysql_query('SELECT * FROM playerson ORDER BY `canal` ')or die(mysql_error());
while($r=mysql_fetch_array($query)){
if($players=@file($r['link'])){
$on=explode(" ", $players[0]);
$on=$on[0];
if($on=="-1"){$on="0";}
}
else{$on="0";}
if($on=="0"){$cor="#333";}
elseif($on<30){$cor="#3C3";}
elseif($on<50){$cor="#060";}
elseif($on<80){$cor="#C60";}
elseif($on<100){$cor="#F30";}
elseif($on<120){$cor="#C00";}
elseif($on>=120){$cor="#900";}
echo "
<br>".$r['nome']."
".$r['canal']."
".$on."/750
";
}
?>
</table>
</div>
<div align="center" style="background-image:url(imagens/painelbaixo.png); background-repeat:no-repeat"><br /><br /></div>
<!-- <img src="imagens/parceiros.png" />-->
</td>
<td width="522">
<?
$query=mysql_query("SELECT * FROM permissoes ")or die(mysql_error());
$include=false;
while($q=mysql_fetch_array($query)){
if($q['page']==@$_GET['page'] && !empty($q['file']) && $logado>=$q['nivel']){
include($q['file']);$include=true;break;}
}
if(@is_numeric($_GET['news'])){
include("ler.php");
include("news.php");}
elseif(@is_numeric($_GET['edit'])){
include("edit.php");}
elseif(@is_numeric($_GET['responder'])){
include("responder.php");}
elseif(@is_numeric($_GET['resposta'])){
include("resposta.php");}
elseif(!empty($_GET['donate']) == "true"){
include("donate.php");}
elseif(!empty($_GET['gcash']) == "1")
{include("r_gerar.php");}
elseif(!empty($_GET['atv']) == "cash")
{include("r_ativar.php");}
elseif(!empty($_GET['spy']))
{include("spy.php");}
elseif(@$_GET['rank']=="all")
{include("rank.php");}
elseif(@$_GET['item']=="1")
{include("rank.php");}
elseif(@$_GET['senha']=="msenha"){
include("msenha.php");}
elseif(@$_GET['page']=="register"){
include("register.php");}
elseif(!$include){
include("news.php");}
?>
</td>
<td>
<a href="javascript:void(window.open('
','','width=590,height=610,left=0,top=0,resizable=yes,menubar=no,location=no,status=yes,scrollbars=yes'))"><img src="
" width="228" height="71" border="0" alt="LiveZilla Live Help"></a><div id="livezilla_tracking" style="display:none"></div><script type="text/javascript">
var script = document.createElement("script");script.type="text/javascript";var src = "
"+Math.random();setTimeout("script.src=src;document.getElementById('livezilla_tracking').appendChild(script)",1);</script><noscript><img src="
" width="0" height="0" style="visibility:hidden;" alt=""></noscript>
<br>
<img src="imagens/manutencao.png" />
<br />
<div align="center" style="background-image:url(imagens/rankcima.png); background-repeat:no-repeat"><br> </div>
<div align="center" style="background-image:url(imagens/rankmeio.png); background-repeat:repeat-y">
<table width="220" cellpadding="0" cellspacing="0" border="0" style="font-family:Tahoma, Geneva, sans-serif">
<?
$query=mysql_query("SELECT * FROM `rank` WHERE `data`=`".@date("dmy")."` ORDER BY `reset` DESC, `nome` DESC, `level` ASC")or die(mysql_error());
for($i=1;$i<=10;$i++){
$r=mysql_fetch_array($query);
if($r['nome']){
if($i==1){$cor="#CC0000";}
elseif($i==2){$cor="#CC3333";}
elseif($i==3){$cor="#CC6666";}
else{$cor="#000000";}
echo "<tr>
<td width=\"10\"> </td>
<td width=\"45\">".$i"</td>
<td width=\"125\" style=\"color:$cor\">
</td>
<td width=\"50\">".$r['level']."</td>
</tr>";
}
}
?></table>
</div>
<img src="imagens/rankbaixo.png" border="0" usemap="#Map4">
<br />
<img src="imagens/cidades.png" />
</td>
</tr>
</table>
<map name="Map2" id="Map2">
<area shape="rect" coords="64,116,114,127" href="?page=register" />
<area shape="rect" coords="139,37,186,97" href="javascript:void(0);" onClick="login.submit();" alt="Entrar" />
</map>
<map name="Map3">
<area shape="rect" coords="1,7,197,61" href="#Coloque Seu Forum Aqui" target="_blank" />
<area shape="rect" coords="2,73,224,154" href="?page=contato">
</map>
<map name="Map4">
<area shape="rect" coords="174,-4,216,13" href="?rank=all">
</map>
</div>
</body>
</html>

 

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.