E-posta Maskeleme ve Yönlendirme

PHP
30 lines
<?php
class Maskele{
var $Eposta = "";
var $DegisenEposta = "";
function Maskele($eposta){
$this->Eposta = $eposta;
}
function epostaMaskele(){
$yeniEposta = $this->Eposta;
$yeniEposta = str_replace("@"," at ",$yeniEposta);
$yeniEposta = str_replace("."," dot ",$yeniEposta);
$this->DegisenEposta = $yeniEposta;
}
function epostaCoz(){
$yeniEposta = $this->Eposta;
$yeniEposta = str_replace(" at ","@",$yeniEposta);
$yeniEposta = str_replace(" dot ",".",$yeniEposta);
$this->DegisenEposta = $yeniEposta;
}
function yazdir(){
echo '<a href="mailto:'.$this->Eposta.'">'.$this->DegisenEposta.'</a>';
}
function yonlendir(){
echo "<script>";
echo "location = 'mailto:" . $this->DegisenEposta . "';";
echo "</script>";
}
}
?>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Test 1

PHP
5 lines
<?php
$e=new Maskele("ulusanyazilim@gmail.com");
$e->epostaMaskele();
$e->yazdir();
?>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Çıktısı

Markdown
1 lines
<a href="mailto:ulusanyazilim@gmail.com">ulusanyazilim at gmail dot com</a>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Test 2

PHP
6 lines
<?php
echo '<a href="?mail=ulusanyazilim at gmail dot com">Bu Adrese E-Posta Gönder</a>';
$e=new Maskele($_GET["mail"]);
$e->epostaCoz();
$e->yonlendir();
?>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Çıktısı

HTML
1 lines
<script>location = 'mailto:ulusanyazilim@gmail.com';</script>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

 

 

Direkt veya Süreli Yönlendirme

Normal Direkt Yönlendirme

PHP
2 lines
<?php header('Location: /index.php'); ?>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Süreli Yönlendirme

PHP
9 lines
<?php
function sureliyonlendir($url,$saniye){
$mesaj="$saniye saniye sonra $url sitesine yönlendirileceksiniz.<br>";
$mesaj.="Eğer beklemek istemiyorsanız <a href=\"$url\">buraya tıklayınız</a>";
return header("refresh:$saniye;url=$url").die($mesaj);
}
sureliyonlendir("index.php",3);
?>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

 

Seçenek Seçerek Otomatik Yönlendirme

HTML
6 lines
<SELECT onchange='window.location.href="?sehir="+this.options[this.selectedIndex].value'>
<OPTION selected VALUE="0">Bir şehir seçmelisiniz</OPTION>
<OPTION VALUE="3">Konya</OPTION>
<OPTION VALUE="2">Ankara</OPTION>
<OPTION VALUE="1">Eskişehir</OPTION>
</SELECT>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX