Bonjour,
Je fait un site prestashop et j'ai une erreur que j'arrive pas à résoudre :
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /homez.316/watermelj/www/install/classes/ToolsInstall.php on line 4
voilà le code :
<?php
class ToolsInstall
{
public static function checkDB ($srv, $login, $password, $name, $posted = true)
{
include_once(INSTALL_PATH.'/../classes/Validate.php');
include_once(INSTALL_PATH.'/../classes/Db.php');
include_once(INSTALL_PATH.'/../classes/MySQL.php');
if($posted)
{
// Check POST data...
$data_check = array(
!isset($_GET['server']) OR empty($_GET['server']),
!Validate::isMailName($_GET['server']),
!isset($_GET['type']) OR empty($_GET['type']),
!Validate::isMailName($_GET['type']),
!isset($_GET['name']) OR empty($_GET['name']),
!Validate::isMailName($_GET['name']),
!isset($_GET['login']) OR empty($_GET['login']),
!Validate::isMailName($_GET['login']),
!isset($_GET['password'])
);
foreach ($data_check AS $data)
if ($data)
return 8;
}
switch(MySQL::tryToConnect($srv, $login, $password, $name))
{
case 0:
if (MySQL::tryUTF8($srv, $login, $password))
return true;
return 49;
break;
case 1:
return 25;
break;
case 2:
return 24;
break;
}
}
public static function getHttpHost($http = false, $entities = false)
{
$host = (isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']);
if ($entities)
$host = htmlspecialchars($host, ENT_COMPAT, 'UTF-8');
if ($http)
$host = 'http://'.$host;
return $host;
}
public static function sendMail($smtpChecked, $smtpServer, $content, $subject, $type, $to, $from, $smtpLogin, $smtpPassword, $smtpPort = 25, $smtpEncryption)
{
include(INSTALL_PATH.'/../tools/swift/Swift.php');
include(INSTALL_PATH.'/../tools/swift/Swift/Connection/SMTP.php');
include(INSTALL_PATH.'/../tools/swift/Swift/Connection/NativeMail.php');
Enfaite je viens de résoudre le problème de syntaxe, mais maintenant j'ai un autre problème, c'est que je n'arrive pas à configurer ma base donnée, pourtant j'ai toutes les informations. Je suis sous OVH et la je n'ai plus d'idée ça fait 2 h que j'essaie de régler ceci. Auriez-vous une idée?
Merci.