<?php
include("simplegb_config.php");
require_once "../maincore.php";
require_once THEMES."templates/header.php";
echo "<div align='center'>";
$gast_submit = "Pošalji";
$ip = getenv("REMOTE_ADDR");
$show_form = true;
$do_insert = true;
if (isset($gast_submit) && $gast_submit == "Pošalji"){
$gast_name = $userdata['user_name'];
$gast_email = " ";
$gast_text_preview = $_POST["gast_text"];
$gast_text = urlencode(nl2br(htmlspecialchars($gast_text_preview)));
$gast_date = date("d m Y - H:i:s");
$laenge_name = strlen($gast_name); /* get the length of name input */
if ($laenge_name >=$max_name){
print('<font color=red size=1>'.$error_lang1.' [ maximal '.$max_name.' zeichen erlaubt! dein name hat '.$laenge_name.' zeichen ]<br><br></font>');
$do_insert=false;
}
$laenge_text = strlen($gast_text);
if ($laenge_text >=$max_text){
print('<font color=red size=1>'.$error_lang2.' [ maximal '.$max_text.' zeichen erlaubt! dein text hat '.$laenge_text.' zeichen ]<br><br></font>');
$do_insert=false;
}
$laenge_email = strlen($gast_email);
if ($laenge_email >=$max_email){
print('<font color=red size=1>'.$error_lang3.' [maximal '.$max_email.' zeichen erlaubt! deine email hat '.$laenge_email.' zeichen ]<br><br></font>');
$do_insert=false;
}
if ($gast_name == ""){
print('<font color=red size=1>'.$error_name.'<br><br></font>');
}
if ($gast_text == ""){
print('<font color=red size=1>'.$error_text.'<br><br></font>');
}
if (isset($gast_name) && $gast_name != "" && isset($gast_text) && $gast_text != "" && $do_insert){
$insert= implode("",array($gast_ip,";",$gast_date,";",$gast_name,";",$gast_email,";",$gast_text,"\n"
));
$fp = fopen($datei, "a-");fputs($fp, $insert);fclose($fp);
$show_form = false;
}
}
// the FORM begins here -------------------------------------------------------------------------------------
if (iMEMBER) {
if ($show_form == true) {
echo '
<table border='.$td_border.' cellspacing=2 cellpadding=1 width=400>
<tr>
<td background='.$td_tablebg.' bgcolor='.$tabelle1.'><b>Ljubavni sms</b></td>
</tr>
<tr>
<td bgcolor='.$tabelle2.'>
<div align=center>
<FORM ACTION="sms_ljubavni.php" METHOD=POST>
<input method="POST" type="hidden" value="'.$ip.'" >
<br>';
if(iADMIN) { echo '<INPUT NAME="gast_name" size="40" VALUE="'.$userdata['user_name'].'" ><br><br>'; }
echo '<br>Vaše poruke možete da pošaljete ako koristite sledeću formu.<br><b>Napomena:</b>Duple poruke biće obrisane, poruke koje nisu odgovarajuće sadržine takodje biće obrisane i korisnik koji ih je napisao biće opomenut ako nastavi sa takvim ponašanjem i trajno banovan sa sajta.<br>';
echo 'Tvoj sms:<br>
<textarea cols="40" rows="7" method="POST" name="gast_text" wrap=soft>'.$gast_text_preview.'</textarea><br>
<INPUT method="POST" TYPE="submit" VALUE="Pošalji">
</FORM>
</div>
</td>
</tr>
</table>
';
}
}
// the FORM ends here ------------------------------------------------------------------------------------------
$array = file($datei);
$anzal_entrys = count($array);
if (count($array) == 0){ echo "Nema poruka";}
if (count ($array) == 1){ echo "1 Poruka";}
if (count ($array) > 1) {echo count($array)." Poruka";}
if ($rev == 1){ $array = array_reverse($array); }
/* $gast_entry[0] the ip */
/* $gast_entry[1] date */
/* $gast_entry[2] name */
/* $gast_entry[3] email */
/* $gast_entry[4] text */
for($x=0; $x<count($array); $x++){
$gast_entry = explode(";",$array[$x]);
$gast_entry[4] = urldecode($gast_entry[4]);
print('
<table border='.$td_border.' cellspacing=2 cellpadding=1 width='.$td_width.'>
<tr>
<td background='.$td_tablebg.' bgcolor='.$tabelle1.'>
<a href=mailto:'.$gast_entry[3].'>'.$gast_entry[2].'</a>
- '.$gast_entry[1].'
</td>
</tr>
<tr>
<td bgcolor='.$tabelle2.'>'.$gast_entry[4].'</td>
</tr>
</table>
<br>
');
}
echo "</div>";
require_once THEMES."templates/footer.php";
?>
greska je Notice: Undefined variable: gast_text_preview in :S kako ovo da sredim? na windows serveru mi nista ne prijavljuje ni jednu gresku ali na linux ovo prijavljuje.
Hvala unapred!