29 Ocak 2010 Cuma

sayac

$dosya = fopen("sayi.txt","r");
$dosyaveri=fread($dosya,filesize("sayi.txt"));
echo "";
echo $dosyaveri."
";
fclose($dosya);
$dosyaveri=$dosyaveri+1;
$dosya = fopen("sayi.txt","w+");
$sonuc=fwrite($dosya,"$dosyaveri\r\n");
fclose($dosya);

listele

error_reporting(0);
$baglan = mysql_connect("localhost","root","");
if (!$baglan) { die('Baglanti hatasi: ' . mysql_error());}


$vt_bag=mysql_select_db("uygulama_vt", $baglan);
if(!$vt_bag) {
echo "veritabani baglantisi basarisiz!!!";
}
$sonuc = mysql_query("SELECT kullanici_adi,uye_id FROM site_kullanicilar");
while ($satir=mysql_fetch_array($sonuc)){
echo "$satir[kullanici_adi]
";}




$kullanici_adi=$_SESSION['kullanici_adi'];

$id= @$_GET["id"];
$sonuc=mysql_query("SELECT * FROM site_kullanicilar WHERE uye_id='$id'");
$sonuc2= mysql_query("SELECT yorum FROM yorumlar where yorum_yapan='$kullanici_adi'");{
$topkayit=mysql_num_rows($sonuc2 );
echo 'Yaptığı yorum sayısı:'.$topkayit.'
';}

olustur. php

$ekle="CREATE TABLE IF NOT EXISTS `anket` (
`id` int(9) unsigned NOT NULL AUTO_INCREMENT,
`uyead` varchar(15) NOT NULL,
`uyeadsoyad` varchar(20) NOT NULL,
`s1` varchar(2) NOT NULL,
`s2` varchar(2) NOT NULL,
`s3` varchar(2) NOT NULL,
`s4` varchar(2) NOT NULL,
`s5` varchar(2) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=44 ";
$sonuc=mysql_query("$ekle");

$ekle="INSERT INTO `anket` (`id`, `uyead`, `uyeadsoyad`, `s1`, `s2`, `s3`, `s4`, `s5`) VALUES
(43, 'k', 'K', '4', '3', '2', '4', '3'),
(38, 'slymnctn', 'Süleyman Çetin', '4', '4', '4', '4', '4')";
$sonuc=mysql_query("$ekle");

28 Ocak 2010 Perşembe

phph

http://hotfile.com/dl/26191068/75a946f/ahmet.rar.html

php

session_start();
ob_start();
include("yeni_baglan.php");
$kullanici_adi=$_POST['kullaniciadi'];
$parola=$_POST['parola'];

$sql = mysql_query("select kullanici_adi from site_kullanicilar where kullanici_adi='$kullanici_adi' and parola='$parola'");
$uyevarmi = mysql_num_rows($sql);
if($uyevarmi!= 0) {

$_SESSION["login"]= "true";
$_SESSION["kullanici_adi"] = $kullanici_adi;
$_SESSION["parola"] = $parola;
$_SESSION["uye_id"]=$uye_id;
header("Location:yeni_anasayfa_uye.php");

}
else{





$kullanici_adi=$_POST["kullanici"];
if(empty($kullanici_adi)){
echo "KULLANICI ADI BOS BIRAKILAMAZ! "; include("yeni_kayit_ol.php");
}
else{
$parola1=$_POST["parola"];
$parola2=$_POST["textfield3"];
if($parola1!=$parola2){
echo "Parolalar birbiri ile eslesmiyor. Lütfen kontrol edin..." ;
include("yeni_kayit_ol.php");
}else
{$e_posta=$_POST["e_posta"];
$e_kontrol=substr($_POST["e_posta"], -3);
if(isset($_POST["e_posta"]) && strpos($_POST["e_posta"],"@")and strpos($_POST["e_posta"],".")and($e_kontrol=='com' or $e_kontrol=='org')){
$bag = mysql_connect("localhost","root","");
if (!$bag) {die('Baglanti hatasi');}
mysql_select_db("uygulama_vt", $bag);
$email_kontrol = mysql_query("select e_posta from site_kullanicilar where e_posta='$e_posta'");
$kullanici_kontrol = mysql_query("select kullanici_adi from site_kullanicilar where kullanici_adi='$kullanici_adi'");
$email_kontrol2 = mysql_num_rows($email_kontrol);
$kullanici_kontrol2= mysql_num_rows($kullanici_kontrol);

if(($email_kontrol2 > 0) || ($kullanici_kontrol2 > 0))
{
echo 'Hata olustu.';
if($email_kontrol2 > 0)
{
echo 'Bu email adresi zaten kullaniliyor.';
unset($email);
}
if($kullanici_kontrol2 > 0)
{
echo 'Bu kullanici adi zaten kullaniliyor.';
unset($kullanici);
}
include("yeni_kayit_ol.php");
exit;
}
$veri_ekle=mysql_query("INSERT INTO site_kullanicilar (kullanici_adi,parola,e_posta) VALUES ('$kullanici_adi', '$parola1','$e_posta')");
if(!isset($veri_ekle))
{echo "Bir hata olustu. Lütfen tekrar deneyin.";
}else {echo "Uyelik kaydiniz basari ile tamamlanmistir. Lütfen kullanici adiniz ve parolanizla giris yapiniz.";

}
mysql_close($bag);

}else{
echo "Bu dogru bir e-mail adresi degildir. ";
include("yeni_kayit_ol.php");
}}}