Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Ksiega Gosci
MuMuMilk
post
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 18.02.2004

Ostrzeżenie: (0%)
-----


Witam (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif) , jestem nowy i mam maly problem... jak zrobic aby w tej ksiedze gosci mozna bylo wstawiac emoty (czy jak to sie pisze ;p) (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) ?

[php:1:2761cc1bc4]<?php

$txt=fopen("guestbook.gb","r");

$gbfile="";
while($line=fgets($txt,3000))
$gbfile.=$line;

//name
if(isset($name))
if($name==""){
$errorfarbe_1 = "red";
$error = "fehler";
}
else{
$errorfarbe_1 = "black";
}

//comment
if(isset($comment))
if($comment==""){
$errorfarbe_2 = "red";
$error = "fehler";
}
else{
$errorfarbe_2 = "black";
}

if(!$aktion){
$aktion = "eingabe";
}

if($error=="fehler"||$aktion=="eingabe"){
?>


<p align="center"><strong>Spis </strong></p>
<form method="post" action="<? echo $PHP_SELF;?>">
<div align="left"><strong>Nick</strong><br />
<input type="text" name="name" size="30" <? if(isset($name)) echo
"value='$name'";?> class="eingabe">
<br />
<strong>Mail</strong><br />
<input type="text" name="mail" size="30" class="eingabe">
<br />
<strong>Linkstrong><br />
<input type="text" name="site" size="100" value="http://" class="eingabe">
<br />
<font color="#FFCCCC"><br>
</font><strong>Wpisz:</strong>:<br />
<textarea name="comment" cols="100" rows="10" class="eingabe"><?
if(isset($comment)) echo "$comment";?></textarea>
<br />
<br />
<input type="submit" name="Button" value="Wyslij" class="eingabe">
<input type="Hidden" name="aktion" value="senden" class="eingabe">
<br>
</div>
</form>




<p align="center"><strong>Wpisy:</strong></p>
<p>&nbsp;</p>

<?
echo "<p>$gbfile</p>"
?>
<? }else{

if(isset($name)&&isset($comment)&&isset($mail)&&isset($site))
{
$name=stripslashes(strip_tags($name));
$comment=stripslashes(strip_tags($comment));
$mail=stripslashes(strip_tags($mail));
$site=stripslashes(strip_tags($site));


$gbfile="<b>$name</b> - ".date("m/d/Y")."<br>n<a
href='mailto:$mail'>$mail</a>n"."<br>n<a href='$site'
target='blank'>$site</a>n"."<br>n $comment <br><br>n".$gbfile;
fclose($txt);
$txt=fopen("guestbook.gb","w");
fputs($txt,$gbfile);
}
echo "<p><a href='wpisy.php'>Wpisy</a><br><br> " . $gbfile . "</p>";
fclose($txt);
}


?>[/php:1:2761cc1bc4]
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
tiraeth
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 1 789
Pomógł: 41
Dołączył: 30.10.2003
Skąd: Wrocław

Ostrzeżenie: (0%)
-----


Więc.. nie ma sensu zapisywać do pliku jakis html'owych znaczników... łatwiej zrobić to przy wyświetlaniu...

[php:1:898d861088]
...ciach...
<p align="center"><strong>Wpisy:</strong></p>
<p>&nbsp;</p>
<?php
// Zamieniamy na emotki
$gbfile=str_replace(":)", " <img src="icon/usmiech.gif"> ", $gbfile);
$gbfile=str_replace(":-)", " <img src="icon/usmiech.gif"> ", $gbfile);
$gbfile=str_replace(":(", " <img src="icon/smutek.gif"> ", $gbfile);
$gbfile=str_replace(":]", " <img src="icon/krzywy.gif"> ", $gbfile);
$gbfile=str_replace(":p", " <img src="icon/jezyk.gif"> ", $gbfile);
$gbfile=str_replace(":P", " <img src="icon/jezyk.gif"> ", $gbfile);
$gbfile=str_replace(";)", " <img src="icon/oczko.gif"> ", $gbfile);
$gbfile=str_replace(":d", " <img src="icon/dyy.gif"> ", $gbfile);
$gbfile=str_replace(":D", " <img src="icon/dyy.gif"> ", $gbfile);

// Wyświetlamy wpisy
echo "<p>$gbfile</p>"
?>
...ciach...[/php:1:898d861088]
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 12.10.2025 - 15:22