Top-Themen

AppleEntwicklungHardwareInternetLinuxMicrosoftMultimediaNetzwerkeOff TopicSicherheitSonstige SystemeVirtualisierungWeiterbildungZusammenarbeit

Aktuelle Themen

Administrator.de FeedbackApache ServerAppleAssemblerAudioAusbildungAuslandBackupBasicBatch & ShellBenchmarksBibliotheken & ToolkitsBlogsCloud-DiensteClusterCMSCPU, RAM, MainboardsCSSC und C++DatenbankenDatenschutzDebianDigitiales FernsehenDNSDrucker und ScannerDSL, VDSLE-BooksE-BusinessE-MailEntwicklungErkennung und -AbwehrExchange ServerFestplatten, SSD, RaidFirewallFlatratesGoogle AndroidGrafikGrafikkarten & MonitoreGroupwareHardwareHosting & HousingHTMLHumor (lol)Hyper-VIconsIDE & EditorenInformationsdiensteInstallationInstant MessagingInternetInternet DomäneniOSISDN & AnaloganschlüsseiTunesJavaJavaScriptKiXtartKVMLAN, WAN, WirelessLinuxLinux DesktopLinux NetzwerkLinux ToolsLinux UserverwaltungLizenzierungMac OS XMicrosoftMicrosoft OfficeMikroTik RouterOSMonitoringMultimediaMultimedia & ZubehörNetzwerkeNetzwerkgrundlagenNetzwerkmanagementNetzwerkprotokolleNotebook & ZubehörNovell NetwareOff TopicOpenOffice, LibreOfficeOutlook & MailPapierkorbPascal und DelphiPeripheriegerätePerlPHPPythonRechtliche FragenRedHat, CentOS, FedoraRouter & RoutingSambaSAN, NAS, DASSchriftartenSchulung & TrainingSEOServerServer-HardwareSicherheitSicherheits-ToolsSicherheitsgrundlagenSolarisSonstige SystemeSoziale NetzwerkeSpeicherkartenStudentenjobs & PraktikumSuche ProjektpartnerSuseSwitche und HubsTipps & TricksTK-Netze & GeräteUbuntuUMTS, EDGE & GPRSUtilitiesVB for ApplicationsVerschlüsselung & ZertifikateVideo & StreamingViren und TrojanerVirtualisierungVisual StudioVmwareVoice over IPWebbrowserWebentwicklungWeiterbildungWindows 7Windows 8Windows 10Windows InstallationWindows MobileWindows NetzwerkWindows ServerWindows SystemdateienWindows ToolsWindows UpdateWindows UserverwaltungWindows VistaWindows XPXenserverXMLZusammenarbeit

Hyperlink in Gästebuch erstellen?

Frage Entwicklung PHP

Mitglied: jones88

jones88 (Level 1) - Jetzt verbinden

23.03.2007, aktualisiert 03.04.2007, 5712 Aufrufe, 3 Kommentare

Hyperlink im Gästebuch erstellen?

Hallo Zusammen,
Ich habe eine Frage.
Die User sollen in meinem PHP-Gästebuch die Möglichkeit haben, beim posten einer neuen Nachricht Einen Hyperlink in den Text einzufügen, welcher nachher im Gästebuch angezeigt wird. Ist das mit PHP möglich?
Habe bis jetzt noch nichts zu diesem Thema gefunden.

Danke,

Gruss Jonas
Mitglied: cat
23.03.2007 um 16:37 Uhr
Wenn ich deine Frage richtig verstehe, dann schau dir doch mal das an

http://www.w3schools.com/php/php_post.asp
Bitte warten ..
Mitglied: 4515
03.04.2007 um 15:07 Uhr
Hallo Jonas,

die Möglichkeit besteht sicher. Interessant wäre jedoch zu wissen, welches PHP-Gästebuch Du verwendest.

lg Levis24
Bitte warten ..
Mitglied: tantetoni2
03.04.2007 um 21:35 Uhr
mach es so wenn du bb-code meinst, das ist jetzt nur eine wert übergabe besser wäre es natürlich alles in eine datenbank zuschreiben

zum testen http://tantetoni2.ta.funpic.de/formular_test



formular.html

01.
<!-- javascript for BB code !--> 
02.
<script language="JavaScript" type="text/javascript"> 
03.
function cur_ins(field, startTag, endTag, offset) { 
04.
 field.focus(); 
05.
 if (document.getSelection) { 
06.
   selStart = field.selectionStart; 
07.
   selEnd = field.selectionEnd; 
08.
   text = field.value.substring(selStart, selEnd); 
09.
   field.value = field.value.substring(0, selStart) + startTag + text + endTag +  
10.
 
11.
field.value.substring(selEnd); 
12.
   if (text.length > 0) { 
13.
     if (offset != 0) { 
14.
       field.selectionStart = selStart + startTag.length + text.length - offset; 
15.
     } else { 
16.
       field.selectionStart = selStart + startTag.length + text.length + endTag.length; 
17.
18.
   } else { 
19.
      field.selectionStart = selStart + startTag.length; 
20.
21.
   field.selectionEnd = field.selectionStart; 
22.
 } else 
23.
 if (document.selection) { 
24.
     marker = document.selection.createRange(); 
25.
     text = marker.text; 
26.
     marker.text = startTag+text+endTag; 
27.
     marker = document.selection.createRange(); 
28.
     if (text.length > 0) { 
29.
       if (offset != 0) { 
30.
         marker.move('character', startTag.length + text.length - offset); 
31.
       } else { 
32.
         marker.move('character', startTag.length + text.length + endTag.length + offset); 
33.
34.
     } else { 
35.
       marker.move('character', -(endTag.length)); 
36.
37.
     marker.select(); 
38.
39.
40.
</script> 
41.
 
42.
<form name="gb" action="formular_ausgabe.php" method="post"> 
43.
<table> 
44.
<tr> 
45.
<td> Name:</td> 
46.
<td><input type="text" name="name" size="30"></td> 
47.
</tr> 
48.
 
49.
<tr> 
50.
<td>Nachricht:</td> 
51.
<td><textarea class="text" name="post" cols="48" rows="12" ></textarea></td></tr> 
52.
 
53.
</table> 
54.
<table> 
55.
<tr><td> 
56.
 
57.
<input type="button" style="color:#ffffe0; background-color:#5A8196" onmouseover="this.style.color='336699';  
58.
this.style.backgroundColor='ffffe0';" onmouseout="this.style.color='ffffe0';  
59.
this.style.backgroundColor='5A8196';"   value="F" onclick="cur_ins(this.form.post, '[b]', '[/b]', 0);"  
60.
name="bold" /> </a> 
61.
 
62.
 
63.
<input type="button" style="color:#ffffe0; background-color:#5A8196" onmouseover="this.style.color='336699';  
64.
this.style.backgroundColor='ffffe0';" onmouseout="this.style.color='ffffe0';  
65.
this.style.backgroundColor='5A8196';"  value="K" onclick="cur_ins(this.form.post, '[i]', '[/i]', 0);"  
66.
name="italic" /> 
67.
 
68.
 
69.
<input type="button" style="color:#ffffe0; background-color:#5A8196" onmouseover="this.style.color='336699';  
70.
this.style.backgroundColor='ffffe0';" onmouseout="this.style.color='ffffe0';  
71.
this.style.backgroundColor='5A8196';"  value="U" onclick="cur_ins(this.form.post, ' [u]', '[/u]', 0);"  
72.
name="underlined" /> 
73.
 
74.
<input type="button" style="color:#ffffe0; background-color:#5A8196" onmouseover="this.style.color='336699';  
75.
this.style.backgroundColor='ffffe0';" onmouseout="this.style.color='ffffe0';  
76.
this.style.backgroundColor='5A8196';"  value="Z" onclick="cur_ins(this.form.post, '[z]','',  0);"  
77.
name="umbruch" /> </a> 
78.
 
79.
<input type="button" style="color:#ffffe0; background-color:#5A8196" onmouseover="this.style.color='336699';  
80.
this.style.backgroundColor='ffffe0';" onmouseout="this.style.color='ffffe0';  
81.
this.style.backgroundColor='5A8196';"  value="Center" onclick="cur_ins(this.form.post, '[center]',  
82.
'[/center]', 0);" name="Center" />  
83.
 
84.
<input type="button" style="color:#ffffe0; background-color:#5A8196" onmouseover="this.style.color='336699';  
85.
this.style.backgroundColor='ffffe0';" onmouseout="this.style.color='ffffe0';  
86.
this.style.backgroundColor='5A8196';"  value="IMG" onclick="cur_ins(this.form.post, '[img]', '[/img]', 0);"  
87.
name="image" />  
88.
 
89.
<input type="button" style="color:#ffffe0; background-color:#5A8196" onmouseover="this.style.color='336699';  
90.
this.style.backgroundColor='ffffe0';" onmouseout="this.style.color='ffffe0';  
91.
this.style.backgroundColor='5A8196';" value="URL"  onclick="cur_ins(this.form.post, '[url]', '[/url]', 0);"  
92.
name="hyperlink" /> 
93.
 
94.
<input type="button" style="color:#ffffe0; background-color:#5A8196" onmouseover="this.style.color='336699';  
95.
this.style.backgroundColor='ffffe0';" onmouseout="this.style.color='ffffe0';  
96.
this.style.backgroundColor='5A8196';" value="E-Mail"  onclick="cur_ins(this.form.post, '[email]', '[/email]',  
97.
0);" name="email" /> 
98.
 
99.
<input type="button" style="color:#ffffe0; background-color:#5A8196" onmouseover="this.style.color='336699';  
100.
this.style.backgroundColor='ffffe0';" onmouseout="this.style.color='ffffe0';  
101.
this.style.backgroundColor='5A8196';" value="Zitat"  onclick="cur_ins(this.form.post, '[quote]', '[/quote]',  
102.
0);" name="zitat" /> 
103.
 
104.
 
105.
<select  name='color'  onchange="cur_ins(this.form.post, value,   '[/color]')"> 
106.
<option value='0'>------ Farbe -------</option> 
107.
<option style="BACKGROUND-COLOR: black" value=" [color=Black]">Black</option> 
108.
<option style="BACKGROUND-COLOR: sienna" value=" [color=Sienna]">Sienna</option> 
109.
<option style="BACKGROUND-COLOR: darkolivegreen" value=" [color=DarkOliveGreen]">Dark Olive Green</option> 
110.
<option style="BACKGROUND-COLOR: darkgreen" value=" [color=DarkGreen]">Dark Green</option> 
111.
<option style="BACKGROUND-COLOR: darkslateblue" value=" [color=DarkSlateBlue]">Dark Slate Blue</option> 
112.
<option style="BACKGROUND-COLOR: navy" value=" [color=Navy]">Navy</option> 
113.
<option style="BACKGROUND-COLOR: indigo" value=" [color=Indigo]">Indigo</option> 
114.
<option style="BACKGROUND-COLOR: darkslategray" value=" [color=DarkSlateGray]">Dark Slate Gray</option> 
115.
<option style="BACKGROUND-COLOR: darkred" value=" [color=DarkRed]">Dark Red</option> 
116.
<option style="BACKGROUND-COLOR: dar###ge" value=" [color=Dar###ge]">Dark Orange</option> 
117.
<option style="BACKGROUND-COLOR: olive" value=" [color=Olive]">Olive</option> 
118.
<option style="BACKGROUND-COLOR: green" value=" [color=Green]">Green</option> 
119.
<option style="BACKGROUND-COLOR: teal" value=" [color=Teal]">Teal</option> 
120.
<option style="BACKGROUND-COLOR: blue" value=" [color=Blue]">Blue</option> 
121.
<option style="BACKGROUND-COLOR: slategray" value=" [color=SlateGray]">Slate Gray</option> 
122.
<option style="BACKGROUND-COLOR: dimgray" value=" [color=DimGray]">Dim Gray</option> 
123.
<option style="BACKGROUND-COLOR: red" value=" [color=Red]">Red</option> 
124.
<option style="BACKGROUND-COLOR: sandybrown" value=" [color=SandyBrown]">Sandy Brown</option> 
125.
<option style="BACKGROUND-COLOR: yellowgreen" value=" [color=YellowGreen]">Yellow Green</option> 
126.
<option style="BACKGROUND-COLOR: seagreen" value=" [color=SeaGreen]">Sea Green</option> 
127.
<option style="BACKGROUND-COLOR: mediumturquoise" value=" [color=MediumTurquoise]">Medium Turquoise</option> 
128.
<option style="BACKGROUND-COLOR: royalblue" value=" [color=RoyalBlue]">Royal Blue</option> 
129.
<option style="BACKGROUND-COLOR: purple" value=" [color=Purple]">Purple</option> 
130.
<option style="BACKGROUND-COLOR: gray" value=" [color=Gray]">Gray</option> 
131.
<option style="BACKGROUND-COLOR: magenta" value=" [color=Magenta]">Magenta</option> 
132.
<option style="BACKGROUND-COLOR: orange" value=" [color=Orange]">Orange</option> 
133.
<option style="BACKGROUND-COLOR: yellow" value=" [color=Yellow]">Yellow</option> 
134.
<option style="BACKGROUND-COLOR: lime" value=" [color=Lime]">Lime</option> 
135.
<option style="BACKGROUND-COLOR: cyan" value=" [color=Cyan]">Cyan</option> 
136.
<option style="BACKGROUND-COLOR: deepskyblue" value=" [color=DeepSkyBlue]">Deep Sky Blue</option> 
137.
<option style="BACKGROUND-COLOR: darkorchid" value=" [color=DarkOrchid]">Dark Orchid</option> 
138.
<option style="BACKGROUND-COLOR: silver" value=" [color=Silver]">Silver</option> 
139.
<option style="BACKGROUND-COLOR: pink" value=" [color=Pink]">Pink</option> 
140.
<option style="BACKGROUND-COLOR: wheat" value=" [color=Wheat]">Wheat</option> 
141.
<option style="BACKGROUND-COLOR: lemonchiffon" value=" [color=LemonChiffon]">Lemon Chiffon</option> 
142.
<option style="BACKGROUND-COLOR: palegreen" value=" [color=PaleGreen]">Pale Green</option> 
143.
<option style="BACKGROUND-COLOR: paleturquoise" value=" [color=PaleTurquoise]">Pale Turquoise</option> 
144.
<option style="BACKGROUND-COLOR: lightblue" value=" [color=LightBlue]">Light Blue</option> 
145.
<option style="BACKGROUND-COLOR: plum" value=" [color=Plum]">Plum</option> 
146.
<option style="BACKGROUND-COLOR: white" value=" [color=White]">White</option> 
147.
</select> 
148.
 
149.
 
150.
<select name='size'  onchange="cur_ins(this.form.post, value,   '[/size]')"> 
151.
<option value='0'>- Grösse -</option> 
152.
<option value=" [size=1]">1</option> 
153.
<option value=" [size=2]">2</option> 
154.
<option value=" [size=3]">3</option> 
155.
<option value=" [size=4]">4</option> 
156.
<option value=" [size=5]">5</option> 
157.
<option value=" [size=6]">6</option> 
158.
<option value=" [size=7]">7</option> 
159.
</select> 
160.
 
161.
<select  name='font'  onchange="cur_ins(this.form.post, value,   '[/font]')"> 
162.
<option value='0'>--- Schrift ---</option> 
163.
<option value=" [font=Arial]">Arial</option> 
164.
<option value=" [font=Fixedsys]">Fixedsys</option> 
165.
<option value=" [font=Garamond]">Garamond</option> 
166.
<option value=" [font=Georgia]">Georgia</option> 
167.
<option value=" [font=Impact]">Impact</option> 
168.
<option value=" [font=System]">System</option> 
169.
<option value=" [font=Tahoma]">Tahoma</option> 
170.
<option value=" [font=Verdana]">Verdana</option> 
171.
</select> 
172.
 
173.
 
174.
 
175.
<input type="submit"  style="color:#ffffe0; background-color:#5A8196" onmouseover="this.style.color='336699';  
176.
this.style.backgroundColor='ffffe0';" onmouseout="this.style.color='ffffe0';  
177.
this.style.backgroundColor='5A8196';" name="submit" value="eintragen"> 
178.
</form></td></tr> 
179.
 
formular_ausgabe.php

<code type="php"><?php

$autor = $name;
$content = $post;
$content = nl2br($content);
$content = strip_tags($content);
$content = str_replace("\n", "
", $content);
$content = nl2br(stripslashes($content));

echo "<table>";

$content = str_replace ("ü", "ü", $content);
$content = str_replace ("Ãœ", "Ü", $content);
$content = str_replace ("ö", "ö", $content);
$content = str_replace ("Ö", "Ö", $content);
$content = str_replace ("ä", "ä", $content);
$content = str_replace ("Ä", "Ä", $content);
$content = str_replace ("ß", "ß", $content);
$content = str_replace ("â?¬", "€", $content);


$content = str_replace("[z]", "
", $content);

$content = str_replace("[b]", "", $content);
$content = str_replace("[/b]", "
", $content);

$content = str_replace("[i]", "", $content);
$content = str_replace("[/i]", "
", $content);

$content = str_replace("[u]", "", $content);
$content = str_replace("[/u]", "
", $content);

$content = str_replace("[p]", "<p>", $content);
$content = str_replace("[/p]", "</p>", $content);

$content = str_replace("[img]", "<img src=\"", $content);
$content = str_replace("[/img]", "\">", $content);

$content = str_replace("[link]", "<a target=\"_blank\" href=\"", $content);
$content = str_replace("[/link]", "\">Externer Hyperlink</a>", $content);

$content = str_replace("[center]", "<center>", $content);
$content = str_replace("[/center]", "</center>", $content);

$content = eregi_replace("\[email\]([^\[]+)\[/email\]","<a href=\"mailto:\\1\">\\1</a>",$content);
$content = eregi_replace("\[email=([^\[]+)\]([^\[]+)\[/email\]","<a

href=\"mailto:\\1\">\\2</a>",$content);


$content = eregi_replace("\[url=([^\[]+)\]([^\[]+)\[/url\]","<a href=\"\\1\"

target=\"_blank\">\\2</a>",$content);

$content = eregi_replace("\[url\]([^\[]+)\[/url\]","<a href=\"\\1\"

target=\"_blank\">\\1</a>",$content);

$content = preg_replace("/\[quote\](.*?)\[\/quote\]/si", "<table border=1 bordercolor=black

bgcolor=silver><tr><blockquote><th>Zitat:<font

color=black>\\1</font></th></blockquote></tr></table>", $content);

$content = eregi_replace("(\[size=)(([a-zA-Z0-9]*|\#)*)(\])","<font size=\\2>",$content);
$content = str_replace("[/size]", "</font>", $content);

$content = eregi_replace("(\[color=)(([a-zA-Z0-9]*|\#)*)(\])","<font color=\\2>",$content);
$content = str_replace("[/color]", "</font color>", $content);

$content = eregi_replace("(\[font=)(([a-zA-Z0-9]*|\#)*)(\])","<font face=\\2>",$content);
$content = str_replace("[/font]", "</font face>", $content);


echo <<<BCD
<td bgcolor="#4E6F81" bordercolor="black">Name</td><td bgcolor="#4E6F81" bordercolor="black">Eintrag</td>

<tr>
<td align="left" bgcolor="#89a9b8" valign="top">
$autor
</td>

<td width="80%" align="left" bordercolor="black" valign="top" bgcolor="#89a9b8">$content

</td>
</tr>

BCD;
?>

<code>
Bitte warten ..
Neuester Wissensbeitrag
Off Topic

"Ich habe nichts zu verbergen"

(2)

Erfahrungsbericht von FA-jka zum Thema Off Topic ...

Ähnliche Inhalte
SAN, NAS, DAS
NAS4free - RSync-Auftrag erstellen (1)

Frage von StillerLeser09 zum Thema SAN, NAS, DAS ...

SAN, NAS, DAS
gelöst Erstellen eines Ordners od. Freigabe auf der BOOT-Parition - NAS4free (3)

Frage von StillerLeser09 zum Thema SAN, NAS, DAS ...

LAN, WAN, Wireless
Selbstsigniertes Zertifikat auf Brocade Switch erstellen (8)

Frage von Coreknabe zum Thema LAN, WAN, Wireless ...

Off Topic
gelöst Webseite erstellen - Preise (14)

Frage von Xaero1982 zum Thema Off Topic ...

Heiß diskutierte Inhalte
CPU, RAM, Mainboards
Kaufberatung für mind. 8 verschiedene HighEnd-Mainboards (24)

Frage von yperiu zum Thema CPU, RAM, Mainboards ...

Hyper-V
Langsames Netzwerk i210 LAN Karte (11)

Frage von Akcent zum Thema Hyper-V ...

Netzwerke
Abisolierwerkzeug (11)

Frage von SarekHL zum Thema Netzwerke ...

Windows Server
Server 2016 - Kuriositäten (8)

Frage von certifiedit.net zum Thema Windows Server ...