Welcome, Guest. Please login or register.
Did you miss your activation email?
July 09, 2008, 09:22:13 am
42750 Posts in 8091 Topics by 17932 Members
Latest Member: codder
Turk-Php.Com Forum  |  Yardım Forumları  |  PHP Yardım Forumu  |  hata ! « previous next »
Pages: [1] Print
Author Topic: hata !  (Read 220 times)
iiceman
Yeni Kullanıcılar
*
Offline Offline

Posts: 5


View Profile
hata !
« on: April 27, 2008, 11:46:29 am »

merhaba arkadaşlar ben bi bilgi formu yaptım ama line 45 gösteriyor hata die line 45 de bir şey yok ortada codlar aşağıda bi bakıp yardım ederseniz sevinirim şimdiden teşekkürleri

<html>
<head>
<title> Başvuru Kaydı </title>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-9" />
</head>
<body topmargin="0" bottommargin="0" rightmargin="0" leftmargin="0">

<?php
  // kayit
  $firma_adi=$_POST['firma_adi'];
  $ad=$_POST['ad'];
  $soyad=$_POST['soyad'];
  $e_mail=$_POST['e_mail'];
  $tel=$_POST['tel'];
  $aciklama=$_POST['aciklama'];
 
  if (!$firma_adi || !$ad || !$soyad || !$e_mail || !$tel || !$aciklama)
  {
    echo 'You have not entered all the required details.
'.'Please go back and try again.';
   exit;
  }
  if (!get_magic_quotes_gpc())
  {
  $firma_adi = addslashes($firma_adi);
  $ad = addslashes($ad);
  $soyad = addslashes($soyad);
  $e_mail = addslashes($e_mail);
  $tel = addslashes($tel);
  $aciklama = addslashes($aciklama);
 
  @ $db = new mysqli('firma_adi', 'ad', 'soyad', 'e_mail', 'tel', 'aciklama');
 
  if(mysqli_connect_errno())
  {
    echo 'Error: Could not connect to database. Please try again later.';
   exit;
  }
 
  $query =  "insert into iletisim values('".$firma_adi."', '".$ad."', '".$soyad."', '".$e_mail."', '".$tel."', '".$aciklama."')";
  $result = $db->query($query);
  if ($result) echo $db->affected_rows.' books inserted into database.';
  $db->close();
?>
</body>
</html>
Logged
mumincelik
PHP Öğrencisi
*
Offline Offline

Posts: 127


View Profile WWW
Ynt: hata !
« Reply #1 on: April 27, 2008, 12:41:51 pm »

if (!get_magic_quotes_gpc())
  {


bunu kapatmamissin. Nerden itibaren kapatacaksan oraya } koy sorun cozulur
Logged

iiceman
Yeni Kullanıcılar
*
Offline Offline

Posts: 5


View Profile
Ynt: hata !
« Reply #2 on: April 27, 2008, 02:18:35 pm »

bu seferde böle hata veriyor Sad

Notice: Undefined index: e_mail in c:\program files\easyphp1-8\www\tepelitasarim\web\basvuru.php on line 13

Notice: Undefined index: tel in c:\program files\easyphp1-8\www\tepelitasarim\web\basvuru.php on line 14

Notice: Undefined index: aciklama in c:\program files\easyphp1-8\www\tepelitasarim\web\basvuru.php on line 15
You have not entered all the required details.
Please go back and try again.

<html>
<head>
<title> Başvuru Kaydı </title>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-9" />
</head>
<body topmargin="0" bottommargin="0" rightmargin="0" leftmargin="0">

<?php
  // kayit
  $firma_adi=$_POST['firma_adi'];
  $ad=$_POST['ad'];
  $soyad=$_POST['soyad'];
  $e_mail=$_POST['e_mail'];
  $tel=$_POST['tel'];
  $aciklama=$_POST['aciklama'];
 
  if (!$firma_adi || !$ad || !$soyad || !$e_mail || !$tel || !$aciklama)
  {
    echo 'You have not entered all the required details.
'.'Please go back and try again.';
   exit;
  }
  if (!get_magic_quotes_gpc())
  {
  $firma_adi = addslashes($firma_adi);
  $ad = addslashes($ad);
  $soyad = addslashes($soyad);
  $e_mail = addslashes($e_mail);
  $tel = addslashes($tel);
  $aciklama = addslashes($aciklama);
  }
  @ $db = new mysqli('firma_adi', 'ad', 'soyad', 'e_mail', 'tel', 'aciklama');
 
  if(mysqli_connect_errno())
  {
    echo 'Error: Could not connect to database. Please try again later.';
   exit;
  }
 
  $query =  "insert into iletisim values('".$firma_adi."', '".$ad."', '".$soyad."', '".$e_mail."', '".$tel."', '".$aciklama."')";
  $result = $db->query($query);
  if ($result) echo $db->affected_rows.' books inserted into database.';
  $db->close();
?>
</body>
</html>

yukarıdaki gibi yaptım kardeş hata yukarıda
Logged
mumincelik
PHP Öğrencisi
*
Offline Offline

Posts: 127


View Profile WWW
Ynt: hata !
« Reply #3 on: April 27, 2008, 02:39:25 pm »

e_mail, tel, ve aciklama formdan bos geliyorsa bu hatayi verir. normalde php de degiskenler tanimlanmasi gerekir fakat server ayalarinda bu hata kismi kapatildigi icin ekrana yansimaz fakat seninkinde ayarlanmamis yansiyor. $_POST ile veri alirken verinin bos gelip gelmedigini kontrol ettirip ddegiskenlere oyle aktarman gerekir
Logged

iiceman
Yeni Kullanıcılar
*
Offline Offline

Posts: 5


View Profile
Ynt: hata !
« Reply #4 on: April 28, 2008, 10:47:18 am »

nasıl kontrol edebilirim acaba ?
Logged
emanet
Yeni Kullanıcılar
*
Offline Offline

Posts: 3


View Profile
Ynt: hata !
« Reply #5 on: April 29, 2008, 03:13:00 am »

Code:
print "<pre>";
print_r($_POST);

print_r ile arrayların içini görüntüleyebilirsin

browserinde yazdırırken sıkıntı çekiyorum dersen şu functionu kullnanarak ekranda kaymalar sapmalar olmadan arrayı yazdırabilirsin.
Code:
function ArrayYaz($AR, $B=''){
   $S .= "Array \n$B(\n";
   $I = 0;
   while (list($key, $val) = each($AR)) {  $I++;
      if (is_array($val))
         $S .= $B."    [$key] => ".print_a($val, $B."       ");
      else
         $S .= $B."    [$key] => $val".(($I==count($AR))?"\n$B)\n":"")."\n";

   }
   return $S;
}

örneğin
Code:
print ArrayYaz($_POST);
Logged
iiceman
Yeni Kullanıcılar
*
Offline Offline

Posts: 5


View Profile
Ynt: hata !
« Reply #6 on: April 30, 2008, 06:47:08 pm »

arkadaşlar yardımlarınız için sagol ama ben bu codları tam nereye ekleyeceğimi anlayamadım Sad bu yüzden sizlerden özür dilerim daha yeni başladım çünkü php ye ve bu codları benim gönderdiğim codlar üzerinde nasıl kullanacağımı gösterebilirmisiniz acaba çok şey istemiyorsam Sad şimdiden teşekkür ederim
Logged
mumincelik
PHP Öğrencisi
*
Offline Offline

Posts: 127


View Profile WWW
Ynt: hata !
« Reply #7 on: May 01, 2008, 06:35:11 pm »

if(isset($_POST['ad'])) $ad=$_POST['ad']; else $ad = '';
Logged

Pages: [1] Print 
« previous next »
Jump to: