![]() |
[php] in Datei schreiben funtzt nicht so wie ich möchte :(
Hallo Community :D
ich habe hier mal ein kleines PHP Problem...chen : Zitat:
weiss einer was ich falsch mache ? mfg und vielen Dank im Voraus, Assun |
Re: [php] in Datei schreiben funtzt nicht so wie ich möchte
Also ich würde den Code mal ein bisschen umschreiben:
Code:
Nur weiß ich nicht ob das hilft.
<?
$host = $_POST["host"]; $username = $_POST["username"]; $password = $_POST["password"]; $text = "<?php define ( 'DBHOST', '".$host."'); # sql host define ( '".$username."'); # sql user define ( '".$password."'); # sql pass define ( 'DBDATE', ''); # sql datenbank ?>"; echo $text; $datei = fopen("config.php","w+"); fwrite($datei, $text ); fclose($datei); ?> Flare |
Re: [php] in Datei schreiben funtzt nicht so wie ich möchte
also so is das script im "rohzustand" :
Zitat:
Zitat:
|
Re: [php] in Datei schreiben funtzt nicht so wie ich möchte
Im Prinzip sollte die Lösung von Flare funktionieren (in PHP ist nun mal nicht alles so wie in Delphi :P ).
|
Re: [php] in Datei schreiben funtzt nicht so wie ich möchte
ah dankesehr so funtzt es nun richtig ;)
Zitat:
|
Re: [php] in Datei schreiben funtzt nicht so wie ich möchte
Punkte sind in PHP dazu da um Strings miteinander zu Verbinden :zwinker: Du hast dafür Pluszeichen verwendet, nur weiß ich nicht ob die klappen.
Flare |
Re: [php] in Datei schreiben funtzt nicht so wie ich möchte
achso okay danke ;)
|
Re: [php] in Datei schreiben funtzt nicht so wie ich möchte
Hm... der Unterschied von einfachen und doppelten Anführungszeichen in PHP noch mal so als Zusatz:
Code:
Variablennamen in doppelten Ausführungszeichen werden also direkt übersetzt und man kann sich die "...".$n."..." Konstrukte sparen. :zwinker:
[color=#1f00ff]$string[/color] = [color=#5f0000]"Test"[/color];
echo [color=#5f0000]"Ausgabe [/color][color=#1f00ff]$string[/color][color=#5f0000]"[/color]; [color=#bf00ff]//erzeugt: Ausgabe Test[/color] echo [color=#5f0000]'Ausgabe $string'[/color]; [color=#bf00ff]//erzeugt: Ausgabe $string[/color] |
Alle Zeitangaben in WEZ +1. Es ist jetzt 15:39 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz