Viewing File: /people/testlab/www/testlab.com.pl/script/s667.php

   <?
    $obst = rand(0, 100000000); //losujemy liczbę od 0 do 100000000 i przypisujemy ją do zmiennej obst 
	session_start(); //uruchamiamy sesję 
//	session_register('obst'); //dla sesji rejestrujemy obst 
	$_SESSION['obst']=$obst; //przypisanie zawartości zmiennej obst do obst 
	$sprawdz = md5(md5($obst)); //generujemy 32-bitowy token zawartości zmiennej obst za pomocą algorytmu md5 i przypisujemy go do zmiennej sprawdz 
	$_SESSION['sprawdz']=$sprawdz; 
	
$tresc	=$row['tresc'];

$sql="select * from ustawienia where typ='s".$_GET['page']."'";
$db->query($sql);
$row=$db->fetchrow();
$params=explode(";",$row['text']);

	
	
	if ($_GET['param']=='wyslij')
	{
	$db=new DBConnect();
$sql="select * from ustawienia where typ='title'";
$db->query($sql);
$row=$db->fetchrow();
$title=$row['text'];
$to=$params[1];

		$vbCrLF="\n";

$tekst1="Wiadomość ze strony $title".$vbCrLF.$vbCrLF;
$tekst1=$tekst1."----------------------------------------------------".$vbCrLF;
$tekst1=$tekst1.$_POST['tresc'].$vbCrLF.$vbCrLF;
$tekst1=$tekst1."e-mail: ".$_POST['email'].$vbCrLF;
$tekst1=$tekst1."client IP: ".$_SERVER["REMOTE_ADDR"].$vbCrLF;

$message = $tekst1;
$charset='UTF-8';
$subject=$_POST['temat'];
$encoded_subject="=?$charset?B?".base64_encode($subject)."?=\n";
$from=$to;
//$from=$_POST['email'];
$body=$tekst1;

$headers="From: ".$from."\n"
		. "Content-Type: text/plain; charset=$charset; format=flowed\n"
		. "MIME-Version: 1.0\n"
		. "Content-Transfer-Encoding: 8bit\n"
		. "X-Mailer: PHP\n";
mail($to,$encoded_subject, $body,$headers);

komunikat('msg_ok',$languages['wyslano_wiadomosc']);

	}
	?> 
<script>
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		$('msg_field').innerHTML="<?echo "".$languages['zly_email'];?>";
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
$('msg_field').innerHTML="<?echo "".$languages['zly_email'];?>";
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
$('msg_field').innerHTML="<?echo "".$languages['zly_email'];?>";
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
$('msg_field').innerHTML="<?echo "".$languages['zly_email'];?>";
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
$('msg_field').innerHTML="<?echo "".$languages['zly_email'];?>";
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
$('msg_field').innerHTML="<?echo "".$languages['zly_email'];?>";
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
$('msg_field').innerHTML="<?echo "".$languages['zly_email'];?>";
		    return false
		 }

 		 return true					
	}


function validacja()
{
	if (($('temat').value==null)||($('temat').value=="")){
$('msg_field').innerHTML="<?echo "".$languages['brak_tematu'];?>";
		$('temat').focus();
		return false;
	}

	if (($('tresc').value==null)||($('tresc').value=="")){
$('msg_field').innerHTML="<?echo "".$languages['brak_tresci'];?>";
		$('tresc').focus();
		return false;
	}
//sprawdzenie emaila

	var emailID=$('email');
	
	if ((emailID.value==null)||(emailID.value=="")){
$('msg_field').innerHTML="<?echo "".$languages['brak_email'];?>";
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
	//	emailID.value=""
		emailID.focus()
		return false
	}

//sprawdzenie kodu
if (($('ID').value=="")||($('ID').value==null)) {$('msg_field').innerHTML="<?echo "".$languages['podaj_kod'];?>";$('ID').focus();return false;}
var x = '0';
x = hex_md5($("ID").value);
x= hex_md5(x);
if (x==$('sprawdz').value) $('contact_form').submit();
else 
{
$('msg_field').innerHTML="<?echo "".$languages['zly_kod'];?>";
$('ID').focus();
}
}
</script>
	

	<? echo "$tresc";
	
	if ($params[0]=='true')
	{
	?>	

	
	  <form action="index.php?page=<?=$_GET['page'];?>&param=wyslij" name=contact_form id=contact_form method=post>
	  <table cellspacing=10 style='width:550px;'>
	  <tr><td valigon=top>
	    <label for=temat><?echo "".$languages['temat_wiadomosci'];?></label>
	    <input type=text name=temat id=temat style='width:250px'><br>
		<br>
		<label for=email><?echo "".$languages['adres_email'];?></label>
		<input type=text name=email id=email style='width:250px'><br>
		
		<br>
        <img src="panel/kod.php"> <br>
		<label for=ID><?echo "".$languages['kod_z_obrazka'];?></label> 
		<INPUT NAME="ID" id=ID style='width:250px'><br> <input name="sprawdz" id=sprawdz value="<?php echo $sprawdz ?>" type="hidden">		
		</td>
		<td valign=top style='font-face:arial'> 
		
		<label for=temat><?echo "".$languages['tresc_wiadomosci'];?></label>
		<textarea name=tresc id=tresc style='width:250px;height:180px;' ></textarea><br>
		</td>
	  </tr>
	  <tr><td id=msg_field></td><td style='text-align:right'><input type=button class=button value='<?echo "".$languages['wyslij_wiadomosc'];?>' onclick="validacja()"></td></tr>
	  </table>
	  </form>
     <?
	 }	
	 if ($params[2]=='true')
	 echo "<iframe src=\"http://www.enterprisewizard.co.uk/viewMap.asp?mapTitle=&locationName=".$params[3]."&location=Address&country=PL&countryname=&street=".$params[4]."&City=&State=&Zip=&MarkerSymbol=icon2.png&MarkerShadow=on&PreFillComment=on&Comment=&mapType=NORMAL&zoomLevel=14&AllowDrag=on&NavigationControl=large&TypeSelector=on&CenterPoint=Automatic&CenteredOnLat=0&CenteredOnLng=0&mapWidth=500&mapHeight=400\" width=\"500\" height=\"400\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\" scrolling=\"no\" id=map_frame></iframe>";
	 
	 
	 ?>


Back to Directory File Manager