← PHP

[Ajuda] Erro Linha 6

Lida 2966 vezes

Offline

tiagofcf 
Membro
Mensagens 16 Gostos 0
Troféus totais: 17
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 3 Level 2 Level 1 10 Posts First Post Karma Eighth year Anniversary

Boas pessoal como nao sou muito bom em programaçao fui buscar um script a net para alterar.

Mas ele esta a dar-me um erro:

Código: [Seleccione]
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'sms'@'localhost' (using password: YES) in /home/dj/public_html/BEST/admin/memberhome/igwt.php on line 6
Could not connect to MySQL database, the server return the error: Access denied for user 'sms'@'localhost' (using password: YES)

o ERRO esta na linha 6

Código: [Seleccione]
1 <?
2 $server = 'localhost';
3 $database = 'dj_sms';
4 $username = 'sms';
5 $password = 'xxxxxxx';
6 $connection = mysql_connect($server,$username,$password);

Alguem pode ajudar?


Offline

Thomato 
Membro
Mensagens 4125 Gostos 2
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

É porque os dados da base de dados não coincidem com o que puseste no script ou porque a base de dados não dá acesso ao script.

Penso que seja isso.

Abraço.
Offline

tiagofcf 
Membro
Mensagens 16 Gostos 0
Troféus totais: 17
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 3 Level 2 Level 1 10 Posts First Post Karma Eighth year Anniversary

Mas os dados estao bem, pois eu tenho de por os dados noutro documento e nesse documento dao
Offline

Thomato 
Membro
Mensagens 4125 Gostos 2
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Na linha 4 mete:

4 $username = 'dj_sms';

Experimenta e diz se deu
Offline

tiagofcf 
Membro
Mensagens 16 Gostos 0
Troféus totais: 17
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 3 Level 2 Level 1 10 Posts First Post Karma Eighth year Anniversary

Quando ponha da-me isto

Código: [Seleccione]
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/dj/public_html/BEST/admin/memberhome/igwt.php on line 16

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/dj/public_html/BEST/admin/memberhome/igwt.php on line 19

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/dj/public_html/BEST/admin/memberhome/igwt.php on line 22

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'sms'@'localhost' (using password: YES) in /home/dj/public_html/BEST/mysql.php on line 6
Could not connect to MySQL database, the server return the error: Access denied for user 'sms'@'localhost' (using password: YES)
Offline

tiagofcf 
Membro
Mensagens 16 Gostos 0
Troféus totais: 17
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 3 Level 2 Level 1 10 Posts First Post Karma Eighth year Anniversary


Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/dj/public_html/BEST/admin/memberhome/igwt.php on line 16

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/dj/public_html/BEST/admin/memberhome/igwt.php on line 19

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/dj/public_html/BEST/admin/memberhome/igwt.php on line 22

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'sms'@'localhost' (using password: YES) in /home/dj/public_html/BEST/mysql.php on line 6
Could not connect to MySQL database, the server return the error: Access denied for user 'sms'@'localhost' (using password: YES)
Offline

Thomato 
Membro
Mensagens 4125 Gostos 2
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Que script estás a usar?

Em que ficheiro tens que por os dados de acesso?
Offline

tiagofcf 
Membro
Mensagens 16 Gostos 0
Troféus totais: 17
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 3 Level 2 Level 1 10 Posts First Post Karma Eighth year Anniversary

um script que tem outro arquivo para por os dados mysql que tbbm ja pus la
Offline

Thomato 
Membro
Mensagens 4125 Gostos 2
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Dá-me aqui o código dos dois sítios onde pões os dados sff.
Offline

tiagofcf 
Membro
Mensagens 16 Gostos 0
Troféus totais: 17
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 3 Level 2 Level 1 10 Posts First Post Karma Eighth year Anniversary

Código: [Seleccione]
<?
$server = 'localhost';
$database = 'dj_sms';
$username = 'sms';
$password = 'XXXXX';
$connection = mysql_connect($server,$username,$password);

if (!$connection) {
die('Could not connect to MySQL database, the server return the error: '.mysql_error());
}
// $db2 = mysql_select_db($database2);
$db = @mysql_select_db($database);
 






function sysmail()
{
  $check = mysql_query("SELECT content FROM configuration WHERE description = 'sysmail'");
$row = mysql_fetch_row($check);
$d = "From: ";
$d .= $row[0];
$d .= "\r\n";
return $d;
}



function forumlink()
{
  $check = mysql_query("SELECT content FROM configuration WHERE description = 'forum'");
$ffff = mysql_fetch_row($check);
$d = $ffff[0];
return $d;
}



function vbl($usern,$paswd,$ema)
{





return "INSERT INTO `user` ( `username` , `password` , `email` )  VALUES ('".$usern."','".$paswd."','".$ema."')";

}
 










?>

Código: [Seleccione]
<?
$server = 'localhost';
$database = 'dj_sms';
$username = 'dj_sms';
$password = 'XXXX';
$connection = mysql_connect($server,$username,$password);

if (!$connection) {
die('Could not connect to MySQL database, the server return the error: '.mysql_error());
}
// $db2 = mysql_select_db($database2);
$db = @mysql_select_db($database);
 

  $check = mysql_query("SELECT content FROM configuration WHERE description = 'sitename'");
$sitename = mysql_fetch_row($check);

  $check = mysql_query("SELECT content FROM configuration WHERE description = 'title'");
$title = mysql_fetch_row($check);

  $check = mysql_query("SELECT content FROM configuration WHERE description = 'forum'");
$forum = mysql_fetch_row($check);


$footer = "<tr>
<td colspan=\"17\" style=\"background-image: url(images/dilitme.jpg);\">
<p align=\"center\" style=\"margin-top: 3px; margin-bottom: 0\">
<span class=\"txt\"><a href=\"http://$_SERVER[SERVER_NAME]/index.php\"><font color=\"#666666\">Home</font></a>&nbsp;&nbsp; |&nbsp;&nbsp;<a href=\"http://$_SERVER[SERVER_NAME]/faq.php\"><font color=\"#666666\">Site not working?</font></a>&nbsp;&nbsp; |&nbsp;&nbsp;<a href=\"http://$_SERVER[SERVER_NAME]/signup.php\"><font color=\"#666666\">Sign Up</font></a>&nbsp;&nbsp; |&nbsp;&nbsp;<a href=\"http://$_SERVER[SERVER_NAME]/faq.php\"><font color=\"#666666\">Support</font></a>&nbsp;&nbsp; |&nbsp;&nbsp;<a href=\"$forum[0]\" target=\"_blank\"><font color=\"#666666\">Forums</font></a>&nbsp;&nbsp; |&nbsp;&nbsp;<a href=\"/sponsor\" ><font color=\"#666666\">Sponsor Login</font></a>&nbsp;&nbsp; |&nbsp;&nbsp;<a href=\"http://$_SERVER[SERVER_NAME]/privacy.php\"><font color=\"#666666\">Privacy</font></a>&nbsp;&nbsp; |&nbsp;&nbsp; <a href=\"http://$_SERVER[SERVER_NAME]/terms.php\">
<font color=\"#666666\">Terms of Service</font></a></span><p align=\"center\" style=\"margin-top: 5px; margin-bottom: 2px\">
  <span class=\"txt\">Copyright 2006 $sitename[0]. All rights reserved.</span></td>
</tr>";



$sus = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<html>
<head>
<title>$title[0]</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<META http-equiv=\"Content-Language\" content=\"en-us\">
<META name=\"robots\" content=\"index,follow\">
<META name=\"revisit-after\" content=\"30 days\">
<META name=\"keywords\" content=\"free, sms, anonymous, cheap sms, spoofed sms, spoofed, spoof sms header, sms header, sms forum, sms for free, worldwide coverage sms, wordlwide, text messages\">
<meta name=\"description\" content=\"$sitename[0] delivers the best free sms service on the internet! Trick your friends by sending them spoofed sender messages.\">
<META name=\"page-topic\" content=\"Free SMS\">";

/*
<tr>
<td colspan="17" style="background-image: url(images/index_24.jpg);">
<p align="center" style="margin-top: 3px; margin-bottom: 0">
<span class="txt"><a href="index.php"><font color="#666666">Home</font></a>&nbsp;&nbsp; |&nbsp;&nbsp;<a href="login.php"><font color="#666666">My account</font></a>&nbsp;&nbsp;
|&nbsp;&nbsp;<a href="signup.php"><font color="#666666">Sign Up</font></a>&nbsp;&nbsp; |&nbsp;&nbsp;<a href="faq.php"><font color="#666666">Support</font></a>&nbsp;&nbsp; |&nbsp;&nbsp;<a href="forum.php"><font color="#666666">Forums</font></a>&nbsp;&nbsp; |&nbsp;&nbsp;<a href="privacy.php"><font color="#666666">Privacy</font></a>&nbsp;&nbsp; |&nbsp;&nbsp; <a href="terms.php">
<font color="#666666">Terms of Service</font></a></span><p align="center" style="margin-top: 5px; margin-bottom: 0">
  <span class="txt">Copyright 2006 $sitename[0]. All rights reserved.</span></td>
</tr>

*/






$notlogged = "
<img src=\"images/arr.jpg\" alt=\"Log In\" width=\"14\" height=\"11\" border=\"0\" style=\"vertical-align:middle;\">
<a href=\"index.php\" style=\"text-decoration: none\">
<font color=\"#666666\">Log In</font></a>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
<img src=\"images/arr.jpg\" alt=\"Register\" width=\"14\" height=\"11\" border=\"0\" style=\"vertical-align:middle;\">
<a href=\"register.php\" style=\"text-decoration: none\">
<font color=\"#666666\">Register</font></a>";

$adminlink = " <td colspan=\"3\" rowspan=\"2\" style=\"background-image: url(images/raw2_18.jpg);\"  valign=\"top\"><br>
<table id=\"table1\" width=\"144\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td>
<p style=\"margin-left: 1px\">
<a href=\"index.php\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Admin Home','','images/hom2.jpg',1)\"><img src=\"images/hom1.jpg\" name=\"Admin Home\" width=\"144\" height=\"18\" border=\"0\" alt=\"Admin Home\"></a></td>
</tr>
<tr>
<td>
<p style=\"margin-left: 1px\">
<a href=\"member.php\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Member Management','','images/member2.jpg',1)\"><img src=\"images/member1.jpg\" alt=\"Member Management\" name=\"Member Management\" width=\"144\" height=\"18\" border=\"0\"></a></td>
</tr>
<tr>
<td>
<p style=\"margin-left: 1px\">
<a href=\"massmail.php\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Mass Mail','','images/mass2.jpg',1)\"><img src=\"images/mass1.jpg\" alt=\"Mass Mail\" name=\"Mass Mail\" width=\"144\" height=\"18\" border=\"0\"></a></td>
</tr>
<tr>
<td>
<p style=\"margin-left: 1px\">
<a href=\"sqlbackup.php\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Sql Backup','','images/sql2.jpg',1)\"><img src=\"images/sql.jpg\" alt=\"Sql Backup\" name=\"Sql Backup\" width=\"144\" height=\"18\" border=\"0\"></a></td>
</tr>
<tr>
<td>
<p style=\"margin-left: 1px\">
<a href=\"news.php\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('News Management','','images/news2.jpg',1)\"><img src=\"images/news1.jpg\" alt=\"News Management\" name=\"News Management\" width=\"144\" height=\"18\" border=\"0\"></a></td>
</tr> <tr>
<td>
<p style=\"margin-left: 1px\">
<a href=\"edithtml.php\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Content Management','','images/content2.jpg',1)\"><img src=\"images/content.jpg\" alt=\"Content Management\" name=\"Content Management\" width=\"144\" height=\"18\" border=\"0\"></a></td>
</tr>
<tr>
<td>
<p style=\"margin-left: 1px\">
<a href=\"configuration.php\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Site Configuration','','images/conf2.jpg',1)\"><img src=\"images/conf1.jpg\" alt=\"Site Configuration\" name=\"Site Configuration\" width=\"144\" height=\"18\" border=\"0\"></a></td>
</tr>
<tr>
<td>
<p style=\"margin-left: 1px\">
<a href=\"credits.php\"onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Credits Management','','images/credits2.jpg',1)\"><img src=\"images/credits1.jpg\" alt=\"Credits Management\" name=\"Credits Management\" width=\"144\" height=\"18\" border=\"0\"></a></td>
</tr> <tr>
<td>
<p style=\"margin-left: 1px\">
<a href=\"faq.php\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('FAQ Manager','','images/faq2.jpg',1)\"><img src=\"images/faq1.jpg\" alt=\"FAQ Manager\" name=\"FAQ Manager\" width=\"144\" height=\"18\" border=\"0\"></a></td>
</tr> <tr>
<td>
<p style=\"margin-left: 1px\">
<a href=\"admin.php\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Admin Manager','','images/admin2.jpg',1)\"><img src=\"images/admin1.jpg\" alt=\"Admin Manager\" name=\"Admin Manager\" width=\"144\" height=\"18\" border=\"0\"></a></td>
</tr>
<tr>
<td>
<p style=\"margin-left: 1px\">
<a href=\"paypal.php\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('PayPal','','images/paypal2.jpg',1)\"><img src=\"images/paypal.jpg\" alt=\"PayPal\" name=\"PayPal\" width=\"144\" height=\"18\" border=\"0\"></a></td>
</tr>
<tr>
<td>
<p style=\"margin-left: 1px\">
<a href=\"sponsor.php\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Sponsor','','images/sponsor2.jpg',1)\"><img src=\"images/sponsor.jpg\" alt=\"Sponsor\" name=\"Sponsor\" width=\"144\" height=\"18\" border=\"0\"></a></td>
</tr>
<tr>
<td>
<p style=\"margin-left: 1px\">
<a href=\"approval.php\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Approval','','images/app2.jpg',1)\"><img src=\"images/app.jpg\" alt=\"Approval\" name=\"Approval\" width=\"144\" height=\"18\" border=\"0\"></a></td>
</tr>
</tr>
<tr>
<td>
<p style=\"margin-left: 1px\">
<a href=\"apph.php\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Approve History','','images/apph2.jpg',1)\"><img src=\"images/apph.jpg\" alt=\"Approve History\" name=\"Approve History\" width=\"144\" height=\"18\" border=\"0\"></a></td>
</tr>
<tr>
<td>
<p style=\"margin-left: 1px\">
<a href=\"signout.php\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Signout','','images/signout2.jpg',1)\"><img src=\"images/signout.jpg\" alt=\"Signout\" name=\"Signout\" width=\"144\" height=\"18\" border=\"0\"></a></td>
</tr>

</table>
<br><br>
";


mysql_close();
?>
Offline

Henrique Mouta 
Equipa
Mensagens 1189 Gostos 3
Troféus totais: 30
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3 Level 2

$username = 'dj_sms';
Tens de ter sempre esse username.
Porque no cpanel o username é sempre userdocpanel_userdabd
Offline

tiagofcf 
Membro
Mensagens 16 Gostos 0
Troféus totais: 17
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 3 Level 2 Level 1 10 Posts First Post Karma Eighth year Anniversary

Neps o meu user do cpanel e diferente do BD
Offline

Thomato 
Membro
Mensagens 4125 Gostos 2
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Mas as contas estão no mesmo servidor?
Offline

tiagofcf 
Membro
Mensagens 16 Gostos 0
Troféus totais: 17
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Level 3 Level 2 Level 1 10 Posts First Post Karma Eighth year Anniversary

y
Offline

Thomato 
Membro
Mensagens 4125 Gostos 2
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Diz-me o nome da conta onde está a BD e o nome da BD e o USERNAME...

A pass não quero...