Eddy_dr_Zivi
Well-known member
- 8 Mai 2006
- 140
- 16
Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
"Das Nachladen von PHP Code aus externen Seiten per http und ftp wurde deaktiviert"
"<?php require("$_SERVER[DOCUMENT_ROOT]/counter/index.php"); ?>"
Bis auf die von Cybo genannten äußeren Anführungszeichen ist doch alles in Ordnung?Die Anfuehrungszeichen stimmen eh vorn und hinten ned![]()
[COLOR=Red][B]"[/B][/COLOR]$_SERVER[DOCUMENT_ROOT]/counter/index.php[COLOR=Red][B]"[/B][/COLOR]
$_SERVER[[COLOR=Red][B]'[/B][/COLOR]DOCUMENT_ROOT[COLOR=Red][B]'[/B][/COLOR]][COLOR=Red][B].[/B][/COLOR] [COLOR=Red][B]"[/B][/COLOR]/counter/index.php[COLOR=Red][B]"[/B][/COLOR]
<?php require("{$_SERVER['DOCUMENT_ROOT']}/counter/index.php"); ?>
[COLOR=Black]"[B][COLOR=Red]{[/COLOR][/B]$_SERVER['DOCUMENT_ROOT'][B][COLOR=Red]}[/COLOR][/B]/counter/index.php"[/COLOR]
"$_SERVER[DOCUMENT_ROOT]/counter/index.php"
um die OhrenParse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
$_SERVER[[B][COLOR=Red]'[/COLOR][/B]DOCUMENT_ROOT[COLOR=Red][B]'[/B][/COLOR]][COLOR=Red][B]. "[/B][/COLOR]/counter/index.php[COLOR=Red][B]"[/B][/COLOR]
[B][COLOR=Red]"{[/COLOR][/B]$_SERVER[[COLOR=Red][B]'[/B][/COLOR]DOCUMENT_ROOT[COLOR=Red][B]'[/B][/COLOR]][COLOR=Red][B]}[/B][/COLOR]/counter/index.php[COLOR=Red][B]"[/B][/COLOR]
[COLOR=Red][B]"[/B][/COLOR]$_SERVER[DOCUMENT_ROOT]/counter/index.php[COLOR=Red][B]"[/B][/COLOR]
Das wäre mir verdammt neu. Quelle bitteBei letzterem Beispiel betrachtet PHP die Variable nicht als Konstante, sondern als Variable.
Quelle: https://de2.php.net/manual/en/language.types.array.phpWhy is $foo[bar] wrong?
Always use quotes around a string literal array index. For example, $foo['bar'] is correct, while $foo[bar] is not. But why?
[...]
This is wrong, but it works. The reason is that this code has an undefined constant (bar) rather than a string ('bar' - notice the quotes). [...]
Quelle: https://de2.php.net/manual/en/language.types.string.php#language.types.string.parsing.simple// Works, but note that this works differently outside a string
echo "A banana is $fruits[banana].";
Es ist richtig, und wird in einem PHP-Buch von mir auch als Möglichkeit gelehrt.
Quelle: https://de2.php.net/manual/en/language.types.string.php#language.types.string.parsing.simple

echo "A banana is ".$fruits['banana'].".";
Schön und richtig wäre natürlich:
PHP:echo "A banana is ".$fruits['banana'].".";