Développer un site : Jour 2, La structure PHP

Par bobigreen, il y a 13 ans


ces encore moi je viens a peine de commencer la suite que j ai déjà des erreur je ces pas si ces moi qui suis mal le tuto mais je pence pas .

les erreur qu'il m'affiche son

Warning: define() expects at least 2 parameters, 1 given in C:\wamp\www\webroot\index.php on line 2
Call Stack

Time Memory Function Location

1 0.0008 676008 {main}( ) ..\index.php:0
2 0.0008 676152 define ( ) ..\index.php:2

( ! ) Notice: Use of undefined constant WEBROOT - assumed 'WEBROOT' in C:\wamp\www\webroot\index.php on line 3
Call Stack

Time Memory Function Location

1 0.0008 676008 {main}( ) ..\index.php:0

( ! ) Warning: define() expects at least 2 parameters, 1 given in C:\wamp\www\webroot\index.php on line 3
Call Stack

Time Memory Function Location

1 0.0008 676008 {main}( ) ..\index.php:0
2 0.0013 676368 define ( ) ..\index.php:3

( ! ) Warning: define() expects at least 2 parameters, 1 given in C:\wamp\www\webroot\index.php on line 4
Call Stack

Time Memory Function Location

1 0.0008 676008 {main}( ) ..\index.php:0
2 0.0014 676360 define ( ) ..\index.php:4

( ! ) Notice: Use of undefined constant ROOT - assumed 'ROOT' in C:\wamp\www\webroot\index.php on line 5
Call Stack

Time Memory Function Location

1 0.0008 676008 {main}( ) ..\index.php:0

( ! ) Notice: Use of undefined constant DS - assumed 'DS' in C:\wamp\www\webroot\index.php on line 5
Call Stack

Time Memory Function Location

1 0.0008 676008 {main}( ) ..\index.php:0

( ! ) Warning: define() expects at least 2 parameters, 1 given in C:\wamp\www\webroot\index.php on line 5
Call Stack

Time Memory Function Location

1 0.0008 676008 {main}( ) ..\index.php:0
2 0.0018 676360 define ( ) ..\index.php:5

( ! ) Warning: define() expects at least 2 parameters, 1 given in C:\wamp\www\webroot\index.php on line 6
Call Stack

Time Memory Function Location

1 0.0008 676008 {main}( ) ..\index.php:0
2 0.0021 676360 define ( ) ..\index.php:6

( ! ) Notice: Use of undefined constant BASE_URL - assumed 'BASE_URL' in C:\wamp\www\webroot\index.php on line 8
Call Stack

Time Memory Function Location

1 0.0008 676008 {main}( ) ..\index.php:0
BASE_URL

je comprend pas pourquoi j'ai exactement le même code que le tuto merci de me venir en aide

9 réponses

bobigreen, il y a 13 ans
define('CORE',ROOT,DS,);

a résolut mon souci

djtec, il y a 13 ans

Montre nous le code de ton fichier

mitnick93150, il y a 13 ans

regarde au niveaux de tes declarations car il doit être mal appelé ou crée.

bobigreen, il y a 13 ans

bonjour le code de mon fichier le voici :

<?php
define('WEBROOT'.dirname( __file__ ));
define('ROOT'.dirname(WEBROOT));
define('DS'.DIRECTORY_SEPARATOR);
define('CORE'.ROOT.DS.'core');
define('BASE_URL'.dirname(dirname($_SERVER'SCRIPT_NAME'])));
echo BASE_URL;
?>

pourtant j ai bien suivi le tuto je comprend pas du tous

djtec, il y a 13 ans

Tu as mit des points à la place des virgules partout dans les define

Après toute les mot comme 'WEBROOT', 'ROOT' il faut mettre des virgule et pas des points

bobigreen, il y a 13 ans

ok je vais essayer sa

bobigreen, il y a 13 ans

j ais mis des virgule a la place mais une erreur mes afficher de nouveau
voici l'erreur

Warning: define() expects at most 3 parameters, 4 given in C:\wamp\www\webroot\index.php on line 5

voici mon fichier

<?php
define('WEBROOT',dirname( __file__ ));
define('ROOT',dirname(WEBROOT));
define('DS',DIRECTORY_SEPARATOR);
define('CORE',ROOT,DS,'core');
define('BASE_URL',dirname(dirname($_SERVER'SCRIPT_NAME'])));
echo BASE_URL;
?>
luffysan, il y a 13 ans
define('CORE',ROOT,DS,'core');

Tu as donnée trop de paramètres.

bobigreen, il y a 13 ans

dans le tuto il fais comme sa donc moi je suis vraiment un zéro de php quelle paramètre enlever s'il te plais