Formular --> Fehler bei Verarbeitung

andulus

Erfahrenes Mitglied
Hallo Leute!
Ich stehe vor einem riesen Problem:
Mein Wysiwyg-Editor (habe ich selbst mit JS programmiert) sendet den Inhalt des Editors (in Html) an eine PHP-Datei, die die Textarea (variable $content) verarbeitet und ausgibt!
-----------------------------------
Nun das Problem:
-----------------------------------
Wenn die Textarea (Wysiwyg) diesen Code:
Code:
<IMG style=\WIDTH: 336px; HEIGHT: 221px\ height=213 alt=\\ src=\peet_edit/peet.jpg\ width=362>
an die PHP-Verarbeitungsdatei sendet (in dieser der PHP-Befehl "echo" diese HTML befehle wieder geben sollte) erscheint, dass kein Bild existiert (Logisch bei dem von PHP ausgegeben Quellcode :
Code:
<IMG style=\WIDTH: 336px; HEIGHT: 221px\ height=213 alt=\\ src=\peet_edit/peet.jpg\ width=362>)

-----------------------------------
:confused: :confused: :confused: :confused: :confused: :confused: :confused:
----------------------------------

Bitte helft mir,
Andulus
 
andulus hat gesagt.:
Hallo Leute!
Ich stehe vor einem riesen Problem:
Mein Wysiwyg-Editor (habe ich selbst mit JS programmiert) sendet den Inhalt des Editors (in Html) an eine PHP-Datei, die die Textarea (variable $content) verarbeitet und ausgibt!
-----------------------------------
Nun das Problem:
-----------------------------------
Wenn die Textarea (Wysiwyg) diesen Code:
Code:
<IMG style=\WIDTH: 336px; HEIGHT: 221px\ height=213 alt=\\ src=\peet_edit/peet.jpg\ width=362>
an die PHP-Verarbeitungsdatei sendet (in dieser der PHP-Befehl "echo" diese HTML befehle wieder geben sollte) erscheint, dass kein Bild existiert (Logisch bei dem von PHP ausgegeben Quellcode :
Code:
<IMG style=\WIDTH: 336px; HEIGHT: 221px\ height=213 alt=\\ src=\peet_edit/peet.jpg\ width=362>)

-----------------------------------
:confused: :confused: :confused: :confused: :confused: :confused: :confused:
----------------------------------

Bitte helft mir,
Andulus


Komme mit der Sache irgendwie nicht klar.

Warum hast du statt "(Hochkommas) \ (Backslashes)?
 
@motb:

1.) Danke für die schnelle Antwort

2.) Ich werde mich gleich dahinter hängen und schauen warum da Backslashes sind statt Hochkommas!
 
Ok, Ich versuche es ein 2es Mal:

hier ist mein komplettes Wysiwyg-Script

PHP:
 <html> 
<head> 
<title>Peet_Edit_1.0</title> 
</head> 
<script> 
function format(command, parameter) 
{ 
divEditable.focus(); 
document.execCommand(command, false, parameter); 
} 


function save(){

main.elements[0].value=document.all.divEditable.innerHTML;
document.main.action ="admin.php";
document.main.submit();

}


function insertImage()
{
	window.document.getElementById("divEditable").focus();
    thetext = window.document.selection.createRange();

    if (thetext.text != undefined) {
	    swnd = window.showModalDialog("image.html", "", "dialogHeight: 193px;dialogWidth: 428px;status:no;");

	    if (swnd[0] != "") {
	        text2paste = "<img src="+swnd[0]+" alt="+swnd[1]+"";
	        if (swnd[2] != "") {
	            text2paste += " border="+swnd[2]+"";
	        }
	        if (swnd[3] != "none") {
	            text2paste += " align="+swnd[3]+"";
	        }
	        if (swnd[4] != "") {
	            text2paste += " hspace="+swnd[4]+"";
	        }
	        if (swnd[5] != "") {
	            text2paste += " vspace="+swnd[5]+"";
	        }
	        text2paste += ">";

	        thetext.pasteHTML(text2paste);
	    }
    } else {
    	window.document.execCommand("InsertImage", true);
    }
}


</script> 

<?

session_start();

if(isset($ok)) {
$_SESSION['bild'] = $bildname;
echo "<font color=red>Das Bild ''$bildname'' wurde erfolgreich in den Zwischenspeicher gelegt!</font>";
} 

?>
<body> 

<form>
<input type="text" name="bildname" value="Bildname"> <input type="submit" value="ok" name="ok" height:"23px">
</form>
<a href="../uploaden.php" target="blank">Bild uploaden</a><br><br>
<img src="save.gif" onClick="format('SaveAs', '');">
<img src="link.gif" onClick="format('CreateLink', '');">
<img src="copy.gif" onClick="format('Copy', '');">
<img src="cut.gif" onClick="format('Cut', '');">
<img src="paste.gif" onClick="format('Paste', '');">
<img src="bild.gif" onClick="insertImage()">
<img src="fett.gif" onClick="format('Bold', '');">
<img src="kursiv.gif" onClick="format('Italic', 
'');">
<img src="under.gif" onClick="format('Underline', 
'');">
<img src="links.gif" onClick="format('JustifyLeft', 
'');">
<img src="mitte.gif" onClick="format('JustifyCenter', 
'');">
<img src="rechts.gif" onClick="format('JustifyRight', 
'');">
<img src="black.gif" onClick="format('ForeColor', 'black');">
<img src="red.gif" onClick="format('ForeColor', 'red');">
<img src="blue.gif" onClick="format('ForeColor', 'blue');">
<img src="1.gif" onClick="format('FontSize', 1);">
<img src="2.gif" onClick="format('FontSize', 3);">
<img src="3.gif" onClick="format('FontSize', 5);">
<img src="4.gif" onClick="format('FontSize', 7);">
<img src="a.gif" onClick="format('FontName', 'Arial');">
<img src="t.gif" onClick="format('FontName', 'Times New 
Roman');">
<img src="c.gif" onClick="format('FontName', 'Courier New');">
<br>
<button onClick="format('InsertIframe','image.html');">Iframe</button>
<br>


<?
echo " <form name=\"main\" method=\"post\">\n"; 
echo "    <input type=\"hidden\" name=\"content\">\n"; 
echo " </form>\n"; 
?>
<div style="height:300; width=47%; background-color:white; 
font-face:Arial; padding:3; border:inset 2px; 
overflow=auto;" 
id="divEditable" contenteditable></div> 
<?
echo "<button onclick=\"save();\">Speichern</button>";
?>
<p>(c) 2005, by Andreas Petautschnig
</body> 
</html>

Mein Problem ist die spätere ausgabe in der "admin.php", inder dieser Code enthalten ist:

PHP:
<?
///////////////////////////////////////////////////////////////////////////
//  $inhalt = '<p><img height="71" alt="" src="peet.jpg" width="134"></p>';  
//  $inhalt=str_replace('"','',$inhalt);			               
//  echo $inhalt;
//
//$content=str_replace('"','',$content);
//$content=str_replace('http://greenmen.gr.ohost.de/','',$content);
/////////////////////////////////////////////////////////////////////////

echo $content; 

?>


Vielen Dank im Vorraus!"""!
 
Zurück