PHP-Frage (<input>-feld) - Seite 2

Seite 2 von 2 - Forum: Coding Stuff auf overclockers.at

URL: https://www.overclockers.at/coding-stuff/php-frage_ltinputgt-feld_63576/page_2 - zur Vollversion wechseln!


watchout schrieb am 19.01.2003 um 23:09

alternativ (falls kein 4.3 vorhanden) hab ich diese coole function gefunden :)

Code: PHP
function file_get_contents($f)
{
	ob_start();
	$retval = @readfile($f);
	if (false !== $retval) // no readfile error
	{
		$retval = ob_get_contents();
	}
	ob_end_clean();
	return $retval;
}


COLOSSUS schrieb am 20.01.2003 um 18:39

Danke für die Hilfe :) Klappt jetzt wunderbar \o/

Aber einmal bitte ich noch um Erleuchtung, ich krieg einfach nicht "gebacken" wie zur hölle ich den Inhalt eines HTML-Files (inkl. HTML-Tags!) in ein textarea kriege, ohne dass das ding so passiert wie auf http://eurocorp.strikenet.at/eurocorp/editnews.php - also dass die HTML einfach stur weiteerinterpretiert wird.

Jetzt sieht die Definition des textarea-feldes so aus:

<input name="editednews" type="textarea" rows="20" cols="100" value="<?php $oldnews=file_get_contents("newscontent.php"); echo $oldnews;?>">

Hat wer eine Idee, wie man das bewerkstelligen könnte?
Tia für die wie gewohnt grossartige Hilfestellung :)


d3cod3 schrieb am 20.01.2003 um 19:38

hm. nur mal eine vermutung. muss ma net im php tag statt " ' machen? oder war dass nur wenn i da was mit mysql herumwurschtel?

also 'nescontent.php'


COLOSSUS schrieb am 20.01.2003 um 20:17

also ich hab bis jetzt immer mit dem doppelstrichigen quotiert - hat immer geklappt :)

werd's aber mal versuchen. :)


d3cod3 schrieb am 20.01.2003 um 23:07

jou. bin mir eh net ganz sicher. war nur das einzige wo i mir denken tät dass was net passen könnt. sonst schauts imo ok aus. (bin aber a net wirklich a php maßstab)


atrox schrieb am 21.01.2003 um 12:05

damit sollte es funktionieren:

Code:
 <input name="editednews" type="textarea" rows="20" cols="100" 
        value="<?php echo htmlentities(file_get_contents("newscontent.php")); ?>">
aber das erzeugt nur einen einzeiligen breich (type=textarea gibt es nicht, und default ist type=text), was du brauchst ist ein <textarea>-tag...

Code:
<textarea name="editednews" rows="20" cols="100"><?php 
  echo htmlentities(file_get_contents("newscontent.php")); ?></textarea>


COLOSSUS schrieb am 21.01.2003 um 15:22

ich liebe dich! :D ;)

danke :) äwre ich wohl nie draufgekommen :)




overclockers.at v4.thecommunity
© all rights reserved by overclockers.at 2000-2025