← Desenvolvimento

script de imagens

Lida 3468 vezes

Offline

Freedoom 
Membro
Mensagens 723 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

ola!
fui tentar instalar este script e obtive este erro:
Código: [Seleccione]
Installation Step 1 - Failed
The script could not connect to MySQL because Access denied for user 'root'@'localhost' (using password: NO)

o nome da base de dados, do utilizador e a password(que são: freedoom_imagens(db), freedoom_imagens(username)e a pass...) foram colocadas correctamente, eu suspeito que seja algum erro do script(ou não)..
vou colocar aqui o install.php:
Código: [Seleccione]
<?php
ini_set
&#40;'display_errors', 1&#41;;
error_reporting&#40;E_ALL & ~ E_NOTICE&#41;;
function headerprint&#40;&#41;
&#123;
echo&#40;'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<
head>
  <
title>|| Img Upload Installation ||</title>
  <
meta http-equiv="Content-Type"
 
content="text/html; charset=iso-8859-1">
  <
style type="text/css">
<!--
body,td,th &#123;
color&#58; #333333;
font-family&#58; Lucida Sans;
font-size&#58; 12px;
&#125;
a&#58;link &#123;
color&#58; #2757AF;
text-decoration&#58; none;
&#125;
a&#58;visited &#123;
text-decoration&#58; none;
color&#58; #2757AF;
&#125;
a&#58;hover &#123;
text-decoration&#58; underline;
color&#58; #7B9FE1;
&#125;
a&#58;active &#123;
text-decoration&#58; none;
color&#58; #2757AF;
&#125;
body &#123;
background-image&#58; url&#40;images/bg.gif&#41;;
margin-left&#58; 0px;
margin-right&#58; 0px;
margin-top&#58; 50px;
margin-bottom&#58; 50px;
&#125;
input &#123;
    
background-color&#58; #F2F2F2; 
    
color&#58; #2554AA;
    
font-family&#58; Verdana;
    
font-size&#58; 11;
  
&#125;
&#125;
.style2 &#123;font-size&#58; 9px&#125;
.style3 &#123;font-size&#58; 12px&#125;
.style5 &#123;color&#58; #2757AF&#125;
-->
 </
style>
</
head>
<
body>
<
table align="center" border="0" cellpadding="0" cellspacing="0"
 
width="580">
  <
tbody>
    <
tr>
      <
td colspan="3" align="left" background="images/index_01.gif"
 
height="137" valign="bottom">
      <
class="style3">  <br>
      </
p>
      </
td>
    </
tr>
    <
tr>
      <
td colspan="3"> <img src="images/index_02.gif" alt=""
 
height="15" width="580"></td>
    </
tr>
    <
tr>
      <
td rowspan="5" align="left" background="images/index_03.gif"
 
valign="top"> <img src="images/index_03.gif" alt="" height="174"
 
width="21"></td>
      <
td align="left" background="images/index_04.gif" valign="middle"><center>ImgUpload Installation</center>
      <
br>
      </
span></strong> </td>
      <
td rowspan="5" align="left" background="images/index_05.gif"
 
valign="top" width="24">&nbsp;</td>
    </
tr>
    <
tr>
      <
td> </td>
    </
tr>
    <
tr>
      <
td align="left" bgcolor="#ffffff" height="130" valign="top"
 
width="535">
      <
p><a href="#"></a>&nbsp;</p>
      <
center>'&#41;;
&#125;

function footerprint&#40;&#41;
&#123;
echo&#40;'
<p><br>
      </
p>
      </
center>
      <
p> </p>
      </
td>
    </
tr>
    <
tr>
      <
td> <img src="images/index_08.gif" alt="" height="4" width="535"></td>
    </
tr>
    <
tr>
      <
td align="left" background="images/index_09.gif" nowrap="nowrap"
 
valign="top"> <span class="style2"><font face="Arial"></font></span></td>
    </
tr>
    <
tr>
      <
td colspan="3" align="center" background="images/index_10.gif"
 
height="54" valign="middle"><span class="style2"Copyright IMG
Upload
by <a href="http&#58;//hellscythe.net">Hellscythe</a> </span></td>
    </
tr>
  </
tbody>
</
table>
</
body>
</
html>'&#41;;
&#125;

headerprint&#40;&#41;;

function echobr&#40;$text&#41;
&#123;
echo&#40;"" . $text . "<br />"&#41;;
return;
&#125;

if&#40;$_POST['
finishstep'&#93; == "1"&#41;
&#123;
installstep1&#40;$mysqlhost, $mysqluser, $mysqlpass, $mysqldb&#41;;
&#125; elseif&#40;$_POST['
finishstep'&#93; == "2"&#41;
&#123;
if&#40;empty&#40;$_POST['
inputuser'&#93;&#41; || empty&#40;$_POST['inputpass'&#93;&#41; || empty&#40;$_POST['inputemail'&#93;&#41;&#41;
&#123;
echo&#40;"You didn'
t fill out a required fieldplease go back and try again"&#41;;
footerprint&#40;&#41;;
exit&#40;&#41;;
&#125;
installstep2&#40;
$inputuser$inputpass$inputemail$imgupaccess$uploadmax&#41;;
&#125; elseif&#40;
$_POST['finishstep'&#93; == "3"&#41;
&#123;
installstep3&#40;
$inputuser$inputpass$inputemail$imgupaccess$uploadmax&#41;;
&#125;

if&#40;
$_POST['installstep'&#93; == "1"&#41;
&#123;
echo&#40;'<p><form action="
install.php" method="post" />'&#41;;
echobr&#40;"
<u>MySQL Information&#58;</u><br />"&#41;;
echobr&#40;'MySQL Host&#58; <input type="text" name="mysqlhost" value="localhost" />'&#41;;
echobr&#40;'MySQL User&#58; <input type="text" name="mysqluser" />'&#41;;
echobr&#40;'MySQL Pass&#58; <input type="password" name="mysqlpass" />'&#41;;
echobr&#40;'MySQL Database&#58; <input type="text" name="mysqldb" />'&#41;;
echobr&#40;'<input type="hidden" name="finishstep" value="1" />'&#41;;
echobr&#40;'<input type="submit" name="submitstep1" value="Finish Step 1" />'&#41;;
echo&#40;'</form></p>'&#41;;
footerprint&#40;&#41;;
exit&#40;&#41;;
&#125; elseif &#40;$_POST['installstep'&#93; == "2"&#41; 
&#123;
echo&#40;'<p><form action="install.php" method="post" />'&#41;;
echo&#40;'<p>If you are unsure about what to put for Max Upload Size, leave it blank to use the default&#40;2mb&#41;.</p>'&#41;;
echobr&#40;'<u>Adminstrater Information&#58;</u>'&#41;;
echobr&#40;'Username&#58; <input type="text" name="inputuser" />'&#41;;
echobr&#40;'Password&#58; <input type="password" name="inputpass" />'&#41;;
echobr&#40;'E-Mail Address&#58; <input type="text" name="inputemail" />'&#41;;
echo&#40;'<input type="hidden" name="imgupaccess" value="admin" /></p>'&#41;;
echobr&#40;'<input type="hidden" name="finishstep" value="2" />'&#41;;
echobr&#40;'<input type="submit" name="submitstep2" value="Finish Step 2" />'&#41;;
echo&#40;'</form></p>'&#41;;
footerprint&#40;&#41;;
exit&#40;&#41;;
&#125; elseif &#40;$_POST['installstep'&#93; == "3"&#41;
&#123;
echobr&#40;"Installation completed succesfully. For security reasons, the installation file should be deleted."&#41;;
echo&#40;'<form action="install.php" method="post">'&#41;;
echo&#40;'<input type="hidden" name="finishstep" value="3" />'&#41;;
echobr&#40;'<input type="submit" name="submitstep3" value="Delete install file" />'&#41;;
footerprint&#40;&#41;;
exit&#40;&#41;;
&#125;

function installstep1&#40;$mysqlhost, $mysqluser, $mysqlpass, $mysqldb&#41;
&#123;
if&#40;@mysql_connect&#40;$mysqlhost, $mysqluser, $mysqlpass&#41;&#41;
&#123;
if&#40;@mysql_select_db&#40;$mysqldb&#41;&#41;
&#123; 
if&#40;$opendbfile = fopen&#40;'mysql.db.php', 'w+'&#41;&#41;
&#123;
$dbwritefile fwrite&#40;$opendbfile, '<?php
$mysqlhost "' . $_POST['mysqlhost'&#93; . '";
$mysqluser "' . $_POST['mysqluser'&#93; . '";
$mysqlpass "' . $_POST['mysqlpass'&#93; . '";
$mysqldb "' . $_POST['mysqldb'&#93; . '";
?>
');
if($dbwritefile == True)
{
$tablegen = 'CREATE TABLE imgupload(userid INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY
KEY, user VARCHAR(30) NOT NULL, pass VARCHAR(30) NOT NULL, emailaddr VARCHAR(50) NOT NULL,
access VARCHAR(7) NOT NULL)';
if(@mysql_query($tablegen))
{
echobr('Installation Step 1 - <font color="green"><b>Success!</b></font>');
echo('<form action="install.php" method="post" />');
echo('<input type="hidden" name="step1check" value="complete" />
 <input type="hidden" name="installstep" value="2" />');
echobr('<input type="submit" name="refrinstall" value="Proceed to Step 2" />');
   echo('</form>');
} else {
echobr('Installation Step 1 - <font color="red"><b>Failed</b></font>');
echobr("The error occured while generating the MySQL table. <b>" . mysql_error() . "</b>");
}
} else {
echobr('<p>Installation Step 1 - <font color="red"><b>Failed</b></font>');
echobr('The script could not write the MySQL information to <b>mysql.db.php</b>, please make sure
it has been chmodded to 0777.</p>');
fclose($dbwritefile);
}
} else {
echobr('<p>Installation Step 1 - <font color="red"><b>Failed</b></font>');
echobr('The script could not open <b>mysql.db.php</b>, please make sure it exists, and it has been
       chmodded to 0777.</p>');
    }
} else {
echobr('<p>Installation Step 1 - <font color="red"><b>Failed</b></font>');
echobr("The script could not select the database given because<b> " . mysql_error() .  "</b>");
}
} else {
echobr('<p>Installation Step 1 - <font color="red"><b>Failed</b></font>');
echobr("The script could not connect to MySQL because<b> " . mysql_error() . "</b>");
}
footerprint();
exit();
}

function installstep2($inputuser, $inputpass, $inputemail, $uploadmax, $imgupaccess)
{
require("mysql.db.php");
if(@mysql_connect($mysqlhost, $mysqluser, $mysqlpass))
{
if(@mysql_select_db($mysqldb))
{
$addadmin = "INSERT INTO imgupload(user, pass, emailaddr, access)
values ('{$_POST['inputuser']}', '{$_POST['inputpass']}', '{$_POST['inputemail']}', '{$_POST['imgupaccess']}')";
if(@mysql_query($addadmin)) {
$umask = umask(0);
if(mkdir("{$_POST['inputuser']}", 0777))
{
umask($umask);
if($openconfig = fopen('config.db.php', 'w+'))
{
if($_POST['uploadmax'] == "")
{
$uploadmax = 2000000;
}
$dbwritefile = fwrite($openconfig, '<?php
$uploadmax 
"' . $uploadmax . '";
?>
');
if($dbwritefile == True)
{
echobr('<p>Installation Step 2 - <font color="green"><b>Success!</b></font>');
echobr('<form action="install.php" method="post" />
<input type="hidden" name="step2check" value="complete" />
<input type="hidden" name="installstep" value="3" />
<input type="submit" name="refrinstall" value="Finish installation" />
</form></p>');
fclose($openconfig);
mysql_close();
}
}
} else {
echobr('<p>Installation Step 1 - <font color="red"><b>Failed</b></font>');
echobr('The error occured while creating the admin directory - Please make sure that this directory
has been chmodded to 0777.</p>');
}
} else {
echobr('<p>Installation Step 1 - <font color="red"><b>Failed</b></font>');
echobr('The error occured while adding the admin user to the table.</p>');
}
  } else { echobr("Installation could not select the specified database because: <b>" . mysql_error() . "</b>");}
} else { echobr("Installation could not connect to the MySQL host because: <b>" . mysql_error() . "</b>"); }
footerprint();
exit();
}

function installstep3()
{
unlink("install.php");
echobr('Installation deleted. Click <a href="index.php">here</a> to login.');
footerprint();
exit();
}

$getpath = dirname(__FILE__);
$tehpath = str_replace("\\", "/", $getpath)."/";

if(is_writable("mysql.db.php")) { $mysqlwrite = True; } else { $mysqlwrite = False; }
if(is_writable("config.db.php")) { $configwrite = True; } else { $configwrite = False; }
if(is_writable($tehpath)) { $dirwrite = True; } else { $dirwrite = False; }
if($mysqlwrite == False) { echobr("<b>mysql.db.php</b> - Is not writable, please chmod this file to 0777"); }
if($configwrite == False) { echobr("<b>config.db.php</b> - Is not writable, please chmod this file to 0777"); }
if($dirwrite == False) { echobr("<b>$tehpath</b> - Is not writable, please chmod this directory to 0777"); }

if($mysqlwrite && $configwrite && $dirwrite == True)
{
echobr("All files and folders required are writable. Please click the button below to begin the installation.");
echo('<form action="install.php" method="post" />');
echo('<input type="hidden" name="installstep" value="1" />');
echobr('<input type="submit" name="refreshinst1" value="Begin Installation" />');
echobr('</form></p>');
footerprint();
exit();
}
footerprint();
?>

se me poderem ajudar!
obrigado.
Offline

fpware 
Fundador
Mensagens 15318 Gostos 6
Troféus totais: 38
Trófeus: (Ver todos)
Linux User Mobile User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5

Não tem para lá um ficheiro config.php? Ou qualquer coisa do tipo?
Offline

Freedoom 
Membro
Mensagens 723 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

tem, vazio :O "config.db" e "mysql.db" os dois vazios.
é daqueles que depois de instalado é que aparece as definições lá
Offline

fpware 
Fundador
Mensagens 15318 Gostos 6
Troféus totais: 38
Trófeus: (Ver todos)
Linux User Mobile User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5

Fui a http://hellscythe.net fazer o download do script e não vejo nenhum desses ficheiros...
Offline

Freedoom 
Membro
Mensagens 723 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

humm fizeste download do imgupload0.3 ?
Offline

fpware 
Fundador
Mensagens 15318 Gostos 6
Troféus totais: 38
Trófeus: (Ver todos)
Linux User Mobile User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5

Fiz... É estranho!
Offline

Freedoom 
Membro
Mensagens 723 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

ya muito  :o
Offline

fpware 
Fundador
Mensagens 15318 Gostos 6
Troféus totais: 38
Trófeus: (Ver todos)
Linux User Mobile User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5

Esquece o que eu disse, tinha descarregado a versão 0.2... :lol:

Acabei de instalar a 0.3 sem problemas, confirma bem o user e a pass da tua bd.
Offline

Freedoom 
Membro
Mensagens 723 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Citação de: "fpware"
Esquece o que eu disse, tinha descarregado a versão 0.2... :lol:

Acabei de instalar a 0.3 sem problemas, confirma bem o user e a pass da tua bd.

:O o username e a pass estão correctas.... nao percebo pq não funciona
é que dá sempre aquele erro, independente de eu mudar de base de dados ou nao..
Offline

fpware 
Fundador
Mensagens 15318 Gostos 6
Troféus totais: 38
Trófeus: (Ver todos)
Linux User Mobile User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5

isso é mesmo estranho, comigo funcionou na perfeição...
Offline

kebrus 
Membro
Mensagens 459 Gostos 0
Troféus totais: 25
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 100 Posts

já conseguiste resolver esse problema, é que tinha uma sugestão...
Offline

fpware 
Fundador
Mensagens 15318 Gostos 6
Troféus totais: 38
Trófeus: (Ver todos)
Linux User Mobile User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5

Citação de: "kebrus"
já conseguiste resolver esse problema, é que tinha uma sugestão...


Bom, deixaste-me curioso!
Offline

kebrus 
Membro
Mensagens 459 Gostos 0
Troféus totais: 25
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 100 Posts

Citação de: "fpware"
Bom, deixaste-me curioso!

lol

a minha sugestão era tentar fazer o login sem por pass (caso ele ainda não tenha experimentado) é que vi ali root@localhost e lembro-me que uma vez a ligar-me quando tinha acabado de instalar tudo, não se podia por pass... é só uma sugestão.. lol
Offline

Freedoom 
Membro
Mensagens 723 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Windows User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Citação de: "kebrus"
Citação de: "fpware"
Bom, deixaste-me curioso!

lol

a minha sugestão era tentar fazer o login sem por pass (caso ele ainda não tenha experimentado) é que vi ali root@localhost e lembro-me que uma vez a ligar-me quando tinha acabado de instalar tudo, não se podia por pass... é só uma sugestão.. lol

tks kebrus, mas ja desisti lol
Offline

fpware 
Fundador
Mensagens 15318 Gostos 6
Troféus totais: 38
Trófeus: (Ver todos)
Linux User Mobile User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5

Não é mal visto kebrus...